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