4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
8 * \author Martin Vermeer
10 * Full author contact details are available in file CREDITS.
16 #include "InsetCollapsable.h"
17 #include "TextClass.h"
23 class InsetFlexParams {
26 void write(std::ostream & os) const;
28 void read(Lexer & lex);
34 /** The Flex inset, e.g., CharStyle, Custom inset or XML short element
37 class InsetFlex : public InsetCollapsable {
40 InsetFlex(BufferParams const &, InsetLayout);
42 docstring name() const { return from_ascii("Flex"); }
43 /// Is this character style defined in the document's textclass?
44 /// May be wrong after textclass change or paste from another document
45 bool undefined() const;
46 /// (Re-)set the character style parameters from \p il
47 void setLayout(InsetLayout il);
49 virtual docstring const editMessage() const;
51 Inset::Code lyxCode() const { return Inset::FLEX_CODE; }
53 void write(Buffer const &, std::ostream &) const;
55 void read(Buffer const & buf, Lexer & lex);
57 bool metrics(MetricsInfo &, Dimension &) const;
59 void draw(PainterInfo &, int, int) const;
61 void getDrawFont(Font &) const;
63 bool forceDefaultParagraphs(idx_type) const { return true; }
66 int plaintext(Buffer const &, odocstream &,
67 OutputParams const &) const;
69 int docbook(Buffer const &, odocstream &,
70 OutputParams const &) const;
71 /// the string that is passed to the TOC
72 virtual void textString(Buffer const &, odocstream &) const;
75 InsetFlexParams const & params() const { return params_; }
77 /// should paragraph indendation be ommitted in any case?
78 bool neverIndent(Buffer const &) const { return true; }
81 InsetFlex(InsetFlex const &);
82 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
84 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
87 friend class InsetFlexParams;
89 virtual Inset * clone() const;
92 InsetFlexParams params_;