X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextClass.h;h=07b4f16893f49ce1c934c8d9953526f0bad8f080;hb=0362c6aae73c293d1c20277c12d362acfe0b2ef6;hp=4b9c1d3cea5e63bbff291e5c2445b8d7741f81ef;hpb=b76e95b9428bcea97f8660c6a1b0b752db918c3e;p=lyx.git diff --git a/src/TextClass.h b/src/TextClass.h index 4b9c1d3cea..07b4f16893 100644 --- a/src/TextClass.h +++ b/src/TextClass.h @@ -43,8 +43,6 @@ class TextClass { public: /// The individual styles comprising the document class typedef std::vector LayoutList; - /// Enumerate the paragraph styles. - typedef LayoutList::const_iterator const_iterator; /// Construct a layout with default values. Actual values loaded later. explicit TextClass(std::string const & = std::string(), @@ -55,12 +53,12 @@ public: /// check whether the TeX class is available bool isTeXClassAvailable() const; - /// paragraph styles begin iterator. - const_iterator begin() const { return layoutlist_.begin(); } - /// paragraph styles end iterator - const_iterator end() const { return layoutlist_.end(); } + /// Enumerate the paragraph styles. + size_t layoutCount() const { return layoutlist_.size(); } + /// Access the paragraph styles. + LayoutPtr const & layout(size_t index) const { return layoutlist_[index]; } - ///Enum used with TextClass::read + /// 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 @@ -80,8 +78,6 @@ public: /// void readCharStyle(Lexer &, std::string const &); /// - void readInsetLayout(Lexer &, docstring const &); - /// void readFloat(Lexer &); /// void readCounter(Lexer &); @@ -103,9 +99,9 @@ public: /// The Counters present in this document class. Counters & counters() const; /// Inset layouts of this doc class - InsetLayouts & insetlayouts() const { return insetlayoutlist_; }; + InsetLayouts & insetLayouts() const { return insetlayoutlist_; }; /// - InsetLayout const & insetlayout(docstring const & name) const; + InsetLayout const & insetLayout(docstring const & name) const; /// docstring const & defaultLayoutName() const; /// @@ -182,6 +178,8 @@ public: int max_toclevel() const; /// returns true if the class has a ToC structure bool hasTocLevels() const; + /// + static InsetLayout const & emptyInsetLayout() { return empty_insetlayout_; } private: /// bool deleteLayout(docstring const &); @@ -265,6 +263,8 @@ private: int min_toclevel_; /// The maximal TocLevel of sectioning layouts int max_toclevel_; + /// + static InsetLayout empty_insetlayout_; };