]> git.lyx.org Git - lyx.git/blob - src/bufferparams.h
more compress support
[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 #include "author.h"
23 #include "paper.h"
24
25 #include "insets/insetquotes.h"
26
27 #include <boost/array.hpp>
28 #include <vector>
29
30 class LyXLex;
31 class LatexFeatures;
32 class TexRow;
33 struct Language;
34
35 /** Buffer parameters.
36    This class contains all the parameters for this a buffer uses. Some
37    work needs to be done on this class to make it nice. Now everything
38    is in public.
39 */
40 class BufferParams {
41 public:
42         ///
43         enum PARSEP {
44                 ///
45                 PARSEP_INDENT,
46                 ///
47                 PARSEP_SKIP
48         };
49         ///
50         BufferParams();
51
52         /// read a header token, if unrecognised, return it or an unknown class name
53         string const readToken(LyXLex & lex, string const & token);
54
55         ///
56         void writeFile(std::ostream &) const;
57
58         /** \returns true if the babel package is used (interogates
59             the BufferParams and a LyXRC variable).
60             This returned value can then be passed to the insets...
61          */
62         bool writeLaTeX(std::ostream &, LaTeXFeatures &, TexRow &) const;
63
64         ///
65         void setPaperStuff();
66
67         ///
68         void useClassDefaults();
69
70         ///
71         bool hasClassDefaults() const;
72
73         ///
74         VSpace const & getDefSkip() const { return defskip; }
75
76         ///
77         void setDefSkip(VSpace const & vs) { defskip = vs; }
78
79         /** Wether paragraphs are separated by using a indent like in
80           articles or by using a little skip like in letters.
81           */
82         PARSEP paragraph_separation;
83         ///
84         InsetQuotes::quote_language quotes_language;
85         ///
86         InsetQuotes::quote_times quotes_times;
87         ///
88         string fontsize;
89         ///
90         lyx::textclass_type textclass;
91         ///
92         LyXTextClass const & getLyXTextClass() const;
93
94         /* this are for the PaperLayout */
95         /// the general papersize (papersize2 or paperpackage
96         PAPER_SIZE papersize;
97         ///  the selected Geometry papersize
98         VMARGIN_PAPER_TYPE papersize2;
99         /// a special paperpackage .sty-file
100         PAPER_PACKAGES paperpackage;
101         ///
102         PAPER_ORIENTATION orientation;
103         ///
104         bool use_geometry;
105         ///
106         string paperwidth;
107         ///
108         string paperheight;
109         ///
110         string leftmargin;
111         ///
112         string topmargin;
113         ///
114         string rightmargin;
115         ///
116         string bottommargin;
117         ///
118         string headheight;
119         ///
120         string headsep;
121         ///
122         string footskip;
123
124         /* some LaTeX options */
125         /// The graphics driver
126         string graphicsDriver;
127         ///
128         string fonts;
129         ///
130         Spacing spacing;
131         ///
132         int secnumdepth;
133         ///
134         int tocdepth;
135         ///
136         Language const * language;
137         ///
138         string inputenc;
139         ///
140         string preamble;
141         ///
142         string options;
143         ///
144         string float_placement;
145         ///
146         unsigned int columns;
147         ///
148         LyXTextClass::PageSides sides;
149         ///
150         string pagestyle;
151         ///
152         boost::array<Bullet, 4> temp_bullets;
153         ///
154         boost::array<Bullet, 4> user_defined_bullets;
155         ///
156         void readPreamble(LyXLex &);
157         ///
158         void readLanguage(LyXLex &);
159         ///
160         void readGraphicsDriver(LyXLex &);
161
162         /// use AMS package, not, or auto
163         enum AMS {
164                 AMS_OFF,
165                 AMS_AUTO,
166                 AMS_ON
167         };
168         AMS use_amsmath;
169         ///
170         bool use_natbib;
171         ///
172         bool use_numerical_citations;
173         /// revision tracking for this buffer ?
174         bool tracking_changes;
175         /// Time ago we agreed that this was a buffer property [ale990407]
176         string parentname;
177         ///
178         bool compressed;
179
180         /// map of the file's author IDs to buffer author IDs
181         std::vector<int> author_map;
182         ///
183         string const dvips_options() const;
184         ///
185         string const paperSizeName() const;
186
187 private:
188         /// the author list
189         AuthorList authorlist;
190
191         ///
192         friend class Buffer;
193         /** This is the amount of space used for paragraph_separation "skip",
194           and for detached paragraphs in "indented" documents.
195         */
196         VSpace defskip;
197 };
198
199 #endif