]> git.lyx.org Git - lyx.git/blob - src/insets/insetcharstyle.h
The Character Style and XML short element inset.
[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
17 #include "insetcollapsable.h"
18 #include "lyxtextclass.h"
19
20
21  struct InsetCharStyleParams {
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         LyXFont font;
34         ///
35         LyXFont labelfont;
36 };
37
38
39 /** The CharStyle inset, also XML short element
40
41 */
42 class InsetCharStyle : public InsetCollapsable {
43 public:
44         ///
45
46
47         InsetCharStyle(BufferParams const &, CharStyles::iterator);
48         /// Copy constructor
49         InsetCharStyle(InsetCharStyle const &);
50         ///
51         virtual std::auto_ptr<InsetBase> clone() const;
52         ///
53         std::string const editMessage() const;
54         ///
55         InsetOld::Code lyxCode() const { return InsetOld::CHARSTYLE_CODE; }
56         ///
57         void write(Buffer const &, std::ostream &) const;
58         ///
59         void read(Buffer const & buf, LyXLex & lex);
60         ///
61         void setButtonLabel();
62         ///
63         void metrics(MetricsInfo &, Dimension &) const;
64         ///
65         void getDrawFont(LyXFont &) const;
66         ///
67         int latex(Buffer const &, std::ostream &,
68                   OutputParams const &) const;
69         ///
70         int linuxdoc(Buffer const &, std::ostream &,
71                      OutputParams const &) const;
72         ///
73         int docbook(Buffer const &, std::ostream &,
74                     OutputParams const &) const;
75         ///
76         int plaintext(Buffer const &, std::ostream &,
77                   OutputParams const &) const;
78         ///
79         void validate(LaTeXFeatures &) const;
80
81         ///
82         InsetCharStyleParams const & params() const { return params_; }
83
84 protected:
85         ///
86         virtual
87         DispatchResult
88         priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
89
90 private:
91         friend class InsetCharStyleParams;
92
93         /// used by the constructors
94         void init();
95         ///
96         InsetCharStyleParams params_;
97 };
98
99 #endif