]> git.lyx.org Git - lyx.git/blob - src/insets/InsetFlex.h
Introducing TextClassPtr.h to minimize header dependencies.
[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         /// should paragraph indendation be ommitted in any case?
56         bool neverIndent(Buffer const &) const { return true; }
57
58 protected:
59         InsetFlex(InsetFlex const &);
60
61 private:
62         virtual Inset * clone() const;
63
64         ///
65         std::string name_;
66 };
67
68
69 } // namespace lyx
70
71 #endif