]> git.lyx.org Git - features.git/commitdiff
Backend support for layout categorization.
authorRichard Heck <rgheck@comcast.net>
Thu, 6 Mar 2008 05:01:44 +0000 (05:01 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 6 Mar 2008 05:01:44 +0000 (05:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23501 a592a061-630c-0410-9148-cb99ea01b6c8

src/Layout.cpp
src/Layout.h

index 7fedb3209c11fc16da9b7edc43a6c3d4626958e2..76e59329e75f9024ea8f95daac2880d9a3b253d2 100644 (file)
@@ -37,6 +37,7 @@ enum LayoutTags {
        LT_ALIGNPOSSIBLE,
        LT_MARGIN,
        LT_BOTTOMSEP,
+       LT_CATEGORY,
        LT_COMMANDDEPTH,
        LT_COPYSTYLE,
        LT_DEPENDSON,
@@ -137,6 +138,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                { "align",          LT_ALIGN },
                { "alignpossible",  LT_ALIGNPOSSIBLE },
                { "bottomsep",      LT_BOTTOMSEP },
+               { "category",       LT_CATEGORY },
                { "commanddepth",   LT_COMMANDDEPTH },
                { "copystyle",      LT_COPYSTYLE },
                { "dependson",      LT_DEPENDSON },
@@ -209,6 +211,11 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass)
                        finished = true;
                        break;
 
+               case LT_CATEGORY:
+                       if (lexrc.next())
+                               category_ = lowercase(lexrc.getDocString());
+                       break;
+
                case LT_COPYSTYLE:     // initialize with a known style
                        if (lexrc.next()) {
                                docstring const style = subst(lexrc.getDocString(),
index e93a9bcbc283a680d27350e64fa75a0dd8388487..32abb5c520db108ccced9625616823eb33e2eb36 100644 (file)
@@ -83,6 +83,8 @@ public:
        ///
        docstring const & endlabelstring() const { return endlabelstring_; }
        ///
+       docstring const & category() const { return category_; }
+       ///
        docstring const & preamble() const { return preamble_; }
        ///
        std::set<std::string> const & requires() const { return requires_; }
@@ -254,6 +256,10 @@ private:
        std::string labeltag_;
        /// Internal tag to surround the item text in a list)
        std::string itemtag_;
+       /// This is the `category' for this layout. The following are
+       /// recommended basic categories: FrontMatter, BackMatter, MainText,
+       /// Section, Starred, List, Theorem.
+       docstring category_;
        /// Macro definitions needed for this layout
        docstring preamble_;
        /// Packages needed for this layout