]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.h
Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
[lyx.git] / src / TextClass.h
index 3de96d752da2b55b0a394fdba42d3ea083f58073..d9a13e84c49baa9a35b6e7ec175acc65b7595e0e 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef LYXTEXTCLASS_H
 #define LYXTEXTCLASS_H
 
+#include "Color.h"
 #include "Layout.h"
 #include "lyxlayout_ptr_fwd.h"
 
@@ -34,18 +35,17 @@ public:
        std::string name;
        std::string lyxtype;
        docstring labelstring;
+       std::string decoration;
        std::string latextype;
        std::string latexname;
        std::string latexparam;
        Font font;
        Font labelfont;
+       Color::color bgcolor;
        std::string preamble;
 };
 
 
-/// List of semantically defined character style insets
-typedef std::vector<InsetLayout> CharStyles;
-
 /// List of inset layouts
 typedef std::map<docstring, InsetLayout> InsetLayouts;
 
@@ -61,8 +61,8 @@ public:
        TextClass(std::string const & = std::string(),
                     std::string const & = std::string(),
                     std::string const & = std::string(),
-                    bool = false);
-
+                    bool texClassAvail = false);
+       
        /// check whether the TeX class is available
        bool isTeXClassAvailable() const;
 
@@ -71,8 +71,14 @@ public:
        /// paragraph styles end iterator
        const_iterator end() const { return layoutlist_.end(); }
 
+       ///Enum used with TextClass::read
+       enum ReadType { 
+               BASECLASS, //>This is a base class, i.e., top-level layout file
+               MERGE, //>This is a file included in a layout file
+               MODULE //>This is a layout module
+       };
        /// Performs the read of the layout file.
-       bool read(support::FileName const & filename, bool merge = false);
+       bool read(support::FileName const & filename, ReadType rt = BASECLASS);
        ///
        void readOutputType(Lexer &);
        ///
@@ -106,14 +112,10 @@ public:
        FloatList const & floats() const;
        /// The Counters present in this document class.
        Counters & counters() const;
-       /// CharStyles of this doc class
-       CharStyles & charstyles() const { return charstylelist_; };
        /// Inset layouts of this doc class
        InsetLayouts & insetlayouts() const { return insetlayoutlist_; };
        ///
        InsetLayout const & insetlayout(docstring const & name) const;
-       /// Retrieve element of name s:
-       CharStyles::iterator charstyle(std::string const & s) const;
        ///
        docstring const & defaultLayoutName() const;
        ///
@@ -127,6 +129,11 @@ public:
        ///
        std::string const & description() const;
        ///
+       bool isModular() const { return modular_; }
+       /// Sets the layout as a modular one. There is never any
+       /// need to reset this.
+       void markAsModular() { modular_ = true; }
+       ///
        std::string const & opt_fontsize() const;
        ///
        std::string const & opt_pagestyle() const;
@@ -194,11 +201,14 @@ private:
        std::string latexname_;
        /// document class description
        std::string description_;
-       /// Specific class options
+       /// whether this is a modular layout, i.e., whether it has been
+       /// modified by loading of layout modules.
+       bool modular_;
+       ///
        std::string opt_fontsize_;
        ///
        std::string opt_pagestyle_;
-       ///
+       /// Specific class options
        std::string options_;
        ///
        std::string pagestyle_;
@@ -239,8 +249,6 @@ private:
 
        /// Paragraph styles used in this layout
        LayoutList layoutlist_;
-       /// CharStyles available to this layout
-       mutable CharStyles charstylelist_;
 
        /// Input layouts available to this layout
        mutable InsetLayouts insetlayoutlist_;