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