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