]> git.lyx.org Git - lyx.git/blob - src/OutputParams.h
Allow the suppression of LyX's own labels.
[lyx.git] / src / OutputParams.h
1 // -*- C++ -*-
2 /**
3  * \file OutputParams.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  *  \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef OUTPUTPARAMS_H
13 #define OUTPUTPARAMS_H
14
15 #include <string>
16
17 #include "support/types.h"
18 #include <boost/shared_ptr.hpp>
19 #include "Changes.h"
20
21
22 namespace lyx {
23
24
25 class Encoding;
26 class ExportData;
27 class Font;
28 class Language;
29
30
31 class OutputParams {
32 public:
33         enum FLAVOR {
34                 LATEX,
35                 PDFLATEX,
36                 XETEX,
37                 XML,
38                 HTML
39         };
40
41         enum TableCell {
42                 NO,
43                 PLAIN,
44                 ALIGNED
45         };
46
47         enum Float {
48                 NONFLOAT,
49                 MAINFLOAT,
50                 SUBFLOAT
51         };
52
53         OutputParams(Encoding const *);
54         ~OutputParams();
55
56         /** The latex that we export depends occasionally on what is to
57             compile the file.
58         */
59         FLAVOR flavor;
60
61         /** Are we to write a 'nice' LaTeX file or not.
62             This esentially seems to mean whether InsetInclude, InsetGraphics
63             and InsetExternal should add the absolute path to any external
64             files or not.
65         */
66         bool nice;
67
68         /** moving_arg == true means that the environment in which the inset
69             is typeset is a moving argument. The inset should take care about
70             fragile commands by preceding the latex with \\protect.
71         */
72         bool moving_arg;
73
74         /** intitle == true means that the environment in which the
75             inset is typeset is part of a title (before a \\maketitle).
76             Footnotes in such environments have moving arguments.
77         */
78         bool intitle;
79
80         /** inulemcmd == true means that the environment in which the
81             inset is typeset is part of a ulem command (\uline, \uuline,
82             \uwave, or \sout). Insets that output latex commands relying
83             on local assignments (such as \cite) should enclose such
84             commands in \mbox{} in order to avoid breakage.
85         */
86         mutable bool inulemcmd;
87
88         /** the font at the point where the inset is
89          */
90         Font const * local_font;
91
92         /** Document language babel name
93          */
94         mutable std::string document_language;
95
96         /** The master language. Non-null only for child documents.
97          */
98         mutable Language const * master_language;
99
100         /** Current stream encoding. Only used for LaTeX.
101             This must be set to the document encoding (via the constructor)
102             before output starts. Afterwards it must be kept up to date for
103             each single character (\sa Paragraph::latex).
104             This does also mean that you need to set it back if you use a
105             copy (e.g. in insets): \code
106             int InsetFoo::latex(..., OutputParams const & runparams_in) const
107             {
108                 OutputParams runparams(runparams_in);
109                 runparams.inComment = true;
110                 ...
111                 InsetBla::latex(..., runparams);
112                 ...
113                 runparams_in.encoding = runparams.encoding;
114             }
115             \endcode
116          */
117         mutable Encoding const * encoding;
118
119         /** free_spacing == true means that the inset is in a free-spacing
120             paragraph.
121         */
122         bool free_spacing;
123
124         /** This var is set by the return value from BufferParams::writeLaTeX
125         */
126         bool use_babel;
127
128         /** Are we generating multiple indices?
129         */
130         bool use_indices;
131
132         /** Are we using japanese (pLaTeX)?
133         */
134         bool use_japanese;
135
136         /** Customized bibtex_command
137         */
138         mutable std::string bibtex_command;
139
140         /** Customized index_command
141         */
142         mutable std::string index_command;
143
144         /** Line length to use with plaintext or LaTeX export.
145         */
146         size_type linelen;
147
148         /** The depth of the current paragraph, set for plaintext
149          *  export and used by InsetTabular
150          */
151         int depth;
152
153         /** Export data filled in by the latex(), docbook() etc methods.
154             This is a hack: Make it possible to add stuff to constant
155             OutputParams instances.
156         */
157         boost::shared_ptr<ExportData> exportdata;
158
159         /** Whether we are inside a comment inset. Insets that are including
160          *  external files like InsetGraphics, InsetInclude and InsetExternal
161          *  may only write the usual output and must not attempt to do
162          *  something with the included files (e.g. copying, converting)
163          *  if this flag is true, since they may not exist.
164          */
165         bool inComment;
166
167         /** Whether we are in a table cell.
168          *  For newline, it matters whether its content is aligned or not.
169          */
170         TableCell inTableCell;
171
172         /** Whether we are inside a float or subfloat.
173          *  Needed for subfloat detection on the command line.
174          */
175         Float inFloat;
176
177         /** Whether we are inside an index inset.
178          *  ERT needs to know this, due to the active chars.
179          */
180         bool inIndexEntry;
181
182         /** Whether we are inside an inset that is logically deleted.
183          *  A value > 0 indicates a deleted inset.
184          */
185         int inDeletedInset;
186
187         /** The change information of the outermost logically deleted inset.
188          *  changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
189          */ 
190         Change changeOfDeletedInset;
191
192         /** allow output of only part of the top-level paragraphs
193          *  par_begin: beginning paragraph
194          */
195         pit_type par_begin;
196
197         /** allow output of only part of the top-level paragraphs
198          *  par_end: par_end-1 is the ending paragraph
199          *  if par_begin=par_end, output all paragraphs
200          */
201         pit_type par_end;
202
203         /// is this the last paragraph in the current buffer/inset?
204         bool isLastPar;
205
206         /** whether or not do actual file copying and image conversion
207          *  This mode will be used to preview the source code
208          */
209         bool dryrun;
210         /// Should we output verbatim or escape LaTeX's special chars?
211         bool verbatim;
212         /// Should we output captions? (Used in HTML output.)
213         bool disable_captions;
214 };
215
216
217 } // namespace lyx
218
219 #endif // NOT OUTPUTPARAMS_H