Backend support for layout categorization.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23501 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-03-06 05:01:44 +00:00
parent 051d887f33
commit a307f3b9ae
2 changed files with 13 additions and 0 deletions

View 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(),

View 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