]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLayout.h
Remove all BufferParam arguments in InsetXXX methods (since insets know about their...
[lyx.git] / src / insets / InsetLayout.h
1 // -*- C++ -*-
2 /**
3  * \file InsetLayout.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Martin Vermeer
8  * \author Richard Heck
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSET_LAYOUT_H
14 #define INSET_LAYOUT_H
15
16 #include "ColorCode.h"
17 #include "FontInfo.h"
18
19 #include "support/docstring.h"
20
21 #include <set>
22 #include <string>
23
24 namespace lyx {
25
26 class Lexer;
27 class TextClass;
28
29 ///
30 class InsetLayout {
31 public:
32         ///
33         InsetLayout();
34         ///
35         enum InsetDecoration {
36                 CLASSIC,
37                 MINIMALISTIC,
38                 CONGLOMERATE,
39                 DEFAULT
40         };
41         enum InsetLyXType {
42                 NOLYXTYPE,
43                 CHARSTYLE,
44                 CUSTOM,
45                 ELEMENT,
46                 END,
47                 STANDARD
48         };
49         enum InsetLaTeXType {
50                 NOLATEXTYPE,
51                 COMMAND,
52                 ENVIRONMENT,
53                 ILT_ERROR
54         };
55         ///
56         bool read(Lexer & lexrc, TextClass const & tclass);
57         ///
58         docstring name() const { return name_; }
59         ///
60         void setName(docstring const & n) { name_ = n; }
61         ///
62         InsetLyXType lyxtype() const { return lyxtype_; }
63         ///
64         docstring labelstring() const { return labelstring_; }
65         ///
66         InsetDecoration decoration() const { return decoration_; }
67         ///
68         InsetLaTeXType latextype() const { return latextype_; }
69         ///
70         std::string latexname() const { return latexname_; }
71         ///
72         std::string latexparam() const { return latexparam_; }
73         ///
74         FontInfo font() const { return font_; }
75         ///
76         FontInfo labelfont() const { return labelfont_; }
77         ///
78         ColorCode bgcolor() const { return bgcolor_; }
79         ///
80         docstring preamble() const { return preamble_; }
81         ///
82         docstring counter() const { return counter_; }
83         /// 
84         std::string const & htmlinnertag() const { return htmlinnertag_; }
85         /// 
86         std::string const & htmlinnerattr() const { return htmlinnerattr_; }
87         ///
88         std::string const & htmltag() const { return htmltag_; }
89         /// 
90         std::string const & htmlattr() const { return htmlattr_; }
91         ///
92         std::string const & htmllabel() const { return htmllabel_; }
93         /// 
94         docstring htmlstyle() const { return htmlstyle_; }
95         /// 
96         docstring htmlpreamble() const { return htmlpreamble_; }
97         ///
98         std::set<std::string> requires() const { return requires_; };
99         ///
100         bool isMultiPar() const { return multipar_; };
101         ///
102         bool forcePlainLayout() const { return forceplain_; }
103         ///
104         bool allowParagraphCustomization() const { return custompars_; }
105         ///
106         bool isPassThru() const { return passthru_; };
107         ///
108         bool isNeedProtect() const { return needprotect_; };
109         ///
110         bool isFreeSpacing() const { return freespacing_; };
111         ///
112         bool isKeepEmpty() const { return keepempty_; };
113         ///
114         bool isForceLtr() const { return forceltr_; };
115         ///
116         bool isInToc() const { return intoc_; };
117 private:
118         ///
119         docstring name_;
120         /**
121                 * This is only used (at present) to decide where to put them on the menus.
122                 * Values are 'charstyle', 'custom' (things that by default look like a
123                 * footnote), 'element' (docbook), 'standard'.
124                 */
125         InsetLyXType lyxtype_;
126         ///
127         docstring labelstring_;
128         ///
129         InsetDecoration decoration_;
130         ///
131         InsetLaTeXType latextype_;
132         ///
133         std::string latexname_;
134         ///
135         std::string latexparam_;
136         ///
137         FontInfo font_;
138         ///
139         FontInfo labelfont_;
140         ///
141         ColorCode bgcolor_;
142         ///
143         docstring counter_;
144         ///
145         docstring preamble_;
146         /// 
147         std::string htmltag_;
148         /// 
149         std::string htmlattr_;
150         ///
151         std::string htmlinnertag_;
152         /// 
153         std::string htmlinnerattr_;
154         ///
155         std::string htmllabel_;
156         /// 
157         docstring htmlstyle_;
158         /// 
159         docstring htmlpreamble_;
160         ///
161         std::set<std::string> requires_;
162         ///
163         bool multipar_;
164         /// 
165         bool custompars_;
166         ///
167         bool forceplain_;
168         ///
169         bool passthru_;
170         ///
171         bool needprotect_;
172         ///
173         bool freespacing_;
174         ///
175         bool keepempty_;
176         ///
177         bool forceltr_;
178         /// should the contents be written to TOC strings?
179         bool intoc_;
180 };
181
182 ///
183 InsetLayout::InsetLyXType translateLyXType(std::string const & str);
184
185 } // namespace lyx
186
187 #endif