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 "frontends/controllers/biblio.h"
25 #include "support/copied_ptr.h"
26 #include "support/types.h"
42 /** Buffer parameters.
43 * This class contains all the parameters for this a buffer uses. Some
44 * work needs to be done on this class to make it nice. Now everything
60 /// read a header token, if unrecognised, return it or an unknown class name
61 std::string const readToken(LyXLex & lex, std::string const & token);
64 void writeFile(std::ostream &) const;
66 /** \returns true if the babel package is used (interogates
67 * the BufferParams and a LyXRC variable).
68 * This returned value can then be passed to the insets...
70 bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
76 void useClassDefaults();
79 bool hasClassDefaults() const;
82 VSpace const & getDefSkip() const;
85 void setDefSkip(VSpace const & vs);
87 /** Wether paragraphs are separated by using a indent like in
88 * articles or by using a little skip like in letters.
90 PARSEP paragraph_separation;
92 InsetQuotes::quote_language quotes_language;
94 InsetQuotes::quote_times quotes_times;
98 lyx::textclass_type textclass;
100 LyXTextClass const & getLyXTextClass() const;
102 /* this are for the PaperLayout */
103 /// the general papersize (papersize2 or paperpackage
104 PAPER_SIZE papersize;
105 /// the selected Geometry papersize
106 VMARGIN_PAPER_TYPE papersize2;
107 /// a special paperpackage .sty-file
108 PAPER_PACKAGES paperpackage;
110 PAPER_ORIENTATION orientation;
114 std::string paperwidth;
116 std::string paperheight;
118 std::string leftmargin;
120 std::string topmargin;
122 std::string rightmargin;
124 std::string bottommargin;
126 std::string headheight;
130 std::string footskip;
132 /* some LaTeX options */
133 /// The graphics driver
134 std::string graphicsDriver;
139 Spacing const & spacing() const;
145 Language const * language;
147 BranchList & branchlist();
148 BranchList const & branchlist() const;
150 std::string inputenc;
152 std::string preamble;
156 std::string float_placement;
158 unsigned int columns;
160 LyXTextClass::PageSides sides;
162 std::string pagestyle;
163 /// \param index should lie in the range 0 <= \c index <= 3.
164 Bullet & temp_bullet(lyx::size_type index);
165 Bullet const & temp_bullet(lyx::size_type index) const;
166 /// \param index should lie in the range 0 <= \c index <= 3.
167 Bullet & user_defined_bullet(lyx::size_type index);
168 Bullet const & user_defined_bullet(lyx::size_type index) const;
170 void readPreamble(LyXLex &);
172 void readLanguage(LyXLex &);
174 void readGraphicsDriver(LyXLex &);
176 /// use AMS package, not, or auto
184 biblio::CiteEngine cite_engine;
187 /// revision tracking for this buffer ?
188 bool tracking_changes;
189 /// Time ago we agreed that this was a buffer property [ale990407]
190 std::string parentname;
194 /// the author list for the document
195 AuthorList & authors();
196 AuthorList const & authors() const;
198 /// map of the file's author IDs to buffer author IDs
199 std::vector<int> author_map;
201 std::string const dvips_options() const;
203 std::string const paperSizeName() const;
205 std::string const babelCall(std::string const & lang_opts) const;
208 /** Use the Pimpl idiom to hide those member variables that would otherwise
209 * drag in other header files.
212 struct MemoryTraits {
213 static Impl * clone(Impl const *);
214 static void destroy(Impl *);
216 lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;