]> git.lyx.org Git - lyx.git/blob - src/bufferparams.h
Store the citation engine in BufferParams as biblio::CiteEngine rather
[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 "frontends/controllers/biblio.h"
24
25 #include "support/copied_ptr.h"
26 #include "support/types.h"
27
28 #include <vector>
29
30
31 class AuthorList;
32 class BranchList;
33 class Bullet;
34 class LyXLex;
35 class LatexFeatures;
36 class Spacing;
37 class TexRow;
38 class VSpace;
39 struct Language;
40
41
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
45  *  is in public.
46  */
47 class BufferParams {
48 public:
49         ///
50         enum PARSEP {
51                 ///
52                 PARSEP_INDENT,
53                 ///
54                 PARSEP_SKIP
55         };
56         ///
57         BufferParams();
58         ~BufferParams();
59
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);
62
63         ///
64         void writeFile(std::ostream &) const;
65
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...
69          */
70         bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
71
72         ///
73         void setPaperStuff();
74
75         ///
76         void useClassDefaults();
77
78         ///
79         bool hasClassDefaults() const;
80
81         ///
82         VSpace const & getDefSkip() const;
83
84         ///
85         void setDefSkip(VSpace const & vs);
86
87         /** Wether paragraphs are separated by using a indent like in
88          *  articles or by using a little skip like in letters.
89          */
90         PARSEP paragraph_separation;
91         ///
92         InsetQuotes::quote_language quotes_language;
93         ///
94         InsetQuotes::quote_times quotes_times;
95         ///
96         std::string fontsize;
97         ///
98         lyx::textclass_type textclass;
99         ///
100         LyXTextClass const & getLyXTextClass() const;
101
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;
109         ///
110         PAPER_ORIENTATION orientation;
111         ///
112         bool use_geometry;
113         ///
114         std::string paperwidth;
115         ///
116         std::string paperheight;
117         ///
118         std::string leftmargin;
119         ///
120         std::string topmargin;
121         ///
122         std::string rightmargin;
123         ///
124         std::string bottommargin;
125         ///
126         std::string headheight;
127         ///
128         std::string headsep;
129         ///
130         std::string footskip;
131
132         /* some LaTeX options */
133         /// The graphics driver
134         std::string graphicsDriver;
135         ///
136         std::string fonts;
137         ///
138         Spacing & spacing();
139         Spacing const & spacing() const;
140         ///
141         int secnumdepth;
142         ///
143         int tocdepth;
144         ///
145         Language const * language;
146         /// BranchList:
147         BranchList & branchlist();
148         BranchList const & branchlist() const;
149         ///
150         std::string inputenc;
151         ///
152         std::string preamble;
153         ///
154         std::string options;
155         ///
156         std::string float_placement;
157         ///
158         unsigned int columns;
159         ///
160         LyXTextClass::PageSides sides;
161         ///
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;
169         ///
170         void readPreamble(LyXLex &);
171         ///
172         void readLanguage(LyXLex &);
173         ///
174         void readGraphicsDriver(LyXLex &);
175
176         /// use AMS package, not, or auto
177         enum AMS {
178                 AMS_OFF,
179                 AMS_AUTO,
180                 AMS_ON
181         };
182         AMS use_amsmath;
183         ///
184         biblio::CiteEngine cite_engine;
185         ///
186         bool use_bibtopic;
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;
191         ///
192         bool compressed;
193
194         /// the author list for the document
195         AuthorList & authors();
196         AuthorList const & authors() const;
197
198         /// map of the file's author IDs to buffer author IDs
199         std::vector<int> author_map;
200         ///
201         std::string const dvips_options() const;
202         ///
203         std::string const paperSizeName() const;
204         ///
205         std::string const babelCall(std::string const & lang_opts) const;
206
207 private:
208         /** Use the Pimpl idiom to hide those member variables that would otherwise
209          *  drag in other header files.
210          */
211         class Impl;
212         struct MemoryTraits {
213                 static Impl * clone(Impl const *);
214                 static void destroy(Impl *);
215         };
216         lyx::support::copied_ptr<Impl, MemoryTraits> pimpl_;
217 };
218
219 #endif