2000-06-12 11:27:15 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
/**
|
|
|
|
* \file PrinterParams.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author Allan Rae
|
2000-06-12 11:27:15 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2000-06-12 11:27:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PRINTERPARAMS_H
|
|
|
|
#define PRINTERPARAMS_H
|
|
|
|
|
2002-03-22 15:13:36 +00:00
|
|
|
#include "lyxrc.h"
|
2000-06-12 11:27:15 +00:00
|
|
|
|
|
|
|
/**
|
2005-01-19 15:03:31 +00:00
|
|
|
This class contains (or should contain) all the parameters required for
|
|
|
|
printing a buffer. Some work still needs to be done on this class and
|
2000-06-12 11:27:15 +00:00
|
|
|
printing handling in general to make it nice and full-featured.
|
|
|
|
The main things I'd like to add now is the ability to print a read-only
|
|
|
|
document with different orientation, papersize or single/duplex state
|
|
|
|
than the document's settings. ARRae 20000423
|
|
|
|
*/
|
2005-01-19 15:03:31 +00:00
|
|
|
class PrinterParams {
|
|
|
|
public:
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2000-09-26 13:54:57 +00:00
|
|
|
enum Target {
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
|
|
|
PRINTER,
|
|
|
|
///
|
|
|
|
FILE
|
|
|
|
};
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
|
|
|
Target target;
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string printer_name;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string file_name;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2002-09-11 18:48:20 +00:00
|
|
|
bool all_pages;
|
2000-06-12 11:27:15 +00:00
|
|
|
/** Print a page range. Both from_page and to_page used to be strings
|
|
|
|
because they're actually easier to work with that way. I've
|
|
|
|
switched to_page to be an int. However, from_page will remain a
|
|
|
|
string because I want the from_page field to be able to be used as
|
|
|
|
a page range "1,3-5" and so on.
|
|
|
|
I've modified the invariant test to match. ARRae 20000518
|
|
|
|
*/
|
2002-09-11 18:48:20 +00:00
|
|
|
unsigned int from_page;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2002-09-11 18:48:20 +00:00
|
|
|
unsigned int to_page;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2002-09-11 18:48:20 +00:00
|
|
|
bool odd_pages;
|
|
|
|
///
|
|
|
|
bool even_pages;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2002-09-11 18:48:20 +00:00
|
|
|
unsigned int count_copies;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2002-09-11 18:48:20 +00:00
|
|
|
bool sorted_copies;
|
|
|
|
///
|
|
|
|
bool reverse_order;
|
2000-06-12 11:27:15 +00:00
|
|
|
// The settings below should allow us to print any read-only doc in
|
|
|
|
// whatever size/orientation we want it -- overriding the documents
|
|
|
|
// settings.
|
2002-03-21 17:27:08 +00:00
|
|
|
// Override the documents orientation
|
2000-08-07 20:58:24 +00:00
|
|
|
// bool orientation;
|
|
|
|
// Print n pages per physical sheet
|
|
|
|
// unsigned int nup;
|
|
|
|
// Override document settings for duplex.
|
|
|
|
// bool duplex;
|
2000-06-12 11:27:15 +00:00
|
|
|
|
2000-10-02 00:10:25 +00:00
|
|
|
/** Test that all the fields contain valid entries. It's unlikely
|
|
|
|
that the internal code will get this wrong (at least for the
|
|
|
|
xforms code anyway) however new ports and external scripts
|
|
|
|
might drive the wrong values in.
|
|
|
|
*/
|
2003-09-06 23:01:26 +00:00
|
|
|
void testInvariant() const;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2003-09-06 23:01:26 +00:00
|
|
|
PrinterParams(Target t = PRINTER,
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const & pname = lyxrc.printer,
|
|
|
|
std::string const & fname = std::string(),
|
2003-09-06 23:01:26 +00:00
|
|
|
bool all = true,
|
|
|
|
unsigned int from = 1,
|
|
|
|
unsigned int to = 0,
|
|
|
|
bool odd = true,
|
|
|
|
bool even = true,
|
|
|
|
unsigned int copies = 1,
|
|
|
|
bool sorted = false,
|
|
|
|
bool reverse = false);
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2003-09-06 23:01:26 +00:00
|
|
|
PrinterParams(PrinterParams const & pp);
|
2000-06-12 11:27:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|