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"
45 ENGINE_NATBIB_AUTHORYEAR,
46 ENGINE_NATBIB_NUMERICAL,
50 class CiteEngine_enum {
53 CiteEngine_enum(CiteEngine val) : val_(val) {}
54 operator CiteEngine() const{ return val_; }
61 /** Buffer parameters.
62 * This class contains all the parameters for this a buffer uses. Some
63 * work needs to be done on this class to make it nice. Now everything
79 /// read a header token, if unrecognised, return it or an unknown class name
80 std::string const readToken(LyXLex & lex, std::string const & token);
83 void writeFile(std::ostream &) const;
85 /** \returns true if the babel package is used (interogates
86 * the BufferParams and a LyXRC variable).
87 * This returned value can then be passed to the insets...
89 bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
92 void useClassDefaults();
95 bool hasClassDefaults() const;
98 VSpace const & getDefSkip() const;
101 void setDefSkip(VSpace const & vs);
103 /** Wether paragraphs are separated by using a indent like in
104 * articles or by using a little skip like in letters.
106 PARSEP paragraph_separation;
108 InsetQuotes::quote_language quotes_language;
110 InsetQuotes::quote_times quotes_times;
112 std::string fontsize;
114 lyx::textclass_type textclass;
116 LyXTextClass const & getLyXTextClass() const;
118 /* this are for the PaperLayout */
120 PAPER_SIZE papersize;
122 PAPER_ORIENTATION orientation;
123 /// use custom margins
126 std::string paperwidth;
128 std::string paperheight;
130 std::string leftmargin;
132 std::string topmargin;
134 std::string rightmargin;
136 std::string bottommargin;
138 std::string headheight;
142 std::string footskip;
144 /* some LaTeX options */
145 /// The graphics driver
146 std::string graphicsDriver;
151 Spacing const & spacing() const;
157 Language const * language;
159 BranchList & branchlist();
160 BranchList const & branchlist() const;
162 std::string inputenc;
164 std::string preamble;
168 std::string float_placement;
170 unsigned int columns;
172 LyXTextClass::PageSides sides;
174 std::string pagestyle;
175 /// \param index should lie in the range 0 <= \c index <= 3.
176 Bullet & temp_bullet(lyx::size_type index);
177 Bullet const & temp_bullet(lyx::size_type index) const;
178 /// \param index should lie in the range 0 <= \c index <= 3.
179 Bullet & user_defined_bullet(lyx::size_type index);
180 Bullet const & user_defined_bullet(lyx::size_type index) const;
182 void readPreamble(LyXLex &);
184 void readLanguage(LyXLex &);
186 void readGraphicsDriver(LyXLex &);
188 void readBullets(LyXLex &);
190 void readBulletsLaTeX(LyXLex &);
192 /// use AMS package, not, or auto
200 lyx::biblio::CiteEngine cite_engine;
203 /// revision tracking for this buffer ?
204 bool tracking_changes;
205 /** This param decides if change tracking marks should be output
206 * (using the dvipost package) or if the current "state" of the
207 * document should be output instead. Since dvipost needs dvi
208 * specials, it only works with dvi/ps output (the param will be
209 * ignored with other output flavors and disabled when dbipost is
213 /// Time ago we agreed that this was a buffer property [ale990407]
214 std::string parentname;
218 /// the author list for the document
219 AuthorList & authors();
220 AuthorList const & authors() const;
222 /// map of the file's author IDs to buffer author IDs
223 std::vector<int> author_map;
225 std::string const dvips_options() const;
227 std::string const paperSizeName() const;
229 std::string const babelCall(std::string const & lang_opts) const;
232 /** Use the Pimpl idiom to hide those member variables that would otherwise
233 * drag in other header files.
238 static Impl * clone(Impl const *);
239 static void destroy(Impl *);
241 lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;