1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef PRINTDIALOG_H
8 #define PRINTDIALOG_H
9 
10 #include "scribusapi.h"
11 #include "scribusstructs.h"
12 
13 #include <QDialog>
14 #include <QStringList>
15 #include "ui_printdialogbase.h"
16 
17 class PrefsContext;
18 class ScribusDoc;
19 class CupsOptions;
20 
21 struct PrintOptions;
22 
23 class SCRIBUS_API PrintDialog : public QDialog, Ui::PrintDialogBase
24 {
25 	Q_OBJECT
26 
27 public:
28 	PrintDialog( QWidget* parent, ScribusDoc* doc, const PrintOptions& printOptions);
29 	~PrintDialog();
30 
31 	QString printerName();
32 	QString outputFileName();
33 	bool outputToFile();
34 	int numCopies();
35 	bool outputSeparations();
36 	QString separationName();
37 	QStringList allSeparations();
38 	bool color();
39 	bool mirrorHorizontal();
40 	bool mirrorVertical();
41 	bool doGCR();
42 	bool doClip();
43 	PrintLanguage printLanguage();
44 	bool doDev();
45 	bool doSpot();
46 	bool doPrintAll();
47 	bool doPrintCurrentPage();
48 	QString getPageString();
49 
50 public slots:
51 	void setMinMax(int min, int max, int cur);
52 
53 signals:
54 	void doPreview();
55 
56 protected slots:
57 	void doDocBleeds();
58 	void createPageNumberRange();
59 	void selectOptions();
60 	void selectPrinter(const QString& prn);
61 	void selectPrintLanguage(const QString& prnLanguage);
62 	void selectRange(bool e);
63 	void selectSepMode(int e);
64 	void selectFile();
65 	void selectCommand();
66 	void okButtonClicked();
67 	void previewButtonClicked();
68 
69 protected:
70 	ScribusDoc*    m_doc;
71 	PrefsContext*  prefs { nullptr };
72 	CupsOptions*   m_cupsOptions { nullptr };
73 	int            m_unit { 0 };
74 	double         m_unitRatio { 1 };
75 	QStringList    m_spotColors;
76 
77 	QByteArray m_devMode; // Buffer for storing storing printer options on Windows
78 
79 	QString getOptions();
80 	void storeValues();
81 	void setPrintLanguage(PrintLanguage engine);
82 	void setStoredValues(const QString& fileName);
83 };
84 
85 #endif // PRINTDIALOG_H
86