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