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"
23 #include "support/types.h"
33 typedef std::vector<LyXLayout_ptr> LayoutList;
35 typedef LayoutList::const_iterator const_iterator;
38 LyXTextClass (string const & = string(),
39 string const & = string(),
40 string const & = string());
43 const_iterator begin() const { return layoutlist.begin(); }
45 const_iterator end() const { return layoutlist.end(); }
48 bool Read(string const & filename, bool merge = false);
50 void readOutputType(LyXLex &);
52 void readMaxCounter(LyXLex &);
54 void readClassOptions(LyXLex &);
56 bool hasLayout(string const & name) const;
59 LyXLayout_ptr const & operator[](string const & vname) const;
61 /// Sees to that the textclass structure has been loaded
65 string const defaultLayoutName() const;
67 LyXLayout_ptr const & defaultLayout() const;
69 string const & name() const;
71 string const & latexname() const;
73 string const & description() const;
75 string const & opt_fontsize() const;
77 string const & opt_pagestyle() const;
79 string const & options() const;
81 string const & pagestyle() const;
83 string const & preamble() const;
85 /// Packages that are already loaded by the class
99 bool provides(Provides p) const;
102 unsigned int columns() const;
111 PageSides sides() const;
113 int secnumdepth() const;
115 int tocdepth() const;
118 OutputType outputType() const;
121 LyXFont const & defaultfont() const;
123 /// Text that dictates how wide the left margin is on the screen
124 string const & leftmargin() const;
126 /// Text that dictates how wide the right margin is on the screen
127 string const & rightmargin() const;
129 int maxcounter() const;
134 bool delete_layout(string const &);
136 bool do_readStyle(LyXLex &, LyXLayout &);
143 /// Specific class options
144 string opt_fontsize_;
146 string opt_pagestyle_;
152 string defaultlayout_;
158 unsigned int columns_;
166 OutputType outputType_;
167 /** Base font. The paragraph and layout fonts are resolved against
168 this font. This has to be fully instantiated. Attributes
169 LyXFont::INHERIT, LyXFont::IGNORE, and LyXFont::TOGGLE are
172 LyXFont defaultfont_;
173 /// Text that dictates how wide the left margin is on the screen
176 /// Text that dictates how wide the right margin is on the screen
179 int maxcounter_; // add approp. signedness
182 LayoutList layoutlist;
184 /// Has this layout file been loaded yet?
191 void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
193 p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
198 std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);