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
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);