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