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 "lyxtextclass.h"
20 class InsetCharStyleParams {
23 void write(std::ostream & os) const;
25 void read(LyXLex & lex);
29 std::string latextype;
31 std::string latexname;
33 std::string latexparam;
41 /** The CharStyle inset, also XML short element
44 class InsetCharStyle : public InsetCollapsable {
46 /// Construct an undefined character style
47 InsetCharStyle::InsetCharStyle(BufferParams const &, std::string const);
49 InsetCharStyle(BufferParams const &, CharStyles::iterator);
50 /// Is this character style defined in the document's textclass?
51 /// May be wrong after textclass change or paste from another document
52 bool undefined() const;
53 /// Set the character style to "undefined"
55 /// (Re-)set the character style parameters from \p cs
56 void setDefined(CharStyles::iterator cs);
58 std::string const editMessage() const;
60 InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
62 void write(Buffer const &, std::ostream &) const;
64 void read(Buffer const & buf, LyXLex & lex);
66 void metrics(MetricsInfo &, Dimension &) const;
68 void draw(PainterInfo &, int, int) const;
70 void getDrawFont(LyXFont &) const;
72 int latex(Buffer const &, std::ostream &,
73 OutputParams const &) const;
75 int linuxdoc(Buffer const &, std::ostream &,
76 OutputParams const &) const;
78 int docbook(Buffer const &, std::ostream &,
79 OutputParams const &) const;
81 int plaintext(Buffer const &, std::ostream &,
82 OutputParams const &) const;
84 void validate(LaTeXFeatures &) const;
87 InsetCharStyleParams const & params() const { return params_; }
90 InsetCharStyle(InsetCharStyle const &);
91 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
93 bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
96 friend class InsetCharStyleParams;
98 virtual std::auto_ptr<InsetBase> doClone() const;
100 /// used by the constructors
103 InsetCharStyleParams params_;