4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Martin Vermeer
10 * Full author contact details are available in file CREDITS.
13 #ifndef INSET_LAYOUT_H
14 #define INSET_LAYOUT_H
16 #include "ColorCode.h"
19 #include "support/docstring.h"
35 enum InsetDecoration {
58 bool read(Lexer & lexrc, TextClass const & tclass);
60 docstring name() const { return name_; }
62 void setName(docstring const & n) { name_ = n; }
64 InsetLyXType lyxtype() const { return lyxtype_; }
66 docstring labelstring() const { return labelstring_; }
68 InsetDecoration decoration() const { return decoration_; }
70 InsetLaTeXType latextype() const { return latextype_; }
72 std::string latexname() const { return latexname_; }
74 std::string latexparam() const { return latexparam_; }
76 FontInfo font() const { return font_; }
78 FontInfo labelfont() const { return labelfont_; }
80 ColorCode bgcolor() const { return bgcolor_; }
82 docstring preamble() const { return preamble_; }
84 docstring counter() const { return counter_; }
86 std::string const & htmlinnertag() const { return htmlinnertag_; }
88 std::string const & htmlinnerattr() const { return htmlinnerattr_; }
90 std::string const & htmltag() const { return htmltag_; }
92 std::string const & htmlattr() const { return htmlattr_; }
94 std::string const & htmllabel() const { return htmllabel_; }
96 docstring htmlstyle() const;
98 docstring htmlpreamble() const { return htmlpreamble_; }
100 bool htmlisblock() const { return htmlisblock_; }
102 std::set<std::string> requires() const { return requires_; };
104 bool isMultiPar() const { return multipar_; };
106 bool forcePlainLayout() const { return forceplain_; }
108 bool allowParagraphCustomization() const { return custompars_; }
110 bool isPassThru() const { return passthru_; };
112 bool isNeedProtect() const { return needprotect_; };
114 bool isFreeSpacing() const { return freespacing_; };
116 bool isKeepEmpty() const { return keepempty_; };
118 bool forceLTR() const { return forceltr_; };
120 bool isInToc() const { return intoc_; };
124 void makeDefaultCSS() const;
126 std::string defaultCSSClass() const;
128 std::string defaultCSSLabelClass() const { return defaultCSSClass() + "_label"; }
132 * This is only used (at present) to decide where to put them on the menus.
133 * Values are 'charstyle', 'custom' (things that by default look like a
134 * footnote), 'element' (docbook), 'standard'.
136 InsetLyXType lyxtype_;
138 docstring labelstring_;
140 InsetDecoration decoration_;
142 InsetLaTeXType latextype_;
144 std::string latexname_;
146 std::string latexparam_;
157 /// The tag enclosing all the material in this inset. Default is none.
158 std::string htmltag_;
159 /// Additional attributes for inclusion with the start tag. Default (if
160 /// a tag is provided) is: class="name".
161 std::string htmlattr_;
162 /// Tag for individual paragraphs in the inset. Default is none.
163 std::string htmlinnertag_;
164 /// Attributes for that tag. Default (if a tag is provided) is:
165 /// class="name_inner".
166 std::string htmlinnerattr_;
167 /// A label for this environment, possibly including a reference
168 /// to a counter. E.g., for footnote, it might be:
169 /// <span class='notenum'>\arabic{footnote}</span>
171 /// FIXME Could we get this from the layout?
172 std::string htmllabel_;
173 /// CSS associated with this inset.
174 docstring htmlstyle_;
175 /// Cache for default CSS info for this inset.
176 mutable docstring htmldefaultstyle_;
178 mutable std::string defaultcssclass_;
179 /// Whether to force generation of default CSS even if some is given.
180 /// False by default.
182 /// Additional material for the header.
183 docstring htmlpreamble_;
184 /// Whether this inset represents a "block" of material, i.e., a set
185 /// of paragraphs of its own (true), or should be run into the previous
186 /// paragraph (false). Examples:
187 /// For branches, this is false.
188 /// For footnotes, this is true.
189 /// Defaults to true.
192 std::set<std::string> requires_;
209 /// should the contents be written to TOC strings?
214 InsetLayout::InsetLyXType translateLyXType(std::string const & str);