summaryrefslogtreecommitdiffstats
path: root/src/maingui/printergui.h
blob: 55a4ddb3a035a3370fac708b87b685f6be9442b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QDialog>
#include <QDebug>
#include <QDesktopWidget>
#include <QTreeWidget>
#include <cups/cups.h>
#include <cups/ppd.h>

namespace Ui
{
class PrinterGui;
}

class QTimer;
class QStatusBar;
class QCloseEvent;
class QHideEvent;
class QKeyEvent;

class PrinterGui : public QDialog
{
	Q_OBJECT

public:
	explicit PrinterGui(char *argv[], QWidget *parent = 0);
	~PrinterGui();

protected:
	void closeEvent(QCloseEvent * e);
	void hideEvent(QHideEvent * e);
	void keyPressEvent(QKeyEvent * e);

private slots:
	void on_printerList_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
	void on_buttonCancel_clicked();
	void on_buttonPrint_clicked();
	void on_chkSecurePrint_stateChanged(int state);
	void bgTimer_timeout();

private:
	Ui::PrinterGui *ui;
	void initializeUI();
	void handleTrustedPrint(ppd_file_t *ppd);
	cups_dest_t *dests;
	int num_dests;
	char * user;
	char * file;
	QTimer * bgTimer;
	QStatusBar *statusBar;
	int bgTimeout;
	int jobId;
};

#endif // MAINWINDOW_H