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 "support/types.h"
35 typedef std::vector<LyXLayout> LayoutList;
37 typedef LayoutList::const_iterator const_iterator;
40 LyXTextClass (string const & = string(),
41 string const & = string(),
42 string const & = string());
45 const_iterator begin() const { return layoutlist.begin(); }
47 const_iterator end() const { return layoutlist.end(); }
50 bool Read(string const & filename, bool merge = false);
52 void readOutputType(LyXLex &);
54 void readMaxCounter(LyXLex &);
56 void readClassOptions(LyXLex &);
58 bool hasLayout(string const & name) const;
61 LyXLayout const & operator[](string const & vname) const;
63 /// Sees to that the textclass structure has been loaded
67 string const defaultLayoutName() const;
69 LyXLayout const & defaultLayout() const;
71 string const & name() const;
73 string const & latexname() const;
75 string const & description() const;
77 string const & opt_fontsize() const;
79 string const & opt_pagestyle() const;
81 string const & options() const;
83 string const & pagestyle() const;
85 string const & preamble() const;
87 /// Packages that are already loaded by the class
101 bool provides(Provides p) const;
104 unsigned int columns() const;
113 PageSides sides() const;
115 int secnumdepth() const;
117 int tocdepth() const;
120 OutputType outputType() const;
123 LyXFont const & defaultfont() const;
125 /// Text that dictates how wide the left margin is on the screen
126 string const & leftmargin() const;
128 /// Text that dictates how wide the right margin is on the screen
129 string const & rightmargin() const;
131 int maxcounter() const;
136 bool delete_layout(string const &);
138 bool do_readStyle(LyXLex &, LyXLayout &);
145 /// Specific class options
146 string opt_fontsize_;
148 string opt_pagestyle_;
154 string defaultlayout_;
160 unsigned int columns_;
168 OutputType outputType_;
169 /** Base font. The paragraph and layout fonts are resolved against
170 this font. This has to be fully instantiated. Attributes
171 LyXFont::INHERIT, LyXFont::IGNORE, and LyXFont::TOGGLE are
174 LyXFont defaultfont_;
175 /// Text that dictates how wide the left margin is on the screen
178 /// Text that dictates how wide the right margin is on the screen
181 int maxcounter_; // add approp. signedness
184 LayoutList layoutlist;
186 /// Has this layout file been loaded yet?
193 void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
195 p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
200 std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);