// -*- C++ -*-
/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
#endif
#include "lyxlayout.h"
+#include "LString.h"
+#include "lyxlayout_ptr_fwd.h"
+#include "FloatList.h"
#include "support/types.h"
-#include "LString.h"
+#include <boost/shared_ptr.hpp>
#include <vector>
class LyXLex;
-
-
+class Counters;
///
class LyXTextClass {
public:
///
- typedef std::vector<LyXLayout> LayoutList;
+ typedef std::vector<LyXLayout_ptr> LayoutList;
///
typedef LayoutList::const_iterator const_iterator;
///
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 begin() const { return layoutlist_.begin(); }
///
- const_iterator end() const { return layoutlist.end(); }
-
+ const_iterator end() const { return layoutlist_.end(); }
+
///
bool Read(string const & filename, bool merge = false);
///
///
void readClassOptions(LyXLex &);
///
- bool hasLayout(string const & name) const;
-
+ void readFloat(LyXLex &);
///
- LyXLayout const & GetLayout(string const & vname) const;
+ void readCounter(LyXLex &);
+ ///
+ 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 class
+ FloatList & floats();
+ /// the list of floats defined in the class
+ FloatList const & floats() const;
+ /// The Counters present in this textclass.
+ Counters & counters() const;
///
- string const & name() const { return name_; }
+ string const & defaultLayoutName() const;
///
- string const & latexname() const { return latexname_; }
+ LyXLayout_ptr const & defaultLayout() const;
///
- string const & description() const { return description_; }
+ string const & name() const;
///
- string const & opt_fontsize() const { return opt_fontsize_; }
+ string const & latexname() const;
///
- string const & opt_pagestyle() const { return opt_pagestyle_; }
+ string const & description() const;
///
- string const & options() const { return options_; }
+ string const & opt_fontsize() const;
///
- string const & pagestyle() const { return pagestyle_; }
+ string const & opt_pagestyle() const;
///
- string const & preamble() const { return preamble_; }
+ string const & options() const;
+ ///
+ string const & pagestyle() const;
+ ///
+ string const & preamble() const;
/// Packages that are already loaded by the class
enum Provides {
///
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 {
///
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_; }
+ OutputType outputType() const;
///
LyXFont const & defaultfont() const;
/// 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 &);
///
string pagestyle_;
///
+ string defaultlayout_;
+ ///
string preamble_;
///
Provides provides_;
int maxcounter_; // add approp. signedness
///
- LayoutList layoutlist;
+ LayoutList layoutlist_;
+
+ ///
+ FloatList floatlist_;
+
+ ///
+ boost::shared_ptr<Counters> ctrs_;
/// Has this layout file been loaded yet?
- bool loaded;
+ mutable bool loaded;
};
+
///
inline
void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)