]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.h
Small formatting and comment cleanup.
[lyx.git] / src / lyxlayout.h
index e709ffb23dcd0ce4a104ca51cd6cc4c23d94b90e..7cdff88aa062b1c0bd633e84b231b12e237de102 100644 (file)
 #include "lyxfont.h"
 #include "layout.h"
 #include "Spacing.h"
-#include "support/std_string.h"
+#include "support/docstring.h"
+
+#include <string>
+
+
+namespace lyx {
 
 class LyXLex;
 class LyXTextClass;
@@ -28,7 +33,7 @@ public:
        ///
        LyXLayout();
        ///
-       bool Read(LyXLex &, LyXTextClass const &);
+       bool read(LyXLex &, LyXTextClass const &);
        ///
        void readAlign(LyXLex &);
        ///
@@ -44,25 +49,31 @@ public:
        ///
        void readSpacing(LyXLex &);
        ///
-       string const & name() const;
+       std::string const & name() const;
+       ///
+       void setName(std::string const & n);
+       ///
+       std::string const & obsoleted_by() const;
        ///
-       void setName(string const & n);
+       std::string const & depends_on() const;
        ///
-       string const & obsoleted_by() const;
+       std::string const & latexname() const { return latexname_; }
        ///
-       string const & depends_on() const;
+       lyx::docstring const & labelstring() const { return labelstring_; }
        ///
-       string const & latexname() const { return latexname_; }
+       lyx::docstring const & endlabelstring() const { return endlabelstring_; }
        ///
-       string const & labelstring() const { return labelstring_; }
+       docstring const & preamble() const { return preamble_; }
        ///
-       string const & endlabelstring() const { return endlabelstring_; }
+       std::string const & latexparam() const { return latexparam_; }
        ///
-       string const & preamble() const { return preamble_; }
+       std::string const & innertag() const { return innertag_; }
        ///
-       string const & latexparam() const { return latexparam_; }
+       std::string const & labeltag() const { return labeltag_; }
        ///
-       string const & labelstring_appendix() const {
+       std::string const & itemtag() const { return itemtag_; }
+       ///
+       lyx::docstring const & labelstring_appendix() const {
                return labelstring_appendix_;
        }
        /** Default font for this layout/environment.
@@ -93,27 +104,27 @@ public:
        LyXFont reslabelfont;
 
        /// Text that dictates how wide the left margin is on the screen
-       string leftmargin;
+       std::string leftmargin;
        /// Text that dictates how wide the right margin is on the screen
-       string rightmargin;
+       std::string rightmargin;
        /// Text that dictates how much space to leave after a potential label
-       string labelsep;
+       std::string labelsep;
        /// Text that dictates how much space to leave before a potential label
-       string labelindent;
+       std::string labelindent;
        /// Text that dictates the width of the indentation of indented pars
-       string parindent;
+       std::string parindent;
        ///
-       float parskip;
+       double parskip;
        ///
-       float itemsep;
+       double itemsep;
        ///
-       float topsep;
+       double topsep;
        ///
-       float bottomsep;
+       double bottomsep;
        ///
-       float labelbottomsep;
+       double labelbottomsep;
        ///
-       float parsep;
+       double parsep;
        ///
        Spacing spacing;
        ///
@@ -138,14 +149,24 @@ public:
        bool free_spacing;
        ///
        bool pass_thru;
-       ///
+       /**
+        * Whether this layout was declared with "Environment xxx" as opposed
+        * to "Style xxx". This is part of some unfinished generic environment
+        * handling (see also InsetEnvironment) started by Andre. No layout
+        * that is shipped with LyX has this flag set.
+        * Don't confuse this with isEnvironment()!
+        */
        bool is_environment;
+       /// show this in toc
+       int toclevel;
+       /// special value of toclevel for non-section layouts
+       static const int NOT_IN_TOC;
        /// for new environment insets
-       string latexheader;
+       std::string latexheader;
        /// for new environment insets
-       string latexfooter;
+       std::string latexfooter;
        /// for new environment insets
-       string latexparagraph;
+       std::string latexparagraph;
 
        /** true when the fragile commands in the paragraph need to be
            \protect'ed. */
@@ -173,35 +194,48 @@ public:
        bool intitle;
        /// Does this layout allow for an optional parameter?
        int optionalargs;
+       /// Which counter to step
+       lyx::docstring counter;
+       /// Depth of XML command
+       int commanddepth;
 
 private:
        /// Name of the layout/paragraph environment
-       string name_;
+       std::string name_;
 
        /** Name of an layout that has replaced this layout.
            This is used to rename a layout, while keeping backward
            compatibility
        */
-       string obsoleted_by_;
+       std::string obsoleted_by_;
 
        /** Name of an layout which preamble must come before this one
            This is used when the preamble snippet uses macros defined in
            another preamble
         */
-       string depends_on_;
+       std::string depends_on_;
 
        /// LaTeX name for environment
-       string latexname_;
+       std::string latexname_;
        /// Label string. "Abstract", "Reference", "Caption"...
-       string labelstring_;
+       lyx::docstring labelstring_;
        ///
-       string endlabelstring_;
+       lyx::docstring endlabelstring_;
        /// Label string inside appendix. "Appendix", ...
-       string labelstring_appendix_;
+       lyx::docstring labelstring_appendix_;
        /// LaTeX parameter for environment
-       string latexparam_;
+       std::string latexparam_;
+       /// Internal tag to use (e.g., <title></title> for sect header)
+       std::string innertag_;
+       /// Internal tag to use e.g. to surround varlistentry label)
+       std::string labeltag_;
+       /// Internal tag to surround the item text in a list)
+       std::string itemtag_;
        /// Macro definitions needed for this layout
-       string preamble_;
+       docstring preamble_;
 };
 
+
+} // namespace lyx
+
 #endif