]> git.lyx.org Git - lyx.git/blobdiff - src/PDFOptions.h
Account for old versions of Pygments
[lyx.git] / src / PDFOptions.h
index 84580f23e14e5289f28b88a751435b211f68e909..d74caf430e638c65cd353970b6bdc0f2554113df 100644 (file)
 #ifndef PDFOPTIONS_H
 #define PDFOPTIONS_H
 
-#include "support/docstream.h"
+#include "OutputParams.h"
+
+#include "support/strfwd.h"
+
+#include <string>
 
 namespace lyx {
 
 class Lexer;
 
-/// Options for PDF generation
-
-/*
-  Possible cleanups, left for next fileformat change:
-  
-  - bookmarksopenlevel is stored in .lyx as string; 
-    after change to spinbox it would be appropriate
-    change to int.
-  - store_options flag can be completely replaced by
-    function store_options() doing essentialy the same
-    as empty() now.
-*/
+// FIXME UNICODE
+// Write functions need to use odostream instead of ostream before
+// we can use docstring instead of string.
 
+/// Options for PDF generation
 class PDFOptions {
 public:
        ///
@@ -40,10 +36,11 @@ public:
        /// output to lyx header
        void writeFile(std::ostream &) const;
        /// output to tex header
-       void writeLaTeX(odocstringstream &) const;
+       void writeLaTeX(OutputParams &, otexstream &,
+                       bool hyperref_already_provided) const;
        /// read tokens from lyx header
        std::string readToken(Lexer &lex, std::string const & token);
-       /// keep implicit hyperref settings
+       /// set implicit settings for hyperref
        void clear();
 
        ///
@@ -102,18 +99,14 @@ public:
        bool colorlinks;
        /**
                * Adds backlink text to the end of each item in the bibliography,
-               * as a list of section numbers.
+               * as a list of section/slide/page numbers.
                * This can only work properly if there is a blank line after each
                * \bibitem.
-               * backref        boolean false
-               */
-       bool backref;
-       /**
-               * Adds backlink text to the end of each item in the bibliography,
-               * as a list of page numbers.
-               * pagebackref       boolean false
+               * backref   string  empty(="section"), "false", "section", "slide", "page"
+               *
+               * Internally we use false/section/slide/pages. See also bug 5340.
                */
-       bool pagebackref;
+       std::string backref;
        /**
                * Determines how the file is opening in Acrobat;
                * the possibilities are None, UseThumbs (show thumbnails), UseOutlines
@@ -128,6 +121,15 @@ public:
                * dialog -> PDFOptions.pagemode .
                */
        std::string pagemode;
+       /**
+               * Flag indicating whether hyperref tries to derive the values for
+               * pdftitle and pdfauthor from \title and \author.
+               * pdfusetitle       boolean false
+               *
+               * Note that we use true as default value instead. The option is also
+               * used in latex output only when title and author is not filled.
+       */
+       bool pdfusetitle;
        ///latex string
        static const std::string pagemode_fullscreen;
        /**
@@ -136,16 +138,10 @@ public:
        std::string quoted_options;
        /**
                * Possible syntax check of users additional parameters here.
+               * Returns repaired string. For the time being only newlines
+               * are checked.
                */
-       std::string quoted_options_get() const;
-       
-       
-       /**
-               * Flag indicating whether user made some input into PDF preferences.
-               * We want to save options, when user decide to switch off PDF support
-               * for a while.
-               */
-       bool store_options;
+       std::string quoted_options_check(std::string const & str) const;
 };
 
 } // namespace lyx