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