]> git.lyx.org Git - lyx.git/blobdiff - src/Layout.h
Natbib authoryear uses (Ref1; Ref2) by default.
[lyx.git] / src / Layout.h
index 9b3ff388a64694c8cf1711f8096d6a5b0ab20740..b7c6e708cd1f1c02db73fb28ec3a8b6ce212ee16 100644 (file)
@@ -75,6 +75,8 @@ public:
        void readSpacing(Lexer &);
        ///
        void readArgument(Lexer &);
+       /// Write a layout definition in utf8 encoding
+       void write(std::ostream &) const;
        ///
        docstring const & name() const { return name_; }
        ///
@@ -86,7 +88,7 @@ public:
        ///
        std::string const & latexname() const { return latexname_; }
        ///
-       void setLatexName(std::string const & n) { latexname_ = n; }
+       std::string const & itemcommand() const { return itemcommand_; }
        /// The arguments of this layout
        struct latexarg {
                docstring labelstring;
@@ -94,17 +96,24 @@ public:
                bool mandatory;
                docstring ldelim;
                docstring rdelim;
+               docstring defaultarg;
+               docstring presetarg;
                docstring tooltip;
                std::string requires;
                std::string decoration;
                FontInfo font;
                FontInfo labelfont;
+               bool autoinsert;
        };
        ///
        typedef std::map<std::string, latexarg> LaTeXArgMap;
        ///
+       LaTeXArgMap args() const;
+       ///
        LaTeXArgMap const & latexargs() const { return latexargs_; }
        ///
+       LaTeXArgMap const & postcommandargs() const { return postcommandargs_; }
+       ///
        LaTeXArgMap const & itemargs() const { return itemargs_; }
        ///
        int optArgs() const;
@@ -172,6 +181,24 @@ public:
                        || latextype == LATEX_ITEM_ENVIRONMENT
                        || latextype == LATEX_LIST_ENVIRONMENT;
        }
+       /// Is this the kind of layout in which adjacent paragraphs
+       /// are handled as one group?
+       bool isParagraphGroup() const {
+       return latextype == LATEX_ENVIRONMENT
+               || latextype == LATEX_BIB_ENVIRONMENT;
+       }
+       ///
+       bool labelIsInline() const {
+               return labeltype == LABEL_STATIC
+                       || labeltype == LABEL_SENSITIVE
+                 || labeltype == LABEL_ENUMERATE
+                       || labeltype == LABEL_ITEMIZE;
+       }
+       bool labelIsAbove() const {
+               return labeltype == LABEL_ABOVE
+                       || labeltype == LABEL_CENTERED
+                 || labeltype == LABEL_BIBLIO;
+       }
 
        ///
        bool operator==(Layout const &) const;
@@ -324,6 +351,8 @@ private:
        docstring labelstring_appendix_;
        /// LaTeX parameter for environment
        std::string latexparam_;
+       /// Item command in lists
+       std::string itemcommand_;
        /// Left delimiter of the content
        docstring leftdelim_;
        /// Right delimiter of the content
@@ -403,6 +432,8 @@ private:
        ///
        LaTeXArgMap latexargs_;
        ///
+       LaTeXArgMap postcommandargs_;
+       ///
        LaTeXArgMap itemargs_;
 };