2003-09-06 23:01:26 +00:00
|
|
|
/**
|
|
|
|
* \file PrinterParams.C
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Allan Rae
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "PrinterParams.h"
|
|
|
|
|
|
|
|
#include "support/lstrings.h"
|
2003-09-09 17:25:35 +00:00
|
|
|
|
|
|
|
#include <boost/assert.hpp>
|
2003-09-06 23:01:26 +00:00
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
using std::string;
|
|
|
|
|
2003-09-06 23:01:26 +00:00
|
|
|
|
|
|
|
PrinterParams::PrinterParams(Target t,
|
|
|
|
string const & pname,
|
|
|
|
string const & fname,
|
|
|
|
bool all,
|
|
|
|
unsigned int from,
|
|
|
|
unsigned int to,
|
|
|
|
bool odd,
|
|
|
|
bool even,
|
|
|
|
unsigned int copies,
|
|
|
|
bool sorted,
|
|
|
|
bool reverse)
|
|
|
|
: target(t),
|
|
|
|
printer_name(pname),
|
|
|
|
file_name(fname),
|
|
|
|
all_pages(all),
|
|
|
|
from_page(from),
|
|
|
|
to_page(to),
|
|
|
|
odd_pages(odd),
|
|
|
|
even_pages(even),
|
|
|
|
count_copies(copies),
|
|
|
|
sorted_copies(sorted),
|
|
|
|
reverse_order(reverse)
|
|
|
|
{
|
|
|
|
testInvariant();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PrinterParams::PrinterParams(PrinterParams const & pp)
|
|
|
|
: target(pp.target),
|
|
|
|
printer_name(pp.printer_name),
|
|
|
|
file_name(pp.file_name),
|
|
|
|
all_pages(pp.all_pages),
|
|
|
|
from_page(pp.from_page),
|
|
|
|
to_page(pp.to_page),
|
|
|
|
odd_pages(pp.odd_pages),
|
|
|
|
even_pages(pp.even_pages),
|
|
|
|
count_copies(pp.count_copies),
|
|
|
|
sorted_copies(pp.sorted_copies),
|
|
|
|
reverse_order(pp.reverse_order)
|
|
|
|
{
|
|
|
|
testInvariant();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void PrinterParams::testInvariant() const
|
|
|
|
{
|
|
|
|
#ifdef ENABLE_ASSERTIONS
|
|
|
|
switch (target) {
|
|
|
|
case PRINTER:
|
2003-09-09 17:25:35 +00:00
|
|
|
//BOOST_ASSERT(!printer_name.empty());
|
2003-09-06 23:01:26 +00:00
|
|
|
break;
|
|
|
|
case FILE:
|
2003-09-09 17:25:35 +00:00
|
|
|
BOOST_ASSERT(!file_name.empty());
|
2003-09-06 23:01:26 +00:00
|
|
|
break;
|
|
|
|
default:
|
2003-09-09 17:25:35 +00:00
|
|
|
BOOST_ASSERT(false);
|
2003-09-06 23:01:26 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|