]> git.lyx.org Git - lyx.git/blobdiff - src/lyxtextclass.h
de.po updated
[lyx.git] / src / lyxtextclass.h
index 1053fa805fcc6edeffdcafc79bf247bc995698bc..94273266ab29385c0c30d2ac26010191db4ac0f8 100644 (file)
@@ -1,13 +1,11 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *      
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2001 The LyX Team.
+/**
+ * \file lyxtextclass.h
+ * 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
+ */
 
 #ifndef LYXTEXTCLASS_H
 #define LYXTEXTCLASS_H
 #endif
 
 #include "lyxlayout.h"
+#include "LString.h"
+#include "lyxlayout_ptr_fwd.h"
 
 #include "support/types.h"
 
-#include "LString.h"
+#include <boost/shared_ptr.hpp>
 
 #include <vector>
 
 class LyXLex;
+class Counters;
+class FloatList;
 
-
-
-///
+/// Stores the layout specification of a LyX document class.
 class LyXTextClass {
 public:
-       ///
-       typedef std::vector<LyXLayout> LayoutList;
-       ///
+       /// The individual styles comprising the document class
+       typedef std::vector<LyXLayout_ptr> 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 &);
@@ -55,33 +55,44 @@ public:
        ///
        void readClassOptions(LyXLex &);
        ///
-       bool hasLayout(string const & name) const;
-
+       void readFloat(LyXLex &);
+       ///
+       void readCounter(LyXLex &);
        ///
-       LyXLayout const & GetLayout(string const & vname) const;
+       bool hasLayout(string const & name) const;
 
        ///
-       LyXLayout & GetLayout(string const & vname);
+       LyXLayout_ptr const & operator[](string const & vname) const;
 
        /// Sees to that the textclass structure has been loaded
-       void load();
+       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 & name() const { return name_; }
+       LyXLayout_ptr const & defaultLayout() const;
        ///
-       string const & latexname() const { return latexname_; }
+       string const & name() const;
        ///
-       string const & description() const { return description_; }
+       string const & latexname() const;
        ///
-       string const & opt_fontsize() const { return opt_fontsize_; }
+       string const & description() const;
        ///
-       string const & opt_pagestyle() const { return opt_pagestyle_; }
+       string const & opt_fontsize() const;
        ///
-       string const & options() const { return options_; }
+       string const & opt_pagestyle() const;
        ///
-       string const & pagestyle() const { return pagestyle_; }
+       string const & options() const;
        ///
-       string const & preamble() const { return preamble_; }
+       string const & pagestyle() const;
+       ///
+       string const & preamble() const;
 
        /// Packages that are already loaded by the class
        enum Provides {
@@ -92,13 +103,15 @@ public:
                ///
                makeidx = 2,
                ///
-               url = 4
+               url = 4,
+               ///
+               natbib = 8
        };
        ///
-       bool provides(Provides p) const { return provides_ & p; }
-       
+       bool provides(Provides p) const;
+
        ///
-       unsigned int columns() const { return columns_; }
+       unsigned int columns() const;
        ///
        enum PageSides {
                ///
@@ -107,14 +120,14 @@ public:
                TwoSides
        };
        ///
-       PageSides sides() const { return sides_; }
+       PageSides sides() const;
        ///
-       int secnumdepth() const { return secnumdepth_; }
+       int secnumdepth() const;
        ///
-       int tocdepth() const { return tocdepth_; }
+       int tocdepth() const;
 
-       ///
-       OutputType outputType() const { return outputType_; }
+       /// Can be LaTeX, LinuxDoc, etc.
+       OutputType outputType() const;
 
        ///
        LyXFont const & defaultfont() const;
@@ -124,24 +137,20 @@ public:
 
        /// Text that dictates how wide the right margin is on the screen
        string const & rightmargin() const;
-        ///
-       int maxcounter() const { return maxcounter_; }
        ///
-       lyx::layout_type numLayouts() const { return layoutlist.size(); }
+       int maxcounter() const;
        ///
-       LyXLayout const & operator[](lyx::layout_type i) const {
-               return layoutlist[i];
-       }
+       int size() const;
 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_;
@@ -152,18 +161,20 @@ 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
@@ -176,17 +187,24 @@ 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;
+       /// Paragraph styles used in this layout
+       LayoutList layoutlist_;
+
+       /// available types of float, eg. figure, algorithm.
+       boost::shared_ptr<FloatList> floatlist_;
+
+       /// Types of counters, eg. sections, eqns, figures, avail. in document class.
+       boost::shared_ptr<Counters> ctrs_;
 
        /// Has this layout file been loaded yet?
-       bool loaded;
+       mutable bool loaded;
 };
 
-///
+
+/// Merge two different provides flags into one bit field record
 inline
 void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
 {
@@ -194,7 +212,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