]> git.lyx.org Git - lyx.git/blob - src/OutputParams.h
* cs.po
[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
29
30 class OutputParams {
31 public:
32         enum FLAVOR {
33                 LATEX,
34                 PDFLATEX,
35                 XML
36         };
37
38         OutputParams(Encoding const *);
39         ~OutputParams();
40
41         /** The latex that we export depends occasionally on what is to
42             compile the file.
43         */
44         FLAVOR flavor;
45
46         /** Are we to write a 'nice' LaTeX file or not.
47             This esentially seems to mean whether InsetInclude, InsetGraphics
48             and InsetExternal should add the absolute path to any external
49             files or not.
50         */
51         bool nice;
52
53         /** moving_arg == true means that the environment in which the inset
54             is typeset is a moving argument. The inset should take care about
55             fragile commands by preceding the latex with \\protect.
56         */
57         bool moving_arg;
58
59         /** intitle == true means that the environment in which the
60             inset is typeset is part of a title (before a \\maketitle).
61             Footnotes in such environments have moving arguments.
62         */
63         bool intitle;
64
65         /** the font at the point where the inset is
66          */
67         Font const * local_font;
68
69         /** Document language babel name
70          */
71         mutable std::string document_language;
72
73         /** Current stream encoding. Only used for LaTeX.
74             This must be set to the document encoding (via the constructor)
75             before output starts. Afterwards it must be kept up to date for
76             each single character (\sa Paragraph::latex).
77             This does also mean that you need to set it back if you use a
78             copy (e.g. in insets): \code
79             int InsetFoo::latex(..., OutputParams const & runparams_in) const
80             {
81                 OutputParams runparams(runparams_in);
82                 runparams.inComment = true;
83                 ...
84                 InsetBla::latex(..., runparams);
85                 ...
86                 runparams_in.encoding = runparams.encoding;
87             }
88             \endcode
89          */
90         mutable Encoding const * encoding;
91
92         /** free_spacing == true means that the inset is in a free-spacing
93             paragraph.
94         */
95         bool free_spacing;
96
97         /** This var is set by the return value from BufferParams::writeLaTeX
98         */
99         bool use_babel;
100
101         /** Are we using japanese (pLaTeX)?
102         */
103         bool use_japanese;
104
105         /** Line length to use with plaintext export.
106         */
107         size_type linelen;
108
109         /** The depth of the current paragraph, set for plaintext
110          *  export and used by InsetTabular
111          */
112         int depth;
113
114         /** Export data filled in by the latex(), docbook() etc methods.
115             This is a hack: Make it possible to add stuff to constant
116             OutputParams instances.
117         */
118         boost::shared_ptr<ExportData> exportdata;
119
120         /** Whether we are inside a comment inset. Insets that are including
121          *  external files like InsetGraphics, InsetInclude and InsetExternal
122          *  may only write the usual output and must not attempt to do
123          *  something with the included files (e.g. copying, converting)
124          *  if this flag is true, since they may not exist.
125          */
126         bool inComment;
127
128         /** Whether we are inside an inset that is logically deleted.
129          *  A value > 0 indicates a deleted inset.
130          */
131         int inDeletedInset;
132
133         /** The change information of the outermost logically deleted inset.
134          *  changeOfDeletedInset shall only be evaluated if inDeletedInset > 0.
135          */ 
136         Change changeOfDeletedInset;
137
138         /** allow output of only part of the top-level paragraphs
139          *  par_begin: beginning paragraph
140          */
141         pit_type par_begin;
142
143         /** allow output of only part of the top-level paragraphs
144          *  par_end: par_end-1 is the ending paragraph
145          *  if par_begin=par_end, output all paragraphs
146          */
147         pit_type par_end;
148
149         /** whether or not do actual file copying and image conversion
150          *  This mode will be used to preview the source code
151          */
152         bool dryrun;
153         /// Should we output verbatim or escape LaTeX's special chars?
154         bool verbatim;
155 };
156
157
158 } // namespace lyx
159
160 #endif // NOT OUTPUTPARAMS_H