3 * \file PrinterParams.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef PRINTERPARAMS_H
13 #define PRINTERPARAMS_H
17 #ifdef ENABLE_ASSERTIONS
18 #include "support/lstrings.h"
19 #include "support/LAssert.h"
24 This struct contains (or should contain) all the parameters required for
25 printing a buffer. Some work still needs to be done on this struct and
26 printing handling in general to make it nice and full-featured.
27 The main things I'd like to add now is the ability to print a read-only
28 document with different orientation, papersize or single/duplex state
29 than the document's settings. ARRae 20000423
31 struct PrinterParams {
47 /** Print a page range. Both from_page and to_page used to be strings
48 because they're actually easier to work with that way. I've
49 switched to_page to be an int. However, from_page will remain a
50 string because I want the from_page field to be able to be used as
51 a page range "1,3-5" and so on.
52 I've modified the invariant test to match. ARRae 20000518
54 unsigned int from_page;
62 unsigned int count_copies;
67 // The settings below should allow us to print any read-only doc in
68 // whatever size/orientation we want it -- overriding the documents
70 // Override the documents orientation
72 // Print n pages per physical sheet
74 // Override document settings for duplex.
77 /** Test that all the fields contain valid entries. It's unlikely
78 that the internal code will get this wrong (at least for the
79 xforms code anyway) however new ports and external scripts
80 might drive the wrong values in.
82 void testInvariant() const
84 #ifdef ENABLE_ASSERTIONS
87 //lyx::support::Assert(!printer_name.empty());
90 lyx::support::Assert(!file_name.empty());
93 lyx::support::Assert(false);
100 PrinterParams(Target const & t = PRINTER,
101 string const & pname = lyxrc.printer,
102 string const & fname = string(),
103 bool const all = true,
104 unsigned int const & from = 1,
105 unsigned int const & to = 0,
106 bool const odd = true,
107 bool const even = true,
108 unsigned int const & copies = 1,
109 bool const sorted = false,
110 bool const reverse = false)
119 count_copies(copies),
120 sorted_copies(sorted),
121 reverse_order(reverse)
126 PrinterParams(PrinterParams const & pp)
128 printer_name(pp.printer_name),
129 file_name(pp.file_name),
130 all_pages(pp.all_pages),
131 from_page(pp.from_page),
133 odd_pages(pp.odd_pages),
134 even_pages(pp.even_pages),
135 count_copies(pp.count_copies),
136 sorted_copies(pp.sorted_copies),
137 reverse_order(pp.reverse_order)