]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLayout.h
This optional argument to the InsetCollapsable constructor
[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 & tclass);
57         ///
58         docstring name() const { return name_; };
59         ///
60         InsetLyXType lyxtype() const { return lyxtype_; };
61         ///
62         docstring labelstring() const { return labelstring_; };
63         ///
64         InsetDecoration decoration() const { return decoration_; };
65         ///
66         InsetLaTeXType latextype() const { return latextype_; };
67         ///
68         std::string latexname() const { return latexname_; };
69         ///
70         std::string latexparam() const { return latexparam_; };
71         ///
72         FontInfo font() const { return font_; };
73         ///
74         FontInfo labelfont() const { return labelfont_; };
75         ///
76         ColorCode bgcolor() const { return bgcolor_; };
77         ///
78         std::string preamble() const { return preamble_; };
79         ///
80         std::set<std::string> requires() const { return requires_; };
81         ///
82         bool isMultiPar() const { return multipar_; };
83         ///
84         bool forcePlainLayout() const { return forceplain_; }
85         ///
86         bool allowParagraphCustomization() const { return custompars_; }
87         ///
88         bool isPassThru() const { return passthru_; };
89         ///
90         bool isNeedProtect() const { return needprotect_; };
91         ///
92         bool isFreeSpacing() const { return freespacing_; };
93         ///
94         bool isKeepEmpty() const { return keepempty_; };
95         ///
96         bool isForceLtr() const { return forceltr_; };
97 private:
98         ///
99         docstring name_;
100         /**
101                 * This is only used (at present) to decide where to put them on the menus.
102                 * Values are 'charstyle', 'custom' (things that by default look like a
103                 * footnote), 'element' (docbook), 'standard'.
104                 */
105         InsetLyXType lyxtype_;
106         ///
107         docstring labelstring_;
108         ///
109         InsetDecoration decoration_;
110         ///
111         InsetLaTeXType latextype_;
112         ///
113         std::string latexname_;
114         ///
115         std::string latexparam_;
116         ///
117         FontInfo font_;
118         ///
119         FontInfo labelfont_;
120         ///
121         ColorCode bgcolor_;
122         ///
123         std::string preamble_;
124         ///
125         std::set<std::string> requires_;
126         ///
127         bool multipar_;
128         /// 
129         bool custompars_;
130         ///
131         bool forceplain_;
132         ///
133         bool passthru_;
134         ///
135         bool needprotect_;
136         ///
137         bool freespacing_;
138         ///
139         bool keepempty_;
140         ///
141         bool forceltr_;
142 };
143
144 ///
145 InsetLayout::InsetLyXType translateLyXType(std::string const & str);
146
147 } // namespace lyx
148
149 #endif