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