Consider the case where there is not any layout name.
[lyx.git] / src / PrinterParams.h
blobc31ec1a7418f41bc5d5296347db762050dd00402
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.
7 * \author Allan Rae
9 * Full author contact details are available in file CREDITS.
12 #ifndef PRINTERPARAMS_H
13 #define PRINTERPARAMS_H
15 #include "lyxrc.h"
17 /**
18 This class contains (or should contain) all the parameters required for
19 printing a buffer. Some work still needs to be done on this class and
20 printing handling in general to make it nice and full-featured.
21 The main things I'd like to add now is the ability to print a read-only
22 document with different orientation, papersize or single/duplex state
23 than the document's settings. ARRae 20000423
25 class PrinterParams {
26 public:
27 ///
28 enum Target {
29 ///
30 PRINTER,
31 ///
32 FILE
34 ///
35 Target target;
36 ///
37 std::string printer_name;
38 ///
39 std::string file_name;
40 ///
41 bool all_pages;
42 /** Print a page range. Both from_page and to_page used to be strings
43 because they're actually easier to work with that way. I've
44 switched to_page to be an int. However, from_page will remain a
45 string because I want the from_page field to be able to be used as
46 a page range "1,3-5" and so on.
47 I've modified the invariant test to match. ARRae 20000518
49 unsigned int from_page;
50 ///
51 unsigned int to_page;
52 ///
53 bool odd_pages;
54 ///
55 bool even_pages;
56 ///
57 unsigned int count_copies;
58 ///
59 bool sorted_copies;
60 ///
61 bool reverse_order;
62 // The settings below should allow us to print any read-only doc in
63 // whatever size/orientation we want it -- overriding the documents
64 // settings.
65 // Override the documents orientation
66 // bool orientation;
67 // Print n pages per physical sheet
68 // unsigned int nup;
69 // Override document settings for duplex.
70 // bool duplex;
72 /** Test that all the fields contain valid entries. It's unlikely
73 that the internal code will get this wrong (at least for the
74 xforms code anyway) however new ports and external scripts
75 might drive the wrong values in.
77 void testInvariant() const;
78 ///
79 PrinterParams(Target t = PRINTER,
80 std::string const & pname = lyxrc.printer,
81 std::string const & fname = std::string(),
82 bool all = true,
83 unsigned int from = 1,
84 unsigned int to = 0,
85 bool odd = true,
86 bool even = true,
87 unsigned int copies = 1,
88 bool sorted = false,
89 bool reverse = false);
90 ///
91 PrinterParams(PrinterParams const & pp);
94 #endif