X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLayout.h;h=a80999701814bf3e75e8e31c475619bbc8c55775;hb=c393abbe12c360eec07a3dcbb5929e6b7c0ad329;hp=e41c3069e5fc3ce7128efa233ef798bac8a2a92c;hpb=70899f0c154bed67e376080169f52e853bb9e9bd;p=lyx.git diff --git a/src/Layout.h b/src/Layout.h index e41c3069e5..a809997018 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,25 +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; } /// @@ -222,6 +225,8 @@ public: bool free_spacing; /// bool pass_thru; + /// + bool parbreak_is_newline; /// show this in toc int toclevel; /// special value of toclevel for non-section layouts @@ -236,10 +241,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; @@ -248,8 +264,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_; @@ -283,33 +309,64 @@ private: std::string latexparam_; /// Internal tag to use (e.g.,