2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
12 #ifndef LYXTEXTCLASS_H
13 #define LYXTEXTCLASS_H
19 #include "lyxlayout.h"
21 #include "lyxlayout_ptr_fwd.h"
22 #include "FloatList.h"
24 #include "support/types.h"
34 typedef std::vector<LyXLayout_ptr> LayoutList;
36 typedef LayoutList::const_iterator const_iterator;
39 LyXTextClass (string const & = string(),
40 string const & = string(),
41 string const & = string());
44 const_iterator begin() const { return layoutlist_.begin(); }
46 const_iterator end() const { return layoutlist_.end(); }
49 bool Read(string const & filename, bool merge = false);
51 void readOutputType(LyXLex &);
53 void readMaxCounter(LyXLex &);
55 void readClassOptions(LyXLex &);
57 void readFloat(LyXLex &);
59 bool hasLayout(string const & name) const;
62 LyXLayout_ptr const & operator[](string const & vname) const;
64 /// Sees to that the textclass structure has been loaded
67 /// the list of floats defined in the class
69 /// the list of floats defined in the class
70 FloatList const & floats() const;
73 string const defaultLayoutName() const;
75 LyXLayout_ptr const & defaultLayout() const;
77 string const & name() const;
79 string const & latexname() const;
81 string const & description() const;
83 string const & opt_fontsize() const;
85 string const & opt_pagestyle() const;
87 string const & options() const;
89 string const & pagestyle() const;
91 string const & preamble() const;
93 /// Packages that are already loaded by the class
107 bool provides(Provides p) const;
110 unsigned int columns() const;
119 PageSides sides() const;
121 int secnumdepth() const;
123 int tocdepth() const;
126 OutputType outputType() const;
129 LyXFont const & defaultfont() const;
131 /// Text that dictates how wide the left margin is on the screen
132 string const & leftmargin() const;
134 /// Text that dictates how wide the right margin is on the screen
135 string const & rightmargin() const;
137 int maxcounter() const;
142 bool delete_layout(string const &);
144 bool do_readStyle(LyXLex &, LyXLayout &);
151 /// Specific class options
152 string opt_fontsize_;
154 string opt_pagestyle_;
160 string defaultlayout_;
166 unsigned int columns_;
174 OutputType outputType_;
175 /** Base font. The paragraph and layout fonts are resolved against
176 this font. This has to be fully instantiated. Attributes
177 LyXFont::INHERIT, LyXFont::IGNORE, and LyXFont::TOGGLE are
180 LyXFont defaultfont_;
181 /// Text that dictates how wide the left margin is on the screen
184 /// Text that dictates how wide the right margin is on the screen
187 int maxcounter_; // add approp. signedness
190 LayoutList layoutlist_;
193 FloatList floatlist_;
195 /// Has this layout file been loaded yet?
202 void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
204 p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
209 std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);