]> git.lyx.org Git - lyx.git/blob - src/bufferparams.h
002b9b2d18f3538257db94ec4208a20991d83aff
[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-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef BUFFERPARAMS_H
13 #define BUFFERPARAMS_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "LString.h"
20 #include "lyxlex.h"
21 #include "vspace.h"
22 #include "Spacing.h"
23 #include "Bullet.h"
24 #include "insets/insetquotes.h"
25 #include "layout.h"
26 #include "support/block.h"
27
28 using std::ostream;
29
30 /**
31   This class contains all the parameters for this a buffer uses. Some
32   work needs to be done on this class to make it nice. Now everything
33   is in public.
34   */
35
36 struct Language;
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         //@Man: Constructors and Deconstructors
110         //@{
111         ///
112         BufferParams();
113         //@}
114
115         ///
116         void writeFile(ostream &) const;
117
118         ///
119         void useClassDefaults();
120
121         ///
122         VSpace const & getDefSkip() const { return defskip; }
123
124         ///
125         void setDefSkip(VSpace const & vs) { defskip = vs; }
126
127         /** Wether paragraphs are separated by using a indent like in
128           articles or by using a little skip like in letters.
129           */
130         PARSEP paragraph_separation;
131         ///
132         InsetQuotes::quote_language quotes_language;
133         ///
134         InsetQuotes::quote_times quotes_times;
135         ///
136         string fontsize; 
137         ///
138         LyXTextClassList::ClassList::size_type textclass;
139
140         /* this are for the PaperLayout */
141         ///
142         char papersize; /* the general papersize (papersize2 or paperpackage */ // add approp. signedness
143         ///
144         char papersize2; /* the selected Geometry papersize */ // add approp. signedness
145         ///
146         char paperpackage; /* a special paperpackage .sty-file */ // 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         string language;
183         ///
184         Language const * language_info;
185         ///
186         string inputenc;
187         ///
188         string preamble;
189         ///
190         string options;
191         ///
192         string float_placement;
193         ///
194         unsigned int columns;
195         ///
196         LyXTextClass::PageSides sides;
197         ///
198         string pagestyle;
199         ///
200         block<Bullet, 4> temp_bullets;
201         ///
202         block<Bullet, 4> user_defined_bullets;
203         ///
204         void readPreamble(LyXLex &);
205         ///
206         void readLanguage(LyXLex &);
207         ///
208         void readGraphicsDriver(LyXLex &);
209         /// do we allow accents on all chars in this buffer
210         bool allowAccents;
211         ///
212         bool use_amsmath;
213         /// Time ago we agreed that this was a buffer property [ale990407]
214         string parentname;
215 private:
216         ///
217         friend class Buffer;
218         /** This is the amount of space used for paragraph_separation "skip",
219           and for detached paragraphs in "indented" documents. */
220         VSpace defskip;
221 };
222
223 #endif