]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.h
... and sanitize the simplified code...
[lyx.git] / src / lyxlayout.h
index d0f79c7b96b12d76bc7a87032819407648219bba..25452e7a0f37957f8d0a46fa70949af0c60a97e3 100644 (file)
@@ -1,25 +1,24 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *      
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
+/**
+ * \file lyxlayout.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ====================================================== */
+ * \author Lars Gullik Bjønnes
+ * \author Jean-Marc Lasgouttes
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
 
 #ifndef LYX_LAYOUT_H
 #define LYX_LAYOUT_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
 #include "lyxfont.h"
 #include "layout.h"
 #include "Spacing.h"
-#include "LString.h"
+
+#include <string>
 
 class LyXLex;
 class LyXTextClass;
@@ -46,23 +45,31 @@ public:
        ///
        void readSpacing(LyXLex &);
        ///
-       string const & name() const;
+       std::string const & name() const;
+       ///
+       void setName(std::string const & n);
        ///
-       void setName(string const & n);
+       std::string const & obsoleted_by() const;
        ///
-       string const & obsoleted_by() const;
+       std::string const & depends_on() const;
        ///
-       string const & latexname() const { return latexname_; }
+       std::string const & latexname() const { return latexname_; }
        ///
-       string const & labelstring() const { return labelstring_; }
+       std::string const & labelstring() const { return labelstring_; }
        ///
-       string const & endlabelstring() const { return endlabelstring_; }
+       std::string const & endlabelstring() const { return endlabelstring_; }
        ///
-       string const & preamble() const { return preamble_; }
+       std::string const & preamble() const { return preamble_; }
        ///
-       string const & latexparam() const { return latexparam_; }
+       std::string const & latexparam() const { return latexparam_; }
        ///
-       string const & labelstring_appendix() const {
+       std::string const & innertag() const { return innertag_; }
+       ///
+       std::string const & labeltag() const { return labeltag_; }
+       ///
+       std::string const & itemtag() const { return itemtag_; }
+       ///
+       std::string const & labelstring_appendix() const {
                return labelstring_appendix_;
        }
        /** Default font for this layout/environment.
@@ -93,75 +100,61 @@ 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;
-
-       /** Text that dictates the width of the indentation of
-           indented paragraphs.
-       */
-       string parindent;
-
+       std::string labelindent;
+       /// Text that dictates the width of the indentation of indented pars
+       std::string parindent;
        ///
        float parskip;
-
        ///
        float itemsep;
-
        ///
        float topsep;
-
        ///
        float bottomsep;
-
        ///
        float labelbottomsep;
-
        ///
        float parsep;
-
        ///
        Spacing spacing;
-
        ///
        LyXAlignment align;
-
        ///
        LyXAlignment alignpossible;
-
        ///
-       char labeltype; // add approp. type
-
+       LYX_LABEL_TYPES labeltype;
        ///
        LYX_END_LABEL_TYPES endlabeltype;
-
        ///
        LYX_MARGIN_TYPE margintype;
-
        ///
        bool fill_top;
-
        ///
        bool fill_bottom;
-
        ///
        bool newline_allowed;
-
        ///
        bool nextnoindent;
-
        ///
        bool free_spacing;
-
        ///
        bool pass_thru;
+       ///
+       bool is_environment;
+       /// show this in toc
+       int toclevel;
+       /// for new environment insets
+       std::string latexheader;
+       /// for new environment insets
+       std::string latexfooter;
+       /// for new environment insets
+       std::string latexparagraph;
 
        /** true when the fragile commands in the paragraph need to be
            \protect'ed. */
@@ -173,12 +166,13 @@ public:
                return latextype == LATEX_PARAGRAPH;
        }
        ///
-       bool isCommand() const { 
+       bool isCommand() const {
                return latextype == LATEX_COMMAND;
        }
        ///
        bool isEnvironment() const {
                return (latextype == LATEX_ENVIRONMENT
+                       || latextype == LATEX_BIB_ENVIRONMENT
                        || latextype == LATEX_ITEM_ENVIRONMENT
                        || latextype == LATEX_LIST_ENVIRONMENT);
        }
@@ -186,33 +180,47 @@ public:
        LYX_LATEX_TYPES latextype;
        /// Does this object belong in the title part of the document?
        bool intitle;
+       /// Does this layout allow for an optional parameter?
+       int optionalargs;
+       /// Which counter to step
+       std::string 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 
+           compatibility
        */
-       string obsoleted_by_;
+       std::string obsoleted_by_;
 
-       /// LaTeX name for environment
-       string latexname_;
+       /** Name of an layout which preamble must come before this one
+           This is used when the preamble snippet uses macros defined in
+           another preamble
+        */
+       std::string depends_on_;
 
+       /// LaTeX name for environment
+       std::string latexname_;
        /// Label string. "Abstract", "Reference", "Caption"...
-       string labelstring_;
-
+       std::string labelstring_;
        ///
-       string endlabelstring_;
-
+       std::string endlabelstring_;
        /// Label string inside appendix. "Appendix", ...
-       string labelstring_appendix_;
-
+       std::string 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_;
+       std::string preamble_;
 };
 
 #endif