4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
10 * \author André Pönitz
12 * Full author contact details are available in file CREDITS.
15 #ifndef BUFFERPARAMS_H
16 #define BUFFERPARAMS_H
18 #include "lyxtextclass.h"
21 #include "insets/insetquotes.h"
23 #include "support/copied_ptr.h"
24 #include "support/types.h"
40 /** Buffer parameters.
41 * This class contains all the parameters for this a buffer uses. Some
42 * work needs to be done on this class to make it nice. Now everything
58 /// read a header token, if unrecognised, return it or an unknown class name
59 std::string const readToken(LyXLex & lex, std::string const & token);
62 void writeFile(std::ostream &) const;
64 /** \returns true if the babel package is used (interogates
65 * the BufferParams and a LyXRC variable).
66 * This returned value can then be passed to the insets...
68 bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
74 void useClassDefaults();
77 bool hasClassDefaults() const;
80 VSpace const & getDefSkip() const;
83 void setDefSkip(VSpace const & vs);
85 /** Wether paragraphs are separated by using a indent like in
86 * articles or by using a little skip like in letters.
88 PARSEP paragraph_separation;
90 InsetQuotes::quote_language quotes_language;
92 InsetQuotes::quote_times quotes_times;
96 lyx::textclass_type textclass;
98 LyXTextClass const & getLyXTextClass() const;
100 /* this are for the PaperLayout */
101 /// the general papersize (papersize2 or paperpackage
102 PAPER_SIZE papersize;
103 /// the selected Geometry papersize
104 VMARGIN_PAPER_TYPE papersize2;
105 /// a special paperpackage .sty-file
106 PAPER_PACKAGES paperpackage;
108 PAPER_ORIENTATION orientation;
112 std::string paperwidth;
114 std::string paperheight;
116 std::string leftmargin;
118 std::string topmargin;
120 std::string rightmargin;
122 std::string bottommargin;
124 std::string headheight;
128 std::string footskip;
130 /* some LaTeX options */
131 /// The graphics driver
132 std::string graphicsDriver;
137 Spacing const & spacing() const;
143 Language const * language;
145 BranchList & branchlist();
146 BranchList const & branchlist() const;
148 std::string inputenc;
150 std::string preamble;
154 std::string float_placement;
156 unsigned int columns;
158 LyXTextClass::PageSides sides;
160 std::string pagestyle;
161 /// \param index should lie in the range 0 <= \c index <= 3.
162 Bullet & temp_bullet(lyx::size_type index);
163 Bullet const & temp_bullet(lyx::size_type index) const;
164 /// \param index should lie in the range 0 <= \c index <= 3.
165 Bullet & user_defined_bullet(lyx::size_type index);
166 Bullet const & user_defined_bullet(lyx::size_type index) const;
168 void readPreamble(LyXLex &);
170 void readLanguage(LyXLex &);
172 void readGraphicsDriver(LyXLex &);
174 /// use AMS package, not, or auto
184 bool use_numerical_citations;
185 /// revision tracking for this buffer ?
186 bool tracking_changes;
187 /// Time ago we agreed that this was a buffer property [ale990407]
188 std::string parentname;
192 /// the author list for the document
193 AuthorList & authors();
194 AuthorList const & authors() const;
196 /// map of the file's author IDs to buffer author IDs
197 std::vector<int> author_map;
199 std::string const dvips_options() const;
201 std::string const paperSizeName() const;
204 /** Use the Pimpl idiom to hide those member variables that would otherwise
205 * drag in other header files.
208 struct MemoryTraits {
209 static Impl * clone(Impl const *);
210 static void destroy(Impl *);
212 lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;