]> git.lyx.org Git - lyx.git/blob - src/bufferparams.h
Remove all unnecessary #includes from header files.
[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 "author.h"
19 #include "BranchList.h"
20 #include "Bullet.h"
21 #include "lyxtextclass.h"
22 #include "paper.h"
23 #include "Spacing.h"
24 #include "vspace.h"
25
26 #include "insets/insetquotes.h"
27
28 #include "support/types.h"
29
30 #include <boost/array.hpp>
31
32 #include "support/std_string.h"
33 #include <vector>
34
35 class LyXLex;
36 class LatexFeatures;
37 class TexRow;
38 struct Language;
39
40 /** Buffer parameters.
41    This class contains all the parameters for this a buffer uses. Some
42    work needs to be done on this class to make it nice. Now everything
43    is in public.
44 */
45 class BufferParams {
46 public:
47         ///
48         enum PARSEP {
49                 ///
50                 PARSEP_INDENT,
51                 ///
52                 PARSEP_SKIP
53         };
54         ///
55         BufferParams();
56
57         /// read a header token, if unrecognised, return it or an unknown class name
58         string const readToken(LyXLex & lex, string const & token);
59
60         ///
61         void writeFile(std::ostream &) const;
62
63         /** \returns true if the babel package is used (interogates
64             the BufferParams and a LyXRC variable).
65             This returned value can then be passed to the insets...
66          */
67         bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
68
69         ///
70         void setPaperStuff();
71
72         ///
73         void useClassDefaults();
74
75         ///
76         bool hasClassDefaults() const;
77
78         ///
79         VSpace const & getDefSkip() const { return defskip; }
80
81         ///
82         void setDefSkip(VSpace const & vs) { defskip = vs; }
83
84         /** Wether paragraphs are separated by using a indent like in
85           articles or by using a little skip like in letters.
86           */
87         PARSEP paragraph_separation;
88         ///
89         InsetQuotes::quote_language quotes_language;
90         ///
91         InsetQuotes::quote_times quotes_times;
92         ///
93         string fontsize;
94         ///
95         lyx::textclass_type textclass;
96         ///
97         LyXTextClass const & getLyXTextClass() const;
98
99         /* this are for the PaperLayout */
100         /// the general papersize (papersize2 or paperpackage
101         PAPER_SIZE papersize;
102         ///  the selected Geometry papersize
103         VMARGIN_PAPER_TYPE papersize2;
104         /// a special paperpackage .sty-file
105         PAPER_PACKAGES paperpackage;
106         ///
107         PAPER_ORIENTATION orientation;
108         ///
109         bool use_geometry;
110         ///
111         string paperwidth;
112         ///
113         string paperheight;
114         ///
115         string leftmargin;
116         ///
117         string topmargin;
118         ///
119         string rightmargin;
120         ///
121         string bottommargin;
122         ///
123         string headheight;
124         ///
125         string headsep;
126         ///
127         string footskip;
128
129         /* some LaTeX options */
130         /// The graphics driver
131         string graphicsDriver;
132         ///
133         string fonts;
134         ///
135         Spacing spacing;
136         ///
137         int secnumdepth;
138         ///
139         int tocdepth;
140         ///
141         Language const * language;
142         /// BranchList:
143         BranchList branchlist;
144         ///
145         string inputenc;
146         ///
147         string preamble;
148         ///
149         string options;
150         ///
151         string float_placement;
152         ///
153         unsigned int columns;
154         ///
155         LyXTextClass::PageSides sides;
156         ///
157         string pagestyle;
158         ///
159         boost::array<Bullet, 4> temp_bullets;
160         ///
161         boost::array<Bullet, 4> user_defined_bullets;
162         ///
163         void readPreamble(LyXLex &);
164         ///
165         void readLanguage(LyXLex &);
166         ///
167         void readGraphicsDriver(LyXLex &);
168
169         /// use AMS package, not, or auto
170         enum AMS {
171                 AMS_OFF,
172                 AMS_AUTO,
173                 AMS_ON
174         };
175         AMS use_amsmath;
176         ///
177         bool use_natbib;
178         ///
179         bool use_numerical_citations;
180         /// revision tracking for this buffer ?
181         bool tracking_changes;
182         /// Time ago we agreed that this was a buffer property [ale990407]
183         string parentname;
184         ///
185         bool compressed;
186
187         /// map of the file's author IDs to buffer author IDs
188         std::vector<int> author_map;
189         ///
190         string const dvips_options() const;
191         ///
192         string const paperSizeName() const;
193
194 private:
195         /// the author list
196         AuthorList authorlist;
197
198         ///
199         friend class Buffer;
200         /** This is the amount of space used for paragraph_separation "skip",
201           and for detached paragraphs in "indented" documents.
202         */
203         VSpace defskip;
204 };
205
206 #endif