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