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;
64 LyXLayout & operator[](string const & vname);
66 /// Sees to that the textclass structure has been loaded
70 string const defaultLayoutName() const;
72 LyXLayout const & defaultLayout() const;
74 LyXLayout & defaultLayout();
76 string const & name() const;
78 string const & latexname() const;
80 string const & description() const;
82 string const & opt_fontsize() const;
84 string const & opt_pagestyle() const;
86 string const & options() const;
88 string const & pagestyle() const;
90 string const & preamble() const;
92 /// Packages that are already loaded by the class
104 bool provides(Provides p) const;
107 unsigned int columns() const;
116 PageSides sides() const;
118 int secnumdepth() const;
120 int tocdepth() const;
123 OutputType outputType() const;
126 LyXFont const & defaultfont() const;
128 /// Text that dictates how wide the left margin is on the screen
129 string const & leftmargin() const;
131 /// Text that dictates how wide the right margin is on the screen
132 string const & rightmargin() const;
134 int maxcounter() const;
139 bool delete_layout(string const &);
141 bool do_readStyle(LyXLex &, LyXLayout &);
148 /// Specific class options
149 string opt_fontsize_;
151 string opt_pagestyle_;
157 string defaultlayout_;
163 unsigned int columns_;
171 OutputType outputType_;
172 /** Base font. The paragraph and layout fonts are resolved against
173 this font. This has to be fully instantiated. Attributes
174 LyXFont::INHERIT, LyXFont::IGNORE, and LyXFont::TOGGLE are
177 LyXFont defaultfont_;
178 /// Text that dictates how wide the left margin is on the screen
181 /// Text that dictates how wide the right margin is on the screen
184 int maxcounter_; // add approp. signedness
187 LayoutList layoutlist;
189 /// Has this layout file been loaded yet?
196 void operator|=(LyXTextClass::Provides & p1, LyXTextClass::Provides p2)
198 p1 = static_cast<LyXTextClass::Provides>(p1 | p2);
203 std::ostream & operator<<(std::ostream & os, LyXTextClass::PageSides p);