X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLayout.h;h=0a398d31c29b2ac0e9fda2bd413cc35910e2b091;hb=a174f43bc5515291c4d0b28cacd806c9c9ea4de4;hp=aeca0f4f83ae7c9b6a84b672704d0aefb61a0fe2;hpb=e47d30e9070e5656dce0d00a6a0be6a823888a49;p=lyx.git diff --git a/src/Layout.h b/src/Layout.h index aeca0f4f83..0a398d31c2 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -28,12 +28,12 @@ class Language; class Lexer; class TextClass; -/* Fix labels are printed flushright, manual labels flushleft. +/* Fixed labels are printed flushright, manual labels flushleft. * MARGIN_MANUAL and MARGIN_FIRST_DYNAMIC are *only* for LABEL_MANUAL, * MARGIN_DYNAMIC and MARGIN_STATIC are *not* for LABEL_MANUAL. * This seems a funny restriction, but I think other combinations are * not needed, so I will not change it yet. - * Correction: MARGIN_FIRST_DYNAMIC also usable with LABEL_STATIC + * Correction: MARGIN_FIRST_DYNAMIC also usable with LABEL_STATIC. */ @@ -73,7 +73,7 @@ public: /// void readSpacing(Lexer &); /// - docstring const & name() const { return name_; }; + docstring const & name() const { return name_; } /// void setName(docstring const & n) { name_ = n; } /// @@ -85,7 +85,8 @@ public: /// void setLatexName(std::string const & n) { latexname_ = n; } /// - docstring const & labelstring() const { return labelstring_; } + docstring const & labelstring(bool in_appendix) const + { return in_appendix ? labelstring_appendix_ : labelstring_; } /// docstring const & endlabelstring() const { return endlabelstring_; } /// @@ -109,27 +110,27 @@ public: /// std::string const & itemtag() const { return itemtag_; } /// - std::string const & htmltag() const { return htmltag_; } + std::string const & htmltag() const; /// - std::string const & htmlattr() const { return htmlattr_; } + std::string const & htmlattr() const; /// - std::string const & htmlitem() const { return htmlitem_; } + std::string const & htmlitemtag() const; /// - std::string const & htmlitemattr() const { return htmlitemattr_; } + std::string const & htmlitemattr() const; /// - std::string const & htmllabel() const { return htmllabel_; } + std::string const & htmllabeltag() const; /// - std::string const & htmllabelattr() const { return htmllabelattr_; } + std::string const & htmllabelattr() const; + /// + std::string defaultCSSClass() const; /// bool htmllabelfirst() const { return htmllabelfirst_; } /// - docstring const & htmlstyle() const { return htmlstyle_; } + docstring htmlstyle() const; /// docstring const & htmlpreamble() const { return htmlpreamble_; } /// - docstring const & labelstring_appendix() const { - return labelstring_appendix_; - } + bool htmltitle() const { return htmltitle_; } /// bool isParagraph() const { return latextype == LATEX_PARAGRAPH; } /// @@ -238,10 +239,21 @@ public: LatexType latextype; /// Does this object belong in the title part of the document? bool intitle; - /// Does this layout allow for an optional parameter? - int optionalargs; + /// Is the content to go in the preamble rather than the body? + bool inpreamble; + /// Number of requried arguments for this command or environment + unsigned int reqargs; + /// Number of optional arguments for this command or environment + /// These MUST come at the beginning, so: + /// \cmd[opt1][opt2]{req1}{here is the text from LyX} + /// is fine. But: + /// \cmd[opt1]{req1}[opt2]{here is the text from LyX} + /// is not. + unsigned int optargs; /// Which counter to step docstring counter; + /// Prefix to use when creating labels + docstring refprefix; /// Depth of XML command int commanddepth; @@ -250,8 +262,18 @@ public: /// until it has proper support for the caption inset (JMarc) static Layout * forCaption(); + /// Is this spellchecked? + bool spellcheck; + private: + /// generates the default CSS for this layout + void makeDefaultCSS() const; + /// + std::string defaultCSSItemClass() const { return defaultCSSClass() + "_item"; } + /// + std::string defaultCSSLabelClass() const { return defaultCSSClass() + "_label"; } + /// Name of the layout/paragraph environment docstring name_; @@ -285,29 +307,42 @@ private: std::string latexparam_; /// Internal tag to use (e.g.,