]> git.lyx.org Git - lyx.git/blob - src/insets/insetcharstyle.h
InsetOld -> InsetBase renaming
[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 struct InsetCharStyleParams {
21         ///
22         void write(std::ostream & os) const;
23         ///
24         void read(LyXLex & lex);
25         ///
26         std::string type;
27         ///
28         std::string latextype;
29         ///
30         std::string latexname;
31         ///
32         std::string latexparam;
33         ///
34         LyXFont font;
35         ///
36         LyXFont labelfont;
37 };
38
39
40 /** The CharStyle inset, also XML short element
41
42 */
43 class InsetCharStyle : public InsetCollapsable {
44 public:
45         ///
46         InsetCharStyle(BufferParams const &, CharStyles::iterator);
47         ///
48         std::string const editMessage() const;
49         ///
50         InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
51         ///
52         void write(Buffer const &, std::ostream &) const;
53         ///
54         void read(Buffer const & buf, LyXLex & lex);
55         ///
56         void metrics(MetricsInfo &, Dimension &) const;
57         ///
58         void draw(PainterInfo &, int, int) const;
59         ///
60         void getDrawFont(LyXFont &) const;
61         ///
62         int latex(Buffer const &, std::ostream &,
63                   OutputParams const &) const;
64         ///
65         int linuxdoc(Buffer const &, std::ostream &,
66                      OutputParams const &) const;
67         ///
68         int docbook(Buffer const &, std::ostream &,
69                     OutputParams const &) const;
70         ///
71         int plaintext(Buffer const &, std::ostream &,
72                   OutputParams const &) const;
73         ///
74         void validate(LaTeXFeatures &) const;
75
76         ///
77         InsetCharStyleParams const & params() const { return params_; }
78
79 protected:
80         InsetCharStyle(InsetCharStyle const &);
81         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
82         ///
83         bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
84
85 private:
86         friend class InsetCharStyleParams;
87
88         virtual std::auto_ptr<InsetBase> doClone() const;
89
90         /// used by the constructors
91         void init();
92         ///
93         InsetCharStyleParams params_;
94         ///
95         bool has_label_;
96 };
97
98 #endif