]> git.lyx.org Git - lyx.git/blob - src/insets/insetcharstyle.h
Add latexparam to CharStyle 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         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
48
49         InsetCharStyle(BufferParams const &, CharStyles::iterator);
50         /// Copy constructor
51         InsetCharStyle(InsetCharStyle const &);
52         ///
53         virtual std::auto_ptr<InsetBase> clone() const;
54         ///
55         std::string const editMessage() const;
56         ///
57         InsetOld::Code lyxCode() const { return InsetOld::CHARSTYLE_CODE; }
58         ///
59         void write(Buffer const &, std::ostream &) const;
60         ///
61         void read(Buffer const & buf, LyXLex & lex);
62         ///
63         void setButtonLabel();
64         ///
65         void metrics(MetricsInfo &, Dimension &) const;
66         ///
67         void getDrawFont(LyXFont &) const;
68         ///
69         int latex(Buffer const &, std::ostream &,
70                   OutputParams const &) const;
71         ///
72         int linuxdoc(Buffer const &, std::ostream &,
73                      OutputParams const &) const;
74         ///
75         int docbook(Buffer const &, std::ostream &,
76                     OutputParams const &) const;
77         ///
78         int plaintext(Buffer const &, std::ostream &,
79                   OutputParams const &) const;
80         ///
81         void validate(LaTeXFeatures &) const;
82
83         ///
84         InsetCharStyleParams const & params() const { return params_; }
85
86 protected:
87         ///
88         virtual
89         DispatchResult
90         priv_dispatch(FuncRequest const &, idx_type &, pos_type &);
91
92 private:
93         friend class InsetCharStyleParams;
94
95         /// used by the constructors
96         void init();
97         ///
98         InsetCharStyleParams params_;
99 };
100
101 #endif