]> git.lyx.org Git - lyx.git/blob - src/bufferparams.h
aba829a75654d928adffdbe40a2a1a17787123ec
[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 /**
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         //@Man: Constructors and Deconstructors
105         //@{
106         ///
107         BufferParams();
108         //@}
109
110         ///
111         void writeFile(ostream &) const;
112
113         ///
114         void useClassDefaults();
115
116         ///
117         VSpace const & getDefSkip() const { return defskip; }
118
119         ///
120         void setDefSkip(VSpace const & vs) { defskip = vs; }
121
122         ///
123         LyXDirection getDocumentDirection() const;
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::ClassList::size_type textclass;
137
138         /* this are for the PaperLayout */
139         ///
140         char papersize; /* the general papersize (papersize2 or paperpackage */ // add approp. signedness
141         ///
142         char papersize2; /* the selected Geometry papersize */ // add approp. signedness
143         ///
144         char paperpackage; /* a special paperpackage .sty-file */ // 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         string 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         block<Bullet, 4> temp_bullets;
197         ///
198         block<Bullet, 4> user_defined_bullets;
199         ///
200         void readPreamble(LyXLex &);
201         ///
202         void readLanguage(LyXLex &);
203         ///
204         void readGraphicsDriver(LyXLex &);
205         /// do we allow accents on all chars in this buffer
206         bool allowAccents;
207         ///
208         bool use_amsmath;
209         /// Time ago we agreed that this was a buffer property [ale990407]
210         string parentname;
211 private:
212         ///
213         friend class Buffer;
214         /** This is the amount of space used for paragraph_separation "skip",
215           and for detached paragraphs in "indented" documents. */
216         VSpace defskip;
217 };
218
219 #endif