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