X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxtextclass.h;h=e400338ae4ad911c8c62b0a6d1efa2b437547b36;hb=37e82a546392d43f787826b85481a11f2a27af15;hp=94273266ab29385c0c30d2ac26010191db4ac0f8;hpb=a9d8dee97bbedc2f37f168f8c05957917ca6f09a;p=lyx.git diff --git a/src/lyxtextclass.h b/src/lyxtextclass.h index 94273266ab..e400338ae4 100644 --- a/src/lyxtextclass.h +++ b/src/lyxtextclass.h @@ -4,22 +4,15 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * Full author contact details are available in file CREDITS + * Full author contact details are available in file CREDITS. */ #ifndef LYXTEXTCLASS_H #define LYXTEXTCLASS_H -#ifdef __GNUG__ -#pragma interface -#endif - #include "lyxlayout.h" -#include "LString.h" #include "lyxlayout_ptr_fwd.h" -#include "support/types.h" - #include #include @@ -28,6 +21,23 @@ class LyXLex; class Counters; class FloatList; + +/// +struct CharStyle { + std::string name; + std::string latextype; + std::string latexname; + std::string latexparam; + LyXFont font; + LyXFont labelfont; + std::string preamble; +}; + + +/// List of semantically defined character style insets +typedef std::vector CharStyles; + + /// Stores the layout specification of a LyX document class. class LyXTextClass { public: @@ -37,9 +47,13 @@ public: typedef LayoutList::const_iterator const_iterator; /// Construct a layout with default values. Actual values loaded later. explicit - LyXTextClass(string const & = string(), - string const & = string(), - string const & = string()); + LyXTextClass(std::string const & = std::string(), + std::string const & = std::string(), + std::string const & = std::string(), + bool = false); + + /// check whether the TeX class is available + bool isTeXClassAvailable() const; /// paragraph styles begin iterator. const_iterator begin() const { return layoutlist_.begin(); } @@ -47,25 +61,31 @@ public: const_iterator end() const { return layoutlist_.end(); } /// Performs the read of the layout file. - bool Read(string const & filename, bool merge = false); + bool Read(std::string const & filename, bool merge = false); /// void readOutputType(LyXLex &); /// + void readTitleType(LyXLex &); + /// void readMaxCounter(LyXLex &); /// void readClassOptions(LyXLex &); /// + void readCharStyle(LyXLex &, std::string const &); + /// void readFloat(LyXLex &); /// void readCounter(LyXLex &); /// - bool hasLayout(string const & name) const; + bool hasLayout(std::string const & name) const; /// - LyXLayout_ptr const & operator[](string const & vname) const; + LyXLayout_ptr const & operator[](std::string const & vname) const; /// Sees to that the textclass structure has been loaded bool load() 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,26 +93,32 @@ 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; /// - string const & defaultLayoutName() const; + std::string const & defaultLayoutName() const; /// LyXLayout_ptr const & defaultLayout() const; /// - string const & name() const; + std::string const & name() const; /// - string const & latexname() const; + std::string const & latexname() const; /// - string const & description() const; + std::string const & description() const; /// - string const & opt_fontsize() const; + std::string const & opt_fontsize() const; /// - string const & opt_pagestyle() const; + std::string const & opt_pagestyle() const; /// - string const & options() const; + std::string const & options() const; /// - string const & pagestyle() const; + std::string const & class_header() const; /// - string const & preamble() const; + std::string const & pagestyle() const; + /// + std::string const & preamble() const; /// Packages that are already loaded by the class enum Provides { @@ -133,37 +159,43 @@ public: LyXFont const & defaultfont() const; /// Text that dictates how wide the left margin is on the screen - string const & leftmargin() const; + std::string const & leftmargin() const; /// Text that dictates how wide the right margin is on the screen - string const & rightmargin() const; - /// - int maxcounter() const; + std::string const & rightmargin() const; + + /// The type of command used to produce a title + LYX_TITLE_LATEX_TYPES titletype() const; + /// The name of the title command + std::string const & titlename() const; + /// int size() const; private: /// - bool delete_layout(string const &); + bool delete_layout(std::string const &); /// bool do_readStyle(LyXLex &, LyXLayout &); /// Layout file name - string name_; + std::string name_; /// document class name - string latexname_; + std::string latexname_; /// document class description - string description_; + std::string description_; /// Specific class options - string opt_fontsize_; + std::string opt_fontsize_; + /// + std::string opt_pagestyle_; /// - string opt_pagestyle_; + std::string options_; /// - string options_; + std::string pagestyle_; /// - string pagestyle_; + std::string class_header_; /// - string defaultlayout_; + std::string defaultlayout_; /// preamble text to support layout styles - string preamble_; + std::string preamble_; /// latex packages loaded by document class. Provides provides_; /// @@ -183,15 +215,20 @@ private: */ LyXFont defaultfont_; /// Text that dictates how wide the left margin is on the screen - string leftmargin_; + std::string leftmargin_; /// Text that dictates how wide the right margin is on the screen - string rightmargin_; - /// highest header level used in this layout. - int maxcounter_; // add approp. signedness + std::string rightmargin_; + + /// The type of command used to produce a title + LYX_TITLE_LATEX_TYPES titletype_; + /// The name of the title command + std::string titlename_; /// 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_; @@ -200,7 +237,10 @@ 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_; };