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 struct InsetCharStyleParams {
22 void write(std::ostream & os) const;
24 void read(LyXLex & lex);
28 std::string latextype;
30 std::string latexname;
32 std::string latexparam;
40 /** The CharStyle inset, also XML short element
43 class InsetCharStyle : public InsetCollapsable {
46 InsetCharStyle(BufferParams const &, CharStyles::iterator);
48 std::string const editMessage() const;
50 InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
52 void write(Buffer const &, std::ostream &) const;
54 void read(Buffer const & buf, LyXLex & lex);
56 void metrics(MetricsInfo &, Dimension &) const;
58 void draw(PainterInfo &, int, int) const;
60 void getDrawFont(LyXFont &) const;
62 int latex(Buffer const &, std::ostream &,
63 OutputParams const &) const;
65 int linuxdoc(Buffer const &, std::ostream &,
66 OutputParams const &) const;
68 int docbook(Buffer const &, std::ostream &,
69 OutputParams const &) const;
71 int plaintext(Buffer const &, std::ostream &,
72 OutputParams const &) const;
74 void validate(LaTeXFeatures &) const;
77 InsetCharStyleParams const & params() const { return params_; }
80 InsetCharStyle(InsetCharStyle const &);
81 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
83 bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
86 friend class InsetCharStyleParams;
88 virtual std::auto_ptr<InsetBase> doClone() const;
90 /// used by the constructors
93 InsetCharStyleParams params_;