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"
26 #include "support/std_string.h"
41 /** Buffer parameters.
42 * This class contains all the parameters for this a buffer uses. Some
43 * work needs to be done on this class to make it nice. Now everything
59 /// read a header token, if unrecognised, return it or an unknown class name
60 string const readToken(LyXLex & lex, string const & token);
63 void writeFile(std::ostream &) const;
65 /** \returns true if the babel package is used (interogates
66 * the BufferParams and a LyXRC variable).
67 * This returned value can then be passed to the insets...
69 bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
75 void useClassDefaults();
78 bool hasClassDefaults() const;
81 VSpace const & getDefSkip() const;
84 void setDefSkip(VSpace const & vs);
86 /** Wether paragraphs are separated by using a indent like in
87 * articles or by using a little skip like in letters.
89 PARSEP paragraph_separation;
91 InsetQuotes::quote_language quotes_language;
93 InsetQuotes::quote_times quotes_times;
97 lyx::textclass_type textclass;
99 LyXTextClass const & getLyXTextClass() const;
101 /* this are for the PaperLayout */
102 /// the general papersize (papersize2 or paperpackage
103 PAPER_SIZE papersize;
104 /// the selected Geometry papersize
105 VMARGIN_PAPER_TYPE papersize2;
106 /// a special paperpackage .sty-file
107 PAPER_PACKAGES paperpackage;
109 PAPER_ORIENTATION orientation;
131 /* some LaTeX options */
132 /// The graphics driver
133 string graphicsDriver;
138 Spacing const & spacing() const;
144 Language const * language;
146 BranchList & branchlist();
147 BranchList const & branchlist() const;
155 string float_placement;
157 unsigned int columns;
159 LyXTextClass::PageSides sides;
162 /// \param index should lie in the range 0 <= \c index <= 3.
163 Bullet & temp_bullet(lyx::size_type index);
164 Bullet const & temp_bullet(lyx::size_type index) const;
165 /// \param index should lie in the range 0 <= \c index <= 3.
166 Bullet & user_defined_bullet(lyx::size_type index);
167 Bullet const & user_defined_bullet(lyx::size_type index) const;
169 void readPreamble(LyXLex &);
171 void readLanguage(LyXLex &);
173 void readGraphicsDriver(LyXLex &);
175 /// use AMS package, not, or auto
185 bool use_numerical_citations;
186 /// revision tracking for this buffer ?
187 bool tracking_changes;
188 /// Time ago we agreed that this was a buffer property [ale990407]
193 /// the author list for the document
194 AuthorList & authors();
195 AuthorList const & authors() const;
197 /// map of the file's author IDs to buffer author IDs
198 std::vector<int> author_map;
200 string const dvips_options() const;
202 string const paperSizeName() const;
205 /** Use the Pimpl idiom to hide those member variables that would otherwise
206 * drag in other header files.
209 struct MemoryTraits {
210 static Impl * clone(Impl const *);
211 static void destroy(Impl *);
213 lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;