]> git.lyx.org Git - lyx.git/blob - src/bufferparams.h
- Link against qt-mt333.lib which is what the current qt3 cvs produces
[lyx.git] / src / bufferparams.h
1 // -*- C++ -*-
2 /**
3  * \file bufferparams.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  * \author John Levon
10  * \author André Pönitz
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef BUFFERPARAMS_H
16 #define BUFFERPARAMS_H
17
18 #include "lyxtextclass.h"
19 #include "paper.h"
20
21 #include "insets/insetquotes.h"
22
23 #include "support/copied_ptr.h"
24 #include "support/types.h"
25
26 #include <vector>
27
28
29 class AuthorList;
30 class BranchList;
31 class Bullet;
32 class LyXLex;
33 class LatexFeatures;
34 class Spacing;
35 class TexRow;
36 class VSpace;
37 class Language;
38
39
40 namespace lyx {
41 namespace biblio {
42
43 enum CiteEngine {
44         ENGINE_BASIC,
45         ENGINE_NATBIB_AUTHORYEAR,
46         ENGINE_NATBIB_NUMERICAL,
47         ENGINE_JURABIB
48 };
49
50 class CiteEngine_enum {
51         CiteEngine val_;
52 public:
53         CiteEngine_enum(CiteEngine val) : val_(val) {}
54         operator CiteEngine() const{ return val_; }
55 };
56
57 } // namespace biblio
58 } // namespace lyx
59
60
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
64  *  is in public.
65  */
66 class BufferParams {
67 public:
68         ///
69         enum PARSEP {
70                 ///
71                 PARSEP_INDENT,
72                 ///
73                 PARSEP_SKIP
74         };
75         ///
76         BufferParams();
77         ~BufferParams();
78
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);
81
82         ///
83         void writeFile(std::ostream &) const;
84
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...
88          */
89         bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
90
91         ///
92         void setPaperStuff();
93
94         ///
95         void useClassDefaults();
96
97         ///
98         bool hasClassDefaults() const;
99
100         ///
101         VSpace const & getDefSkip() const;
102
103         ///
104         void setDefSkip(VSpace const & vs);
105
106         /** Wether paragraphs are separated by using a indent like in
107          *  articles or by using a little skip like in letters.
108          */
109         PARSEP paragraph_separation;
110         ///
111         InsetQuotes::quote_language quotes_language;
112         ///
113         InsetQuotes::quote_times quotes_times;
114         ///
115         std::string fontsize;
116         ///
117         lyx::textclass_type textclass;
118         ///
119         LyXTextClass const & getLyXTextClass() const;
120
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;
128         ///
129         PAPER_ORIENTATION orientation;
130         ///
131         bool use_geometry;
132         ///
133         std::string paperwidth;
134         ///
135         std::string paperheight;
136         ///
137         std::string leftmargin;
138         ///
139         std::string topmargin;
140         ///
141         std::string rightmargin;
142         ///
143         std::string bottommargin;
144         ///
145         std::string headheight;
146         ///
147         std::string headsep;
148         ///
149         std::string footskip;
150
151         /* some LaTeX options */
152         /// The graphics driver
153         std::string graphicsDriver;
154         ///
155         std::string fonts;
156         ///
157         Spacing & spacing();
158         Spacing const & spacing() const;
159         ///
160         int secnumdepth;
161         ///
162         int tocdepth;
163         ///
164         Language const * language;
165         /// BranchList:
166         BranchList & branchlist();
167         BranchList const & branchlist() const;
168         ///
169         std::string inputenc;
170         ///
171         std::string preamble;
172         ///
173         std::string options;
174         ///
175         std::string float_placement;
176         ///
177         unsigned int columns;
178         ///
179         LyXTextClass::PageSides sides;
180         ///
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;
188         ///
189         void readPreamble(LyXLex &);
190         ///
191         void readLanguage(LyXLex &);
192         ///
193         void readGraphicsDriver(LyXLex &);
194         ///
195         void readBullets(LyXLex &);
196         ///
197         void readBulletsLaTeX(LyXLex &);
198
199         /// use AMS package, not, or auto
200         enum AMS {
201                 AMS_OFF,
202                 AMS_AUTO,
203                 AMS_ON
204         };
205         AMS use_amsmath;
206         ///
207         lyx::biblio::CiteEngine cite_engine;
208         ///
209         bool use_bibtopic;
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 
217          *  not installed).
218          */
219         bool output_changes;
220         /// Time ago we agreed that this was a buffer property [ale990407]
221         std::string parentname;
222         ///
223         bool compressed;
224
225         /// the author list for the document
226         AuthorList & authors();
227         AuthorList const & authors() const;
228
229         /// map of the file's author IDs to buffer author IDs
230         std::vector<int> author_map;
231         ///
232         std::string const dvips_options() const;
233         ///
234         std::string const paperSizeName() const;
235         ///
236         std::string const babelCall(std::string const & lang_opts) const;
237
238 private:
239         /** Use the Pimpl idiom to hide those member variables that would otherwise
240          *  drag in other header files.
241          */
242         class Impl;
243         class MemoryTraits {
244         public:
245                 static Impl * clone(Impl const *);
246                 static void destroy(Impl *);
247         };
248         lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;
249 };
250
251 #endif