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"
33 bool read(LyXLex &, LyXTextClass const &);
35 void readAlign(LyXLex &);
37 void readAlignPossible(LyXLex &);
39 void readLabelType(LyXLex &);
41 void readEndLabelType(LyXLex &);
43 void readMargin(LyXLex &);
45 void readLatexType(LyXLex &);
47 void readSpacing(LyXLex &);
49 std::string const & name() const;
51 void setName(std::string const & n);
53 std::string const & obsoleted_by() const;
55 std::string const & depends_on() const;
57 std::string const & latexname() const { return latexname_; }
59 lyx::docstring const & labelstring() const { return labelstring_; }
61 lyx::docstring const & endlabelstring() const { return endlabelstring_; }
63 std::string const & preamble() const { return preamble_; }
65 std::string const & latexparam() const { return latexparam_; }
67 std::string const & innertag() const { return innertag_; }
69 std::string const & labeltag() const { return labeltag_; }
71 std::string const & itemtag() const { return itemtag_; }
73 lyx::docstring const & labelstring_appendix() const {
74 return labelstring_appendix_;
76 /** Default font for this layout/environment.
77 The main font for this kind of environment. If an attribute has
78 LyXFont::INHERITED_*, it means that the value is specified by
79 the defaultfont for the entire layout. If we are nested, the
80 font is inherited from the font in the environment one level
81 up until the font is resolved. The values LyXFont::IGNORE_*
82 and LyXFont::TOGGLE are illegal here.
86 /** Default font for labels.
87 Interpretation the same as for font above
91 /** Resolved version of the font for this layout/environment.
92 This is a resolved version the default font. The font is resolved
93 against the defaultfont of the entire layout.
97 /** Resolved version of the font used for labels.
98 This is a resolved version the label font. The font is resolved
99 against the defaultfont of the entire layout.
101 LyXFont reslabelfont;
103 /// Text that dictates how wide the left margin is on the screen
104 std::string leftmargin;
105 /// Text that dictates how wide the right margin is on the screen
106 std::string rightmargin;
107 /// Text that dictates how much space to leave after a potential label
108 std::string labelsep;
109 /// Text that dictates how much space to leave before a potential label
110 std::string labelindent;
111 /// Text that dictates the width of the indentation of indented pars
112 std::string parindent;
122 double labelbottomsep;
130 LyXAlignment alignpossible;
132 LYX_LABEL_TYPES labeltype;
134 LYX_END_LABEL_TYPES endlabeltype;
136 LYX_MARGIN_TYPE margintype;
142 bool newline_allowed;
153 /// special value of toclevel for non-section layouts
154 static const int NOT_IN_TOC;
155 /// for new environment insets
156 std::string latexheader;
157 /// for new environment insets
158 std::string latexfooter;
159 /// for new environment insets
160 std::string latexparagraph;
162 /** true when the fragile commands in the paragraph need to be
165 /// true when empty paragraphs should be kept.
168 bool isParagraph() const {
169 return latextype == LATEX_PARAGRAPH;
172 bool isCommand() const {
173 return latextype == LATEX_COMMAND;
176 bool isEnvironment() const {
177 return (latextype == LATEX_ENVIRONMENT
178 || latextype == LATEX_BIB_ENVIRONMENT
179 || latextype == LATEX_ITEM_ENVIRONMENT
180 || latextype == LATEX_LIST_ENVIRONMENT);
182 /// Type of LaTeX object
183 LYX_LATEX_TYPES latextype;
184 /// Does this object belong in the title part of the document?
186 /// Does this layout allow for an optional parameter?
188 /// Which counter to step
189 lyx::docstring counter;
190 /// Depth of XML command
194 /// Name of the layout/paragraph environment
197 /** Name of an layout that has replaced this layout.
198 This is used to rename a layout, while keeping backward
201 std::string obsoleted_by_;
203 /** Name of an layout which preamble must come before this one
204 This is used when the preamble snippet uses macros defined in
207 std::string depends_on_;
209 /// LaTeX name for environment
210 std::string latexname_;
211 /// Label string. "Abstract", "Reference", "Caption"...
212 lyx::docstring labelstring_;
214 lyx::docstring endlabelstring_;
215 /// Label string inside appendix. "Appendix", ...
216 lyx::docstring labelstring_appendix_;
217 /// LaTeX parameter for environment
218 std::string latexparam_;
219 /// Internal tag to use (e.g., <title></title> for sect header)
220 std::string innertag_;
221 /// Internal tag to use e.g. to surround varlistentry label)
222 std::string labeltag_;
223 /// Internal tag to surround the item text in a list)
224 std::string itemtag_;
225 /// Macro definitions needed for this layout
226 std::string preamble_;