X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyxtextclass.h;h=2b0a3a538a5d0ad308e7dbb0641431daa217b497;hb=dad1fc66e44a4dad94eb1e9ffd5736bf8f59ae6d;hp=ff627716761f51b3c1a334c413e22949d899397a;hpb=8283e978f8d621041c432b9b88a476bfd567385c;p=lyx.git diff --git a/src/lyxtextclass.h b/src/lyxtextclass.h index ff62771676..2b0a3a538a 100644 --- a/src/lyxtextclass.h +++ b/src/lyxtextclass.h @@ -1,72 +1,80 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== +/** + * \file lyxtextclass.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ + * 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 "LString.h" +#include #include class LyXLex; +class Counters; +class FloatList; - - -/// +/// Stores the layout specification of a LyX document class. class LyXTextClass { public: - /// - typedef std::vector LayoutList; - /// + /// 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 - LyXTextClass (string const & = string(), - string const & = string(), - string const & = string()); + LyXTextClass(string const & = string(), + string const & = string(), + string const & = string()); - /// - const_iterator begin() const { return layoutlist.begin(); } - /// - const_iterator end() const { return layoutlist.end(); } + /// paragraph styles begin iterator. + const_iterator begin() const { return layoutlist_.begin(); } + /// paragraph styles end iterator + const_iterator end() const { return layoutlist_.end(); } - /// + /// Performs the read of the layout file. bool Read(string const & filename, bool merge = false); /// void readOutputType(LyXLex &); /// + void readTitleType(LyXLex &); + /// void readMaxCounter(LyXLex &); /// void readClassOptions(LyXLex &); /// + void readFloat(LyXLex &); + /// + void readCounter(LyXLex &); + /// bool hasLayout(string const & name) const; /// - LyXLayout const & operator[](string const & vname) const; + LyXLayout_ptr const & operator[](string const & vname) const; /// Sees to that the textclass structure has been loaded bool load() const; + /// the list of floats defined in the document class + FloatList & floats(); + /// the list of floats defined in the document class + FloatList const & floats() const; + /// The Counters present in this document class. + Counters & counters() const; /// - string const defaultLayoutName() const; + string const & defaultLayoutName() const; /// - LyXLayout const & defaultLayout() const; + LyXLayout_ptr const & defaultLayout() const; /// string const & name() const; /// @@ -93,7 +101,9 @@ public: /// makeidx = 2, /// - url = 4 + url = 4, + /// + natbib = 8 }; /// bool provides(Provides p) const; @@ -114,7 +124,7 @@ public: /// int tocdepth() const; - /// + /// Can be LaTeX, LinuxDoc, etc. OutputType outputType() const; /// @@ -127,6 +137,12 @@ public: string const & rightmargin() const; /// int maxcounter() const; + + /// The type of command used to produce a title + LYX_TITLE_LATEX_TYPES titletype() const; + /// The name of the title command + string const & titlename() const; + /// int size() const; private: @@ -134,11 +150,11 @@ private: bool delete_layout(string const &); /// bool do_readStyle(LyXLex &, LyXLayout &); - /// + /// Layout file name string name_; - /// + /// document class name string latexname_; - /// + /// document class description string description_; /// Specific class options string opt_fontsize_; @@ -150,19 +166,19 @@ private: string pagestyle_; /// string defaultlayout_; - /// + /// preamble text to support layout styles string preamble_; - /// + /// latex packages loaded by document class. Provides provides_; /// unsigned int columns_; /// PageSides sides_; - /// + /// header depth to have numbering int secnumdepth_; - /// + /// header depth to appear in table of contents int tocdepth_; - /// + /// Can be LaTeX, LinuxDoc, etc. OutputType outputType_; /** Base font. The paragraph and layout fonts are resolved against this font. This has to be fully instantiated. Attributes @@ -175,18 +191,29 @@ private: /// 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 - /// - LayoutList layoutlist; + /// The type of command used to produce a title + LYX_TITLE_LATEX_TYPES titletype_; + /// The name of the title command + string titlename_; + + /// Paragraph styles used in this layout + LayoutList layoutlist_; + + /// available types of float, eg. figure, algorithm. + boost::shared_ptr floatlist_; + + /// Types of counters, eg. sections, eqns, figures, avail. in document class. + boost::shared_ptr ctrs_; /// Has this layout file been loaded yet? mutable bool loaded; }; -/// +/// Merge two different provides flags into one bit field record inline void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2) { @@ -194,7 +221,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); #endif