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