]> git.lyx.org Git - lyx.git/blob - src/insets/InsetLayout.h
673b4d26be13d482e808b43d128e52790f4e04c5
[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         std::string const & htmltag() const { return htmltag_; }
83         /// 
84         std::string const & htmlattr() const { return htmlattr_; }
85         /// 
86         docstring htmlstyle() const { return htmlstyle_; }
87         /// 
88         docstring htmlpreamble() const { return htmlpreamble_; }
89         ///
90         std::set<std::string> requires() const { return requires_; };
91         ///
92         bool isMultiPar() const { return multipar_; };
93         ///
94         bool forcePlainLayout() const { return forceplain_; }
95         ///
96         bool allowParagraphCustomization() const { return custompars_; }
97         ///
98         bool isPassThru() const { return passthru_; };
99         ///
100         bool isNeedProtect() const { return needprotect_; };
101         ///
102         bool isFreeSpacing() const { return freespacing_; };
103         ///
104         bool isKeepEmpty() const { return keepempty_; };
105         ///
106         bool isForceLtr() const { return forceltr_; };
107         ///
108         bool isInToc() const { return intoc_; };
109 private:
110         ///
111         docstring name_;
112         /**
113                 * This is only used (at present) to decide where to put them on the menus.
114                 * Values are 'charstyle', 'custom' (things that by default look like a
115                 * footnote), 'element' (docbook), 'standard'.
116                 */
117         InsetLyXType lyxtype_;
118         ///
119         docstring labelstring_;
120         ///
121         InsetDecoration decoration_;
122         ///
123         InsetLaTeXType latextype_;
124         ///
125         std::string latexname_;
126         ///
127         std::string latexparam_;
128         ///
129         FontInfo font_;
130         ///
131         FontInfo labelfont_;
132         ///
133         ColorCode bgcolor_;
134         ///
135         docstring preamble_;
136         /// 
137         std::string htmltag_;
138         /// 
139         std::string htmlattr_;
140         /// 
141         docstring htmlstyle_;
142         /// 
143         docstring htmlpreamble_;
144         ///
145         std::set<std::string> requires_;
146         ///
147         bool multipar_;
148         /// 
149         bool custompars_;
150         ///
151         bool forceplain_;
152         ///
153         bool passthru_;
154         ///
155         bool needprotect_;
156         ///
157         bool freespacing_;
158         ///
159         bool keepempty_;
160         ///
161         bool forceltr_;
162         /// should the contents be written to TOC strings?
163         bool intoc_;
164 };
165
166 ///
167 InsetLayout::InsetLyXType translateLyXType(std::string const & str);
168
169 } // namespace lyx
170
171 #endif