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 InsetCharStyle(InsetCharStyle const &);
50 virtual std::auto_ptr<InsetBase> clone() const;
52 std::string const editMessage() const;
54 InsetOld::Code lyxCode() const { return InsetOld::CHARSTYLE_CODE; }
56 void write(Buffer const &, std::ostream &) const;
58 void read(Buffer const & buf, LyXLex & lex);
60 void metrics(MetricsInfo &, Dimension &) const;
62 void draw(PainterInfo &, int, int) const;
64 void getDrawFont(LyXFont &) const;
66 int latex(Buffer const &, std::ostream &,
67 OutputParams const &) const;
69 int linuxdoc(Buffer const &, std::ostream &,
70 OutputParams const &) const;
72 int docbook(Buffer const &, std::ostream &,
73 OutputParams const &) const;
75 int plaintext(Buffer const &, std::ostream &,
76 OutputParams const &) const;
78 void validate(LaTeXFeatures &) const;
81 InsetCharStyleParams const & params() const { return params_; }
85 virtual void priv_dispatch(LCursor & cur, FuncRequest & cmd);
89 friend class InsetCharStyleParams;
91 /// used by the constructors
94 InsetCharStyleParams params_;