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;
95 void useClassDefaults();
98 bool hasClassDefaults() const;
101 VSpace const & getDefSkip() const;
104 void setDefSkip(VSpace const & vs);
106 /** Wether paragraphs are separated by using a indent like in
107 * articles or by using a little skip like in letters.
109 PARSEP paragraph_separation;
111 InsetQuotes::quote_language quotes_language;
113 InsetQuotes::quote_times quotes_times;
115 std::string fontsize;
117 lyx::textclass_type textclass;
119 LyXTextClass const & getLyXTextClass() const;
121 /* this are for the PaperLayout */
122 /// the general papersize (papersize2 or paperpackage
123 PAPER_SIZE papersize;
124 /// the selected Geometry papersize
125 VMARGIN_PAPER_TYPE papersize2;
126 /// a special paperpackage .sty-file
127 PAPER_PACKAGES paperpackage;
129 PAPER_ORIENTATION orientation;
133 std::string paperwidth;
135 std::string paperheight;
137 std::string leftmargin;
139 std::string topmargin;
141 std::string rightmargin;
143 std::string bottommargin;
145 std::string headheight;
149 std::string footskip;
151 /* some LaTeX options */
152 /// The graphics driver
153 std::string graphicsDriver;
158 Spacing const & spacing() const;
164 Language const * language;
166 BranchList & branchlist();
167 BranchList const & branchlist() const;
169 std::string inputenc;
171 std::string preamble;
175 std::string float_placement;
177 unsigned int columns;
179 LyXTextClass::PageSides sides;
181 std::string pagestyle;
182 /// \param index should lie in the range 0 <= \c index <= 3.
183 Bullet & temp_bullet(lyx::size_type index);
184 Bullet const & temp_bullet(lyx::size_type index) const;
185 /// \param index should lie in the range 0 <= \c index <= 3.
186 Bullet & user_defined_bullet(lyx::size_type index);
187 Bullet const & user_defined_bullet(lyx::size_type index) const;
189 void readPreamble(LyXLex &);
191 void readLanguage(LyXLex &);
193 void readGraphicsDriver(LyXLex &);
195 void readBullets(LyXLex &);
197 void readBulletsLaTeX(LyXLex &);
199 /// use AMS package, not, or auto
207 lyx::biblio::CiteEngine cite_engine;
210 /// revision tracking for this buffer ?
211 bool tracking_changes;
212 /** This param decides if change tracking marks should be output
213 * (using the dvipost package) or if the current "state" of the
214 * document should be output instead. Since dvipost needs dvi
215 * specials, it only works with dvi/ps output (the param will be
216 * ignored with other output flavors and disabled when dbipost is
220 /// Time ago we agreed that this was a buffer property [ale990407]
221 std::string parentname;
225 /// the author list for the document
226 AuthorList & authors();
227 AuthorList const & authors() const;
229 /// map of the file's author IDs to buffer author IDs
230 std::vector<int> author_map;
232 std::string const dvips_options() const;
234 std::string const paperSizeName() const;
236 std::string const babelCall(std::string const & lang_opts) const;
239 /** Use the Pimpl idiom to hide those member variables that would otherwise
240 * drag in other header files.
245 static Impl * clone(Impl const *);
246 static void destroy(Impl *);
248 lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;