]> git.lyx.org Git - lyx.git/blobdiff - src/TextClass.h
SCons: msvc does not need this /TP option any more after we rename .C => .cpp. Also...
[lyx.git] / src / TextClass.h
index c3847ff497725df5f1eda6d6d101e755e74492a3..afab7ffd3e7c5b4dcb162485f5b06cd6f4ce7378 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <vector>
 #include <set>
+#include <map>
 
 namespace lyx {
 
@@ -28,9 +29,11 @@ class FloatList;
 
 
 ///
-class CharStyle {
+class InsetLayout {
 public:
        std::string name;
+       std::string lyxtype;
+       docstring labelstring;
        std::string latextype;
        std::string latexname;
        std::string latexparam;
@@ -41,8 +44,10 @@ public:
 
 
 /// List of semantically defined character style insets
-typedef std::vector<CharStyle> CharStyles;
+typedef std::vector<InsetLayout> CharStyles;
 
+/// List of inset layouts
+typedef std::map<docstring, InsetLayout> InsetLayouts;
 
 /// Stores the layout specification of a LyX document class.
 class TextClass {
@@ -79,14 +84,16 @@ public:
        ///
        void readCharStyle(Lexer &, std::string const &);
        ///
+       void readInsetLayout(Lexer &, docstring const &);
+       ///
        void readFloat(Lexer &);
        ///
        void readCounter(Lexer &);
        ///
-       bool hasLayout(std::string const & name) const;
+       bool hasLayout(docstring const & name) const;
 
        ///
-       Layout_ptr const & operator[](std::string const & vname) const;
+       Layout_ptr const & operator[](docstring const & vname) const;
 
        /// Sees to that the textclass structure has been loaded
        bool load(std::string const & path = std::string()) const;
@@ -101,15 +108,19 @@ public:
        Counters & counters() const;
        /// CharStyles of this doc class
        CharStyles & charstyles() const { return charstylelist_; };
+       ///  Inset layouts of this doc class
+       InsetLayout const & insetlayout(docstring const & name) const;
        /// Retrieve element of name s:
        CharStyles::iterator charstyle(std::string const & s) const;
        ///
-       std::string const & defaultLayoutName() const;
+       docstring const & defaultLayoutName() const;
        ///
        Layout_ptr const & defaultLayout() const;
        ///
        std::string const & name() const;
        ///
+       docstring const & labelstring() const;
+       ///
        std::string const & latexname() const;
        ///
        std::string const & description() const;
@@ -152,10 +163,10 @@ public:
        Font const & defaultfont() const;
 
        /// Text that dictates how wide the left margin is on the screen
-       std::string const & leftmargin() const;
+       docstring const & leftmargin() const;
 
        /// Text that dictates how wide the right margin is on the screen
-       std::string const & rightmargin() const;
+       docstring const & rightmargin() const;
 
        /// The type of command used to produce a title
        LYX_TITLE_LATEX_TYPES titletype() const;
@@ -172,7 +183,7 @@ public:
        bool hasTocLevels() const;
 private:
        ///
-       bool delete_layout(std::string const &);
+       bool delete_layout(docstring const &);
        ///
        bool do_readStyle(Lexer &, Layout &);
        /// Layout file name
@@ -192,7 +203,7 @@ private:
        ///
        std::string class_header_;
        ///
-       std::string defaultlayout_;
+       docstring defaultlayout_;
        /// preamble text to support layout styles
        docstring preamble_;
        /// latex packages loaded by document class.
@@ -214,10 +225,10 @@ private:
        */
        Font defaultfont_;
        /// Text that dictates how wide the left margin is on the screen
-       std::string leftmargin_;
+       docstring leftmargin_;
 
        /// Text that dictates how wide the right margin is on the screen
-       std::string rightmargin_;
+       docstring rightmargin_;
 
        /// The type of command used to produce a title
        LYX_TITLE_LATEX_TYPES titletype_;
@@ -229,11 +240,14 @@ private:
        /// CharStyles available to this layout
        mutable CharStyles charstylelist_;
 
+       /// Input layouts available to this layout
+       mutable InsetLayouts insetlayoutlist_;
+
        /// available types of float, eg. figure, algorithm.
        boost::shared_ptr<FloatList> floatlist_;
 
        /// Types of counters, eg. sections, eqns, figures, avail. in document class.
-       boost::shared_ptr<Counters> ctrs_;
+       boost::shared_ptr<Counters> counters_;
 
        /// Has this layout file been loaded yet?
        mutable bool loaded_;