]> git.lyx.org Git - lyx.git/blob - src/bufferparams.h
"Inter-word Space"
[lyx.git] / src / bufferparams.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2001 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef BUFFERPARAMS_H
13 #define BUFFERPARAMS_H
14
15 #include "LString.h"
16 #include "vspace.h"
17 #include "Spacing.h"
18 #include "Bullet.h"
19 #include "lyxtextclass.h"
20 #include "LaTeXFeatures.h"
21 #include "texrow.h"
22 #include "author.h"
23
24 #include "insets/insetquotes.h"
25
26 #include <boost/array.hpp>
27 #include <vector>
28
29 class LyXLex;
30 class LatexFeatures;
31 class TexRow;
32 struct Language;
33
34 /** Buffer parameters.
35    This class contains all the parameters for this a buffer uses. Some
36    work needs to be done on this class to make it nice. Now everything
37    is in public.
38 */
39 class BufferParams {
40 public:
41         ///
42         enum PAPER_SIZE {
43                 ///
44                 PAPER_DEFAULT,
45                 ///
46                 PAPER_USLETTER,
47                 ///
48                 PAPER_LEGALPAPER,
49                 ///
50                 PAPER_EXECUTIVEPAPER,
51                 ///
52                 PAPER_A3PAPER,
53                 ///
54                 PAPER_A4PAPER,
55                 ///
56                 PAPER_A5PAPER,
57                 ///
58                 PAPER_B5PAPER
59         };
60         ///
61         enum PAPER_PACKAGES {
62                 ///
63                 PACKAGE_NONE,
64                 ///
65                 PACKAGE_A4,
66                 ///
67                 PACKAGE_A4WIDE,
68                 ///
69                 PACKAGE_WIDEMARGINSA4
70         };
71         ///
72         enum VMARGIN_PAPER_TYPE {
73                 ///
74                 VM_PAPER_DEFAULT,
75                 ///
76                 VM_PAPER_CUSTOM,
77                 ///
78                 VM_PAPER_USLETTER,
79                 ///
80                 VM_PAPER_USLEGAL,
81                 ///
82                 VM_PAPER_USEXECUTIVE,
83                 ///
84                 VM_PAPER_A3,
85                 ///
86                 VM_PAPER_A4,
87                 ///
88                 VM_PAPER_A5,
89                 ///
90                 VM_PAPER_B3,
91                 ///
92                 VM_PAPER_B4,
93                 ///
94                 VM_PAPER_B5
95         };
96         ///
97         enum PARSEP {
98                 ///
99                 PARSEP_INDENT,
100                 ///
101                 PARSEP_SKIP
102         };
103         ///
104         enum PAPER_ORIENTATION {
105                 ///
106                 ORIENTATION_PORTRAIT,
107                 ///
108                 ORIENTATION_LANDSCAPE
109         };
110         ///
111         BufferParams();
112
113         /// read a header token, if unrecognised, return it or an unknown class name
114         string const readToken(LyXLex & lex, string const & token);
115
116         ///
117         void writeFile(std::ostream &) const;
118
119         /** \returns true if the babel package is used (interogates
120             the BufferParams and a LyXRC variable).
121             This returned value can then be passed to the insets...
122          */
123         bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
124
125         ///
126         void setPaperStuff();
127
128         ///
129         void useClassDefaults();
130
131         ///
132         bool hasClassDefaults() const;
133
134         ///
135         VSpace const & getDefSkip() const { return defskip; }
136
137         ///
138         void setDefSkip(VSpace const & vs) { defskip = vs; }
139
140         /** Wether paragraphs are separated by using a indent like in
141           articles or by using a little skip like in letters.
142           */
143         PARSEP paragraph_separation;
144         ///
145         InsetQuotes::quote_language quotes_language;
146         ///
147         InsetQuotes::quote_times quotes_times;
148         ///
149         string fontsize;
150         ///
151         lyx::textclass_type textclass;
152         ///
153         LyXTextClass const & getLyXTextClass() const;
154
155         /* this are for the PaperLayout */
156         /// the general papersize (papersize2 or paperpackage
157         char papersize; // add apprip. signedness
158         ///  the selected Geometry papersize
159         char papersize2; // add approp. signedness
160         /// a special paperpackage .sty-file
161         char paperpackage; // add approp. signedness
162         ///
163         PAPER_ORIENTATION orientation; // add approp. signedness
164         ///
165         bool use_geometry;
166         ///
167         string paperwidth;
168         ///
169         string paperheight;
170         ///
171         string leftmargin;
172         ///
173         string topmargin;
174         ///
175         string rightmargin;
176         ///
177         string bottommargin;
178         ///
179         string headheight;
180         ///
181         string headsep;
182         ///
183         string footskip;
184
185         /* some LaTeX options */
186         /// The graphics driver
187         string graphicsDriver;
188         ///
189         string fonts;
190         ///
191         Spacing spacing;
192         ///
193         int secnumdepth;
194         ///
195         int tocdepth;
196         ///
197         Language const * language;
198         ///
199         string inputenc;
200         ///
201         string preamble;
202         ///
203         string options;
204         ///
205         string float_placement;
206         ///
207         unsigned int columns;
208         ///
209         LyXTextClass::PageSides sides;
210         ///
211         string pagestyle;
212         ///
213         boost::array<Bullet, 4> temp_bullets;
214         ///
215         boost::array<Bullet, 4> user_defined_bullets;
216         ///
217         void readPreamble(LyXLex &);
218         ///
219         void readLanguage(LyXLex &);
220         ///
221         void readGraphicsDriver(LyXLex &);
222
223         /// use AMS package, not, or auto
224         enum AMS {
225                 AMS_OFF,
226                 AMS_AUTO,
227                 AMS_ON
228         };
229         AMS use_amsmath;
230         ///
231         bool use_natbib;
232         ///
233         bool use_numerical_citations;
234         /// revision tracking for this buffer ?
235         bool tracking_changes;
236         /// Time ago we agreed that this was a buffer property [ale990407]
237         string parentname;
238
239         /// map of the file's author IDs to buffer author IDs
240         std::vector<int> author_map;
241
242 private:
243         /// the author list
244         AuthorList authorlist;
245
246         ///
247         friend class Buffer;
248         /** This is the amount of space used for paragraph_separation "skip",
249           and for detached paragraphs in "indented" documents.
250         */
251         VSpace defskip;
252 };
253
254 #endif