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;
153 * Whether this layout was declared with "Environment xxx" as opposed
154 * to "Style xxx". This is part of some unfinished generic environment
155 * handling (see also InsetEnvironment) started by Andre. No layout
156 * that is shipped with LyX has this flag set.
157 * Don't confuse this with isEnvironment()!
162 /// special value of toclevel for non-section layouts
163 static const int NOT_IN_TOC;
164 /// for new environment insets
165 std::string latexheader;
166 /// for new environment insets
167 std::string latexfooter;
168 /// for new environment insets
169 std::string latexparagraph;
171 /** true when the fragile commands in the paragraph need to be
174 /// true when empty paragraphs should be kept.
177 bool isParagraph() const {
178 return latextype == LATEX_PARAGRAPH;
181 bool isCommand() const {
182 return latextype == LATEX_COMMAND;
185 bool isEnvironment() const {
186 return (latextype == LATEX_ENVIRONMENT
187 || latextype == LATEX_BIB_ENVIRONMENT
188 || latextype == LATEX_ITEM_ENVIRONMENT
189 || latextype == LATEX_LIST_ENVIRONMENT);
191 /// Type of LaTeX object
192 LYX_LATEX_TYPES latextype;
193 /// Does this object belong in the title part of the document?
195 /// Does this layout allow for an optional parameter?
197 /// Which counter to step
198 lyx::docstring counter;
199 /// Depth of XML command
203 /// Name of the layout/paragraph environment
206 /** Name of an layout that has replaced this layout.
207 This is used to rename a layout, while keeping backward
210 std::string obsoleted_by_;
212 /** Name of an layout which preamble must come before this one
213 This is used when the preamble snippet uses macros defined in
216 std::string depends_on_;
218 /// LaTeX name for environment
219 std::string latexname_;
220 /// Label string. "Abstract", "Reference", "Caption"...
221 lyx::docstring labelstring_;
223 lyx::docstring endlabelstring_;
224 /// Label string inside appendix. "Appendix", ...
225 lyx::docstring labelstring_appendix_;
226 /// LaTeX parameter for environment
227 std::string latexparam_;
228 /// Internal tag to use (e.g., <title></title> for sect header)
229 std::string innertag_;
230 /// Internal tag to use e.g. to surround varlistentry label)
231 std::string labeltag_;
232 /// Internal tag to surround the item text in a list)
233 std::string itemtag_;
234 /// Macro definitions needed for this layout