4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
11 * Full author contact details are available in file CREDITS.
20 #include "support/docstring.h"
36 bool read(LyXLex &, LyXTextClass const &);
38 void readAlign(LyXLex &);
40 void readAlignPossible(LyXLex &);
42 void readLabelType(LyXLex &);
44 void readEndLabelType(LyXLex &);
46 void readMargin(LyXLex &);
48 void readLatexType(LyXLex &);
50 void readSpacing(LyXLex &);
52 std::string const & name() const;
54 void setName(std::string const & n);
56 std::string const & obsoleted_by() const;
58 std::string const & depends_on() const;
60 std::string const & latexname() const { return latexname_; }
62 lyx::docstring const & labelstring() const { return labelstring_; }
64 lyx::docstring const & endlabelstring() const { return endlabelstring_; }
66 docstring const & preamble() const { return preamble_; }
68 std::string const & latexparam() const { return latexparam_; }
70 std::string const & innertag() const { return innertag_; }
72 std::string const & labeltag() const { return labeltag_; }
74 std::string const & itemtag() const { return itemtag_; }
76 lyx::docstring const & labelstring_appendix() const {
77 return labelstring_appendix_;
79 /** Default font for this layout/environment.
80 The main font for this kind of environment. If an attribute has
81 LyXFont::INHERITED_*, it means that the value is specified by
82 the defaultfont for the entire layout. If we are nested, the
83 font is inherited from the font in the environment one level
84 up until the font is resolved. The values LyXFont::IGNORE_*
85 and LyXFont::TOGGLE are illegal here.
89 /** Default font for labels.
90 Interpretation the same as for font above
94 /** Resolved version of the font for this layout/environment.
95 This is a resolved version the default font. The font is resolved
96 against the defaultfont of the entire layout.
100 /** Resolved version of the font used for labels.
101 This is a resolved version the label font. The font is resolved
102 against the defaultfont of the entire layout.
104 LyXFont reslabelfont;
106 /// Text that dictates how wide the left margin is on the screen
107 std::string leftmargin;
108 /// Text that dictates how wide the right margin is on the screen
109 std::string rightmargin;
110 /// Text that dictates how much space to leave after a potential label
111 std::string labelsep;
112 /// Text that dictates how much space to leave before a potential label
113 std::string labelindent;
114 /// Text that dictates the width of the indentation of indented pars
115 std::string parindent;
125 double labelbottomsep;
133 LyXAlignment alignpossible;
135 LYX_LABEL_TYPES labeltype;
137 LYX_END_LABEL_TYPES endlabeltype;
139 LYX_MARGIN_TYPE margintype;
145 bool newline_allowed;
156 /// special value of toclevel for non-section layouts
157 static const int NOT_IN_TOC;
158 /// for new environment insets
159 std::string latexheader;
160 /// for new environment insets
161 std::string latexfooter;
162 /// for new environment insets
163 std::string latexparagraph;
165 /** true when the fragile commands in the paragraph need to be
168 /// true when empty paragraphs should be kept.
171 bool isParagraph() const {
172 return latextype == LATEX_PARAGRAPH;
175 bool isCommand() const {
176 return latextype == LATEX_COMMAND;
179 bool isEnvironment() const {
180 return (latextype == LATEX_ENVIRONMENT
181 || latextype == LATEX_BIB_ENVIRONMENT
182 || latextype == LATEX_ITEM_ENVIRONMENT
183 || latextype == LATEX_LIST_ENVIRONMENT);
185 /// Type of LaTeX object
186 LYX_LATEX_TYPES latextype;
187 /// Does this object belong in the title part of the document?
189 /// Does this layout allow for an optional parameter?
191 /// Which counter to step
192 lyx::docstring counter;
193 /// Depth of XML command
197 /// Name of the layout/paragraph environment
200 /** Name of an layout that has replaced this layout.
201 This is used to rename a layout, while keeping backward
204 std::string obsoleted_by_;
206 /** Name of an layout which preamble must come before this one
207 This is used when the preamble snippet uses macros defined in
210 std::string depends_on_;
212 /// LaTeX name for environment
213 std::string latexname_;
214 /// Label string. "Abstract", "Reference", "Caption"...
215 lyx::docstring labelstring_;
217 lyx::docstring endlabelstring_;
218 /// Label string inside appendix. "Appendix", ...
219 lyx::docstring labelstring_appendix_;
220 /// LaTeX parameter for environment
221 std::string latexparam_;
222 /// Internal tag to use (e.g., <title></title> for sect header)
223 std::string innertag_;
224 /// Internal tag to use e.g. to surround varlistentry label)
225 std::string labeltag_;
226 /// Internal tag to surround the item text in a list)
227 std::string itemtag_;
228 /// Macro definitions needed for this layout