]> git.lyx.org Git - lyx.git/blob - src/insets/InsetFlex.h
4ac50dcd0531116605fb8aab0b169ddaf577be6e
[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
19 namespace lyx {
20
21
22 /** The Flex inset, e.g., CharStyle, Custom inset or XML short element
23
24 */
25 class InsetFlex : public InsetCollapsable {
26 public:
27         ///
28         InsetFlex(BufferParams const &, InsetLayout const &);
29         ///
30         docstring name() const { return from_utf8(name_); }
31
32         /// Is this character style defined in the document's textclass?
33         /// May be wrong after textclass change or paste from another document
34         bool undefined() const;
35         ///
36         virtual docstring const editMessage() const;
37         ///
38         InsetCode lyxCode() const { return FLEX_CODE; }
39         ///
40         void write(Buffer const &, std::ostream &) const;
41         ///
42         void read(Buffer const & buf, Lexer & lex);
43         ///
44         bool forceDefaultParagraphs(idx_type) const { return true; }
45
46         ///
47         int plaintext(Buffer const &, odocstream &,
48                       OutputParams const &) const;
49         ///
50         int docbook(Buffer const &, odocstream &,
51                     OutputParams const &) const;
52         /// the string that is passed to the TOC
53         virtual void textString(Buffer const &, odocstream &) const;
54         ///
55         void validate(LaTeXFeatures &) const;
56
57         /// should paragraph indendation be ommitted in any case?
58         bool neverIndent(Buffer const &) const { return true; }
59
60 protected:
61         InsetFlex(InsetFlex const &);
62
63 private:
64         virtual Inset * clone() const;
65
66         ///
67         std::string name_;
68         ///
69         std::vector<std::string> packages_;
70         ///
71         std::string preamble_;
72 };
73
74
75 } // namespace lyx
76
77 #endif