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 {
47 InsetCharStyle(BufferParams const &, CharStyles::iterator);
49 std::string const editMessage() const;
51 InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
53 void write(Buffer const &, std::ostream &) const;
55 void read(Buffer const & buf, LyXLex & lex);
57 void metrics(MetricsInfo &, Dimension &) const;
59 void draw(PainterInfo &, int, int) const;
61 void getDrawFont(LyXFont &) const;
63 int latex(Buffer const &, std::ostream &,
64 OutputParams const &) const;
66 int linuxdoc(Buffer const &, std::ostream &,
67 OutputParams const &) const;
69 int docbook(Buffer const &, std::ostream &,
70 OutputParams const &) const;
72 int plaintext(Buffer const &, std::ostream &,
73 OutputParams const &) const;
75 void validate(LaTeXFeatures &) const;
78 InsetCharStyleParams const & params() const { return params_; }
81 InsetCharStyle(InsetCharStyle const &);
82 virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
84 bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
87 friend class InsetCharStyleParams;
89 virtual std::auto_ptr<InsetBase> doClone() const;
91 /// used by the constructors
94 InsetCharStyleParams params_;