]> git.lyx.org Git - lyx.git/blob - src/insets/InsetFlex.h
Fix bug 4037 and related problems. The patch has been cleaned up a bit
[lyx.git] / src / insets / InsetFlex.h
1 // -*- C++ -*-
2 /**
3  * \file InsetFlex.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  * \author Martin Vermeer
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSETFLEX_H
14 #define INSETFLEX_H
15
16 #include "InsetCollapsable.h"
17
18 using std::string;
19
20 namespace lyx {
21
22
23 /** The Flex inset, e.g., CharStyle, Custom inset or XML short element
24
25 */
26 class InsetFlex : public InsetCollapsable {
27 public:
28         ///
29         InsetFlex(BufferParams const &,
30                   TextClassPtr tc, string const & layoutName);
31         ///
32         docstring name() const { return from_utf8(name_); }
33
34         /// Is this character style defined in the document's textclass?
35         /// May be wrong after textclass change or paste from another document
36         bool undefined() const;
37         ///
38         virtual docstring const editMessage() const;
39         ///
40         InsetCode lyxCode() const { return FLEX_CODE; }
41         ///
42         void write(Buffer const &, std::ostream &) const;
43         ///
44         void read(Buffer const & buf, Lexer & lex);
45         ///
46         virtual bool allowParagraphCustomization(idx_type) const { return false; }
47
48         ///
49         int plaintext(Buffer const &, odocstream &,
50                       OutputParams const &) const;
51         ///
52         int docbook(Buffer const &, odocstream &,
53                     OutputParams const &) const;
54         /// the string that is passed to the TOC
55         virtual void textString(Buffer const &, odocstream &) const;
56         ///
57         void validate(LaTeXFeatures &) const;
58
59         /// should paragraph indendation be ommitted in any case?
60         bool neverIndent(Buffer const &) const { return true; }
61
62 protected:
63         InsetFlex(InsetFlex const &);
64
65 private:
66         virtual Inset * clone() const;
67
68         ///
69         std::string name_;
70         ///
71         std::set<std::string> packages_;
72         ///
73         std::string preamble_;
74 };
75
76
77 } // namespace lyx
78
79 #endif