]> git.lyx.org Git - lyx.git/blob - src/PrinterParams.h
Fix #10778 (issue with CJK and language nesting)
[lyx.git] / src / PrinterParams.h
1 // -*- C++ -*-
2 /**
3  * \file PrinterParams.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Allan Rae
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef PRINTERPARAMS_H
13 #define PRINTERPARAMS_H
14
15 #include <string>
16
17
18 namespace lyx {
19
20 /**
21   This class contains (or should contain) all the parameters required for
22   printing a buffer.  Some work still needs to be done on this class and
23   printing handling in general to make it nice and full-featured.
24   The main things I'd like to add now is the ability to print a read-only
25   document with different orientation, papersize or single/duplex state
26   than the document's settings. ARRae 20000423
27 */
28 class PrinterParams
29 {
30 public:
31         ///
32         PrinterParams();
33
34         ///
35         enum Target {
36                 ///
37                 PRINTER,
38                 ///
39                 FILE
40         };
41
42         /** Test that all the fields contain valid entries.  It's unlikely
43             that the internal code will get this wrong however new ports
44             and external scripts might drive the wrong values in.
45          */
46         void testInvariant() const;
47
48 public:
49         ///
50         Target target;
51         ///
52         std::string printer_name;
53         ///
54         std::string file_name;
55         ///
56         bool all_pages;
57         /** Print a page range. Both from_page and to_page used to be strings
58             because they're actually easier to work with that way.  I've
59             switched to_page to be an int.  However, from_page will remain a
60             string because I want the from_page field to be able to be used as
61             a page range "1,3-5" and so on.
62             I've modified the invariant test to match. ARRae 20000518
63          */
64         unsigned int from_page;
65         ///
66         unsigned int to_page;
67         ///
68         bool odd_pages;
69         ///
70         bool even_pages;
71         ///
72         unsigned int count_copies;
73         ///
74         bool sorted_copies;
75         ///
76         bool reverse_order;
77         // The settings below should allow us to print any read-only doc in
78         // whatever size/orientation we want it -- overriding the documents
79         // settings.
80         // Override the documents orientation
81         // bool orientation;
82         // Print n pages per physical sheet
83         // unsigned int nup;
84         // Override document settings for duplex.
85         // bool duplex;
86
87 };
88
89
90 } // namespace lyx
91
92 #endif