Initial: added urpo files!
[urpo] / src / printwidget.h
1 /**************************************************************************
2
3     URPO
4
5     Unix Remote Printing Operation
6     Copyright (c) Arto Hyvättinen 2010
7
8     This file is part of URPO.
9
10     URPO is free software: you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation, either version 3 of the License, or
13     (at your option) any later version.
14
15     URPO is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19
20
21 **************************************************************************/
22
23 #ifndef PRINTWIDGET_H
24 #define PRINTWIDGET_H
25
26 #include <QWidget>
27
28 class QLineEdit;
29 class QPushButton;
30 class QComboBox;
31 class QProgressBar;
32 class QLabel;
33 class QSpinBox;
34
35 /*! GUI Widget of Urpo printing
36
37   @author Arto Hyvättinen
38   @date 2010-06-17
39   @version 0.1
40
41
42   */
43 class PrintWidget : public QWidget
44 {
45     Q_OBJECT
46 public:
47     explicit PrintWidget(QWidget *parent = 0);
48     /*! Set printers
49
50       Set printers and enable printing if printer exists
51
52       @arg printers List of printer names
53       */
54     void setPrinters(QStringList printers);
55
56 signals:
57     /*! User press Cancel button */
58     void cancel();
59     /*! User press Reconnect button */
60     void reconnect();
61     /*! User press Print button */
62     void print(QString file, QString options);
63
64 public slots:
65     /*! Set status information
66
67       @arg message Message to show. Use html tags for red error color
68       @arg busy Show busy progress bar
69       */
70     void setStatus(QString message=QString(), bool busy=false);
71     /*! Set ready to print
72
73       Enable print button and set status message to ready
74
75       @arg ready Is ready to print
76       */
77     void setReady(bool ready);
78     void browseFile();  /*! Press browse button */
79     void doPrint();     /*! Press print button */
80     void doCancel() { emit cancel(); } /*! Press cancel button */
81
82
83 private:
84     QLineEdit*      filenameEdit;
85     QPushButton*    browseButton;
86     QComboBox*      printerCombo;
87     QComboBox*      persheetCombo;
88     QLineEdit*      rangeEdit;
89     QSpinBox*       copiesSpin;
90     QPushButton*    printButton;
91     QLabel*         statusLabel;
92     QProgressBar*   progressBar;
93     QPushButton*    cancelButton;
94     QPushButton*    reconnectButton;
95 };
96
97 #endif // PRINTWIDGET_H