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