3 * \file InsetCharStyle.h
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.
13 #ifndef INSETCHARSTYLE_H
14 #define INSETCHARSTYLE_H
16 #include "InsetCollapsable.h"
17 #include "TextClass.h"
23 class InsetCharStyleParams {
26 void write(std::ostream & os) const;
28 void read(Lexer & lex);
34 /** The CharStyle inset, also XML short element
37 class InsetCharStyle : public InsetCollapsable {
39 /// Construct an undefined character style
40 InsetCharStyle(BufferParams const &, std::string const);
42 InsetCharStyle(BufferParams const &, InsetLayout);
44 docstring name() const { return from_ascii("CharStyle"); }
45 /// Is this character style defined in the document's textclass?
46 /// May be wrong after textclass change or paste from another document
47 bool undefined() const;
48 /// (Re-)set the character style parameters from \p il
49 void setLayout(InsetLayout il);
51 virtual docstring const editMessage() const;
53 Inset::Code lyxCode() const { return Inset::CHARSTYLE_CODE; }
55 void write(Buffer const &, std::ostream &) const;
57 void read(Buffer const & buf, Lexer & lex);
59 bool metrics(MetricsInfo &, Dimension &) const;
61 void draw(PainterInfo &, int, int) const;
63 void getDrawFont(Font &) const;
65 bool forceDefaultParagraphs(idx_type) const { return true; }
68 int plaintext(Buffer const &, odocstream &,
69 OutputParams const &) const;
71 int docbook(Buffer const &, odocstream &,
72 OutputParams const &) const;
73 /// the string that is passed to the TOC
74 virtual void textString(Buffer const &, odocstream &) const;
77 InsetCharStyleParams const & params() const { return params_; }
79 /// should paragraph indendation be ommitted in any case?
80 bool neverIndent(Buffer const &) const { return true; }
83 InsetCharStyle(InsetCharStyle const &);
84 virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
86 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
89 friend class InsetCharStyleParams;
91 virtual Inset * clone() const;
94 InsetCharStyleParams params_;