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 bool hasLayout(string const & name) const;
60 LyXLayout_ptr const & operator[](string const & vname) const;
62 /// Sees to that the textclass structure has been loaded
65 /// the list of floats defined in the class
67 /// the list of floats defined in the class
68 FloatList const & floats() const;
71 string const defaultLayoutName() const;
73 LyXLayout_ptr const & defaultLayout() const;
75 string const & name() const;
77 string const & latexname() const;
79 string const & description() const;
81 string const & opt_fontsize() const;
83 string const & opt_pagestyle() const;
85 string const & options() const;
87 string const & pagestyle() const;
89 string const & preamble() const;
91 /// Packages that are already loaded by the class
105 bool provides(Provides p) const;
108 unsigned int columns() const;
117 PageSides sides() const;
119 int secnumdepth() const;
121 int tocdepth() const;
124 OutputType outputType() const;
127 LyXFont const & defaultfont() const;
129 /// Text that dictates how wide the left margin is on the screen
130 string const & leftmargin() const;
132 /// Text that dictates how wide the right margin is on the screen
133 string const & rightmargin() const;
135 int maxcounter() const;
140 bool delete_layout(string const &);
142 bool do_readStyle(LyXLex &, LyXLayout &);
149 /// Specific class options
150 string opt_fontsize_;
152 string opt_pagestyle_;
158 string defaultlayout_;
164 unsigned int columns_;
172 OutputType outputType_;
173 /** Base font. The paragraph and layout fonts are resolved against
174 this font. This has to be fully instantiated. Attributes
175 LyXFont::INHERIT, LyXFont::IGNORE, and LyXFont::TOGGLE are
178 LyXFont defaultfont_;
179 /// Text that dictates how wide the left margin is on the screen
182 /// Text that dictates how wide the right margin is on the screen
185 int maxcounter_; // add approp. signedness
188 LayoutList layoutlist_;
191 FloatList floatlist_;
193 /// Has this layout file been loaded yet?
200 void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
202 p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
207 std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);