X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxtextclass.h;h=45cb28f7e1c72498c7d124c0189b88658e32b383;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=2bf28f6a9e3013ec9fc19ba7390b721f00783172;hpb=44cd0fc9a1687cc63911c7f98d978594458e7813;p=lyx.git diff --git a/src/lyxtextclass.h b/src/lyxtextclass.h index 2bf28f6a9e..45cb28f7e1 100644 --- a/src/lyxtextclass.h +++ b/src/lyxtextclass.h @@ -17,11 +17,31 @@ #include + +namespace lyx { + class LyXLex; class Counters; class FloatList; +/// +class CharStyle { +public: + std::string name; + std::string latextype; + std::string latexname; + std::string latexparam; + LyXFont font; + LyXFont labelfont; + docstring preamble; +}; + + +/// List of semantically defined character style insets +typedef std::vector CharStyles; + + /// Stores the layout specification of a LyX document class. class LyXTextClass { public: @@ -45,7 +65,7 @@ public: const_iterator end() const { return layoutlist_.end(); } /// Performs the read of the layout file. - bool Read(std::string const & filename, bool merge = false); + bool read(std::string const & filename, bool merge = false); /// void readOutputType(LyXLex &); /// @@ -55,6 +75,8 @@ public: /// void readClassOptions(LyXLex &); /// + void readCharStyle(LyXLex &, std::string const &); + /// void readFloat(LyXLex &); /// void readCounter(LyXLex &); @@ -65,7 +87,9 @@ public: LyXLayout_ptr const & operator[](std::string const & vname) const; /// Sees to that the textclass structure has been loaded - bool load() const; + bool load(std::string const & path = std::string()) const; + /// Has this layout file been loaded yet? + bool loaded() const { return loaded_; } /// the list of floats defined in the document class FloatList & floats(); @@ -73,6 +97,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_; }; + /// Retrieve element of name s: + CharStyles::iterator charstyle(std::string const & s) const; /// std::string const & defaultLayoutName() const; /// @@ -90,9 +118,11 @@ public: /// std::string const & options() const; /// + std::string const & class_header() const; + /// std::string const & pagestyle() const; /// - std::string const & preamble() const; + docstring const & preamble() const; /// Packages that are already loaded by the class enum Provides { @@ -126,7 +156,7 @@ public: /// int tocdepth() const; - /// Can be LaTeX, LinuxDoc, etc. + /// Can be LaTeX, DocBook, etc. OutputType outputType() const; /// @@ -145,6 +175,12 @@ public: /// int size() const; + /// The minimal TocLevel of sectioning layouts + int min_toclevel() const; + /// The maximal TocLevel of sectioning layouts + int max_toclevel() const; + /// returns true if the class has a ToC structure + bool hasTocLevels() const; private: /// bool delete_layout(std::string const &); @@ -165,9 +201,11 @@ private: /// std::string pagestyle_; /// + std::string class_header_; + /// std::string defaultlayout_; /// preamble text to support layout styles - std::string preamble_; + docstring preamble_; /// latex packages loaded by document class. Provides provides_; /// @@ -178,7 +216,7 @@ private: int secnumdepth_; /// header depth to appear in table of contents int tocdepth_; - /// Can be LaTeX, LinuxDoc, etc. + /// Can be LaTeX, DocBook, etc. OutputType outputType_; /** Base font. The paragraph and layout fonts are resolved against this font. This has to be fully instantiated. Attributes @@ -199,6 +237,8 @@ private: /// Paragraph styles used in this layout LayoutList layoutlist_; + /// CharStyles available to this layout + mutable CharStyles charstylelist_; /// available types of float, eg. figure, algorithm. boost::shared_ptr floatlist_; @@ -207,10 +247,15 @@ private: boost::shared_ptr ctrs_; /// Has this layout file been loaded yet? - mutable bool loaded; + mutable bool loaded_; /// Is the TeX class available? bool texClassAvail_; + + /// The minimal TocLevel of sectioning layouts + int min_toclevel_; + /// The maximal TocLevel of sectioning layouts + int max_toclevel_; }; @@ -225,4 +270,7 @@ void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2) /// convert page sides option to text 1 or 2 std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p); + +} // namespace lyx + #endif