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