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