]> git.lyx.org Git - lyx.git/blob - src/insets/insetcharstyle.h
Asger's exchanging of the class and struct keywords.
[lyx.git] / src / insets / insetcharstyle.h
1 // -*- C++ -*-
2 /**
3  * \file insetcharstyle.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  * \author Martin Vermeer
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSETCHARSTYLE_H
14 #define INSETCHARSTYLE_H
15
16 #include "insetcollapsable.h"
17 #include "lyxtextclass.h"
18
19
20 class InsetCharStyleParams {
21 public:
22         ///
23         void write(std::ostream & os) const;
24         ///
25         void read(LyXLex & lex);
26         ///
27         std::string type;
28         ///
29         std::string latextype;
30         ///
31         std::string latexname;
32         ///
33         std::string latexparam;
34         ///
35         LyXFont font;
36         ///
37         LyXFont labelfont;
38 };
39
40
41 /** The CharStyle inset, also XML short element
42
43 */
44 class InsetCharStyle : public InsetCollapsable {
45 public:
46         ///
47         InsetCharStyle(BufferParams const &, CharStyles::iterator);
48         ///
49         std::string const editMessage() const;
50         ///
51         InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
52         ///
53         void write(Buffer const &, std::ostream &) const;
54         ///
55         void read(Buffer const & buf, LyXLex & lex);
56         ///
57         void metrics(MetricsInfo &, Dimension &) const;
58         ///
59         void draw(PainterInfo &, int, int) const;
60         ///
61         void getDrawFont(LyXFont &) const;
62         ///
63         int latex(Buffer const &, std::ostream &,
64                   OutputParams const &) const;
65         ///
66         int linuxdoc(Buffer const &, std::ostream &,
67                      OutputParams const &) const;
68         ///
69         int docbook(Buffer const &, std::ostream &,
70                     OutputParams const &) const;
71         ///
72         int plaintext(Buffer const &, std::ostream &,
73                   OutputParams const &) const;
74         ///
75         void validate(LaTeXFeatures &) const;
76
77         ///
78         InsetCharStyleParams const & params() const { return params_; }
79
80 protected:
81         InsetCharStyle(InsetCharStyle const &);
82         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
83         ///
84         bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
85
86 private:
87         friend class InsetCharStyleParams;
88
89         virtual std::auto_ptr<InsetBase> doClone() const;
90
91         /// used by the constructors
92         void init();
93         ///
94         InsetCharStyleParams params_;
95         ///
96         bool has_label_;
97 };
98
99 #endif