]> git.lyx.org Git - lyx.git/blob - src/PDFOptions.h
Disable CheckTeX while buffer is processed
[lyx.git] / src / PDFOptions.h
1 // -*- C++ -*-
2 /**
3  * \file src/PDFOptions.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Pavel Sanda
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef PDFOPTIONS_H
13 #define PDFOPTIONS_H
14
15 #include "OutputParams.h"
16
17 #include "support/strfwd.h"
18
19 #include <string>
20
21 namespace lyx {
22
23 class Lexer;
24
25 // FIXME UNICODE
26 // Write functions need to use odostream instead of ostream before
27 // we can use docstring instead of string.
28
29 /// Options for PDF generation
30 class PDFOptions {
31 public:
32         ///
33         PDFOptions() { clear(); }
34         /// check whether user added any settings for hyperref
35         bool empty() const;
36         /// output to lyx header
37         void writeFile(std::ostream &) const;
38         /// output to tex header
39         void writeLaTeX(OutputParams &, otexstream &,
40                         bool hyperref_already_provided) const;
41         /// read tokens from lyx header
42         std::string readToken(Lexer &lex, std::string const & token);
43         /// set implicit settings for hyperref
44         void clear();
45
46         ///
47         bool use_hyperref;
48         ///
49         std::string title;
50         ///
51         std::string author;
52         ///
53         std::string subject;
54         ///
55         std::string keywords;
56         /**
57                 * A set of Acrobat bookmarks are written, in a manner similar to the
58                 * table of contents.
59                 * bookmarks         boolean true
60                 */
61         bool bookmarks;
62         /**
63                 * If Acrobat bookmarks are requested, include section numbers.
64                 * bookmarksnumbered    boolean false
65                 */
66         bool bookmarksnumbered;
67         /**
68                 * If Acrobat bookmarks are requested, show them with all the subtrees
69                 * expanded.
70                 * bookmarksopen     boolean false
71                 */
72         bool bookmarksopen;
73         /**
74                 * Level (\maxdimen) to which bookmarks are open
75                 * bookmarksopenlevel    parameter
76                 */
77         int bookmarksopenlevel;
78         /**
79                 * Allows link text to break across lines.
80                 * breaklinks        boolean false
81                 */
82         bool breaklinks;
83         /**
84                 * The style of box around links; defaults to a box with lines of 1pt
85                 * thickness, but the colorlinks option resets it to produce no border.
86                 * pdfborder              "0 0 1" / "0 0 0"
87                 * Note that the color of link borders can be specified only as 3
88                 * numbers in the range 0..1, giving an RGB color.
89                 * You cannot use colors defined in TEX.
90                 *
91                 * We represent here only the last bit, there is no semantics in the
92                 * first two. Morover the aim is not to represent the whole pdfborder,
93                 * but just to deny the ugly boxes around pdf links.
94                 */
95         bool pdfborder;
96         /**
97                 * colorlinks        boolean false
98                 */
99         bool colorlinks;
100         /**
101                 * Adds backlink text to the end of each item in the bibliography,
102                 * as a list of section/slide/page numbers.
103                 * This can only work properly if there is a blank line after each
104                 * \bibitem.
105                 * backref   string  empty(="section"), "false", "section", "slide", "page"
106                 *
107                 * Internally we use false/section/slide/pages. See also bug 5340.
108                 */
109         std::string backref;
110         /**
111                 * Determines how the file is opening in Acrobat;
112                 * the possibilities are None, UseThumbs (show thumbnails), UseOutlines
113                 * (show bookmarks), and FullScreen.
114                 * If no mode if explicitly chosen, but the bookmarks option is set,
115                 * UseOutlines is used.
116                 * pagemode          text    empty
117                 *
118                 * We currently implement only FullScreen, but all modes can be saved
119                 * here, lyx format & latex writer is prepared.
120                 * The only thing needed in such a case is wider Settings
121                 * dialog -> PDFOptions.pagemode .
122                 */
123         std::string pagemode;
124         /**
125                 * Flag indicating whether hyperref tries to derive the values for
126                 * pdftitle and pdfauthor from \title and \author.
127                 * pdfusetitle       boolean false
128                 *
129                 * Note that we use true as default value instead. The option is also
130                 * used in latex output only when title and author is not filled.
131         */
132         bool pdfusetitle;
133         ///latex string
134         static const std::string pagemode_fullscreen;
135         /**
136                 * Additional parameters for hyperref given from user.
137                 */
138         std::string quoted_options;
139         /**
140                 * Possible syntax check of users additional parameters here.
141                 * Returns repaired string. For the time being only newlines
142                 * are checked.
143                 */
144         std::string quoted_options_check(std::string const & str) const;
145 };
146
147 } // namespace lyx
148
149 #endif // PDFOPTIONS_H