2003-09-06 23:01:26 +00:00
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
* \file PrinterParams.cpp
|
2003-09-06 23:01:26 +00:00
|
|
|
* 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"
|
|
|
|
|
2008-04-19 20:39:48 +00:00
|
|
|
#include "LyXRC.h"
|
2003-09-09 17:25:35 +00:00
|
|
|
|
2008-04-30 08:26:40 +00:00
|
|
|
#include "support/lassert.h"
|
2008-04-19 20:39:48 +00:00
|
|
|
#include "support/lstrings.h"
|
2003-09-06 23:01:26 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
namespace lyx {
|
2003-10-06 15:43:21 +00:00
|
|
|
|
2008-04-19 20:39:48 +00:00
|
|
|
PrinterParams::PrinterParams()
|
2003-09-06 23:01:26 +00:00
|
|
|
{
|
2008-04-19 20:39:48 +00:00
|
|
|
target = PRINTER;
|
|
|
|
file_name = std::string();
|
|
|
|
all_pages = true;
|
|
|
|
from_page = 1;
|
|
|
|
to_page = 0;
|
|
|
|
odd_pages = true;
|
|
|
|
even_pages = true;
|
|
|
|
count_copies = 1;
|
|
|
|
sorted_copies = false;
|
|
|
|
reverse_order = false;
|
2003-09-06 23:01:26 +00:00
|
|
|
|
|
|
|
testInvariant();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void PrinterParams::testInvariant() const
|
|
|
|
{
|
2013-04-25 21:27:10 +00:00
|
|
|
#ifdef ENABLE_ASSERTIONS
|
2003-09-06 23:01:26 +00:00
|
|
|
switch (target) {
|
|
|
|
case PRINTER:
|
2008-04-24 16:08:11 +00:00
|
|
|
// We can't do this test, because no default printer
|
|
|
|
// may have been set.
|
|
|
|
// LASSERT(!printer_name.empty(), /**/);
|
2003-09-06 23:01:26 +00:00
|
|
|
break;
|
|
|
|
case FILE:
|
2013-04-25 21:27:10 +00:00
|
|
|
LATTEST(!file_name.empty());
|
2003-09-06 23:01:26 +00:00
|
|
|
break;
|
|
|
|
default:
|
2013-04-25 21:27:10 +00:00
|
|
|
LATTEST(false);
|
2003-09-06 23:01:26 +00:00
|
|
|
break;
|
|
|
|
}
|
2013-04-25 21:27:10 +00:00
|
|
|
#endif
|
2003-09-06 23:01:26 +00:00
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|