| 1 | /**************************************************************************** | 
|---|
| 2 | ** | 
|---|
| 3 | ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 
|---|
| 4 | ** All rights reserved. | 
|---|
| 5 | ** Contact: Nokia Corporation (qt-info@nokia.com) | 
|---|
| 6 | ** | 
|---|
| 7 | ** This file is part of the QtGui module of the Qt Toolkit. | 
|---|
| 8 | ** | 
|---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$ | 
|---|
| 10 | ** Commercial Usage | 
|---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in | 
|---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the | 
|---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in | 
|---|
| 14 | ** a written agreement between you and Nokia. | 
|---|
| 15 | ** | 
|---|
| 16 | ** GNU Lesser General Public License Usage | 
|---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
|---|
| 18 | ** General Public License version 2.1 as published by the Free Software | 
|---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the | 
|---|
| 20 | ** packaging of this file.  Please review the following information to | 
|---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements | 
|---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | 
|---|
| 23 | ** | 
|---|
| 24 | ** In addition, as a special exception, Nokia gives you certain additional | 
|---|
| 25 | ** rights.  These rights are described in the Nokia Qt LGPL Exception | 
|---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
|---|
| 27 | ** | 
|---|
| 28 | ** GNU General Public License Usage | 
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU | 
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software | 
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the | 
|---|
| 32 | ** packaging of this file.  Please review the following information to | 
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be | 
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html. | 
|---|
| 35 | ** | 
|---|
| 36 | ** If you have questions regarding the use of this file, please contact | 
|---|
| 37 | ** Nokia at qt-info@nokia.com. | 
|---|
| 38 | ** $QT_END_LICENSE$ | 
|---|
| 39 | ** | 
|---|
| 40 | ****************************************************************************/ | 
|---|
| 41 |  | 
|---|
| 42 | #ifndef QPRINTDIALOG_H | 
|---|
| 43 | #define QPRINTDIALOG_H | 
|---|
| 44 |  | 
|---|
| 45 | #include <QtGui/qabstractprintdialog.h> | 
|---|
| 46 |  | 
|---|
| 47 | QT_BEGIN_HEADER | 
|---|
| 48 |  | 
|---|
| 49 | QT_BEGIN_NAMESPACE | 
|---|
| 50 |  | 
|---|
| 51 | QT_MODULE(Gui) | 
|---|
| 52 |  | 
|---|
| 53 | #ifndef QT_NO_PRINTDIALOG | 
|---|
| 54 |  | 
|---|
| 55 | class QPrintDialogPrivate; | 
|---|
| 56 | class QPushButton; | 
|---|
| 57 | class QPrinter; | 
|---|
| 58 |  | 
|---|
| 59 | #if (defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC)) || defined (Q_WS_PM) | 
|---|
| 60 | class QUnixPrintWidgetPrivate; | 
|---|
| 61 |  | 
|---|
| 62 | class Q_GUI_EXPORT QUnixPrintWidget : public QWidget | 
|---|
| 63 | { | 
|---|
| 64 | Q_OBJECT | 
|---|
| 65 |  | 
|---|
| 66 | public: | 
|---|
| 67 | QUnixPrintWidget(QPrinter *printer, QWidget *parent = 0); | 
|---|
| 68 | ~QUnixPrintWidget(); | 
|---|
| 69 | void updatePrinter(); | 
|---|
| 70 |  | 
|---|
| 71 | private: | 
|---|
| 72 | friend class QPrintDialogPrivate; | 
|---|
| 73 | friend class QUnixPrintWidgetPrivate; | 
|---|
| 74 | QUnixPrintWidgetPrivate *d; | 
|---|
| 75 | Q_PRIVATE_SLOT(d, void _q_printerChanged(int)) | 
|---|
| 76 | Q_PRIVATE_SLOT(d, void _q_btnBrowseClicked()) | 
|---|
| 77 | Q_PRIVATE_SLOT(d, void _q_btnPropertiesClicked()) | 
|---|
| 78 | }; | 
|---|
| 79 | #endif | 
|---|
| 80 |  | 
|---|
| 81 | class Q_GUI_EXPORT QPrintDialog : public QAbstractPrintDialog | 
|---|
| 82 | { | 
|---|
| 83 | Q_OBJECT | 
|---|
| 84 | Q_DECLARE_PRIVATE(QPrintDialog) | 
|---|
| 85 | Q_ENUMS(PrintDialogOption) | 
|---|
| 86 | Q_PROPERTY(PrintDialogOptions options READ options WRITE setOptions) | 
|---|
| 87 |  | 
|---|
| 88 | public: | 
|---|
| 89 | explicit QPrintDialog(QPrinter *printer, QWidget *parent = 0); | 
|---|
| 90 | explicit QPrintDialog(QWidget *parent = 0); | 
|---|
| 91 | ~QPrintDialog(); | 
|---|
| 92 |  | 
|---|
| 93 | int exec(); | 
|---|
| 94 | #if (defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC)) || defined (Q_WS_PM) | 
|---|
| 95 | virtual void accept(); | 
|---|
| 96 | #endif | 
|---|
| 97 | void done(int result); | 
|---|
| 98 |  | 
|---|
| 99 | #if defined (Q_OS_UNIX) && defined (QT3_SUPPORT) | 
|---|
| 100 | void setPrinter(QPrinter *, bool = false); | 
|---|
| 101 | QPrinter *printer() const; | 
|---|
| 102 | void addButton(QPushButton *button); | 
|---|
| 103 | #endif | 
|---|
| 104 |  | 
|---|
| 105 | void setOption(PrintDialogOption option, bool on = true); | 
|---|
| 106 | bool testOption(PrintDialogOption option) const; | 
|---|
| 107 | void setOptions(PrintDialogOptions options); | 
|---|
| 108 | PrintDialogOptions options() const; | 
|---|
| 109 |  | 
|---|
| 110 | #if defined(Q_OS_UNIX) || defined(Q_WS_MAC) || defined(Q_OS_WIN) || defined (Q_WS_PM) | 
|---|
| 111 | void setVisible(bool visible); | 
|---|
| 112 | #endif | 
|---|
| 113 |  | 
|---|
| 114 | #ifdef Q_NO_USING_KEYWORD | 
|---|
| 115 | #ifndef Q_QDOC | 
|---|
| 116 | void open() { QDialog::open(); } | 
|---|
| 117 | #endif | 
|---|
| 118 | #else | 
|---|
| 119 | using QDialog::open; | 
|---|
| 120 | #endif | 
|---|
| 121 | void open(QObject *receiver, const char *member); | 
|---|
| 122 |  | 
|---|
| 123 | #ifdef qdoc | 
|---|
| 124 | QPrinter *printer(); | 
|---|
| 125 | #endif | 
|---|
| 126 |  | 
|---|
| 127 | #ifdef QTOPIA_PRINTDIALOG | 
|---|
| 128 | public: | 
|---|
| 129 | bool eventFilter(QObject *, QEvent *); | 
|---|
| 130 | #endif | 
|---|
| 131 |  | 
|---|
| 132 | #ifdef Q_NO_USING_KEYWORD | 
|---|
| 133 | #ifndef Q_QDOC | 
|---|
| 134 | void accepted() { QDialog::accepted(); } | 
|---|
| 135 | #endif | 
|---|
| 136 | #else | 
|---|
| 137 | using QDialog::accepted; | 
|---|
| 138 | #endif | 
|---|
| 139 |  | 
|---|
| 140 | Q_SIGNALS: | 
|---|
| 141 | void accepted(QPrinter *printer); | 
|---|
| 142 |  | 
|---|
| 143 | private: | 
|---|
| 144 | #ifndef QTOPIA_PRINTDIALOG | 
|---|
| 145 | Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool)) | 
|---|
| 146 | #if (defined (Q_OS_UNIX) && !defined (Q_OS_MAC)) || defined (Q_WS_PM) | 
|---|
| 147 | Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog()) | 
|---|
| 148 | #endif | 
|---|
| 149 | # if ((defined(Q_OS_UNIX) && !defined (Q_OS_MAC)) || defined (Q_WS_PM)) && !defined(QT_NO_MESSAGEBOX) | 
|---|
| 150 | Q_PRIVATE_SLOT(d_func(), void _q_checkFields()) | 
|---|
| 151 | # endif | 
|---|
| 152 | #else // QTOPIA_PRINTDIALOG | 
|---|
| 153 | Q_PRIVATE_SLOT(d_func(), void _q_okClicked()) | 
|---|
| 154 | Q_PRIVATE_SLOT(d_func(),void _q_printerOrFileSelected(QAbstractButton *b)) | 
|---|
| 155 | Q_PRIVATE_SLOT(d_func(),void _q_paperSizeSelected(int)) | 
|---|
| 156 | Q_PRIVATE_SLOT(d_func(), void _q_orientSelected(int)) | 
|---|
| 157 | Q_PRIVATE_SLOT(d_func(), void _q_pageOrderSelected(int)) | 
|---|
| 158 | Q_PRIVATE_SLOT(d_func(), void _q_colorModeSelected(QAbstractButton *)) | 
|---|
| 159 | Q_PRIVATE_SLOT(d_func(), void _q_setNumCopies(int)) | 
|---|
| 160 | Q_PRIVATE_SLOT(d_func(), void _q_printRangeSelected(int)) | 
|---|
| 161 | Q_PRIVATE_SLOT(d_func(), void _q_setFirstPage(int)) | 
|---|
| 162 | Q_PRIVATE_SLOT(d_func(), void _q_setLastPage(int)) | 
|---|
| 163 | Q_PRIVATE_SLOT(d_func(), void _q_fileNameEditChanged(const QString &text)) | 
|---|
| 164 | #endif // QTOPIA_PRINTDIALOG | 
|---|
| 165 | friend class QUnixPrintWidget; | 
|---|
| 166 | }; | 
|---|
| 167 |  | 
|---|
| 168 | #endif // QT_NO_PRINTDIALOG | 
|---|
| 169 |  | 
|---|
| 170 | QT_END_NAMESPACE | 
|---|
| 171 |  | 
|---|
| 172 | QT_END_HEADER | 
|---|
| 173 |  | 
|---|
| 174 | #endif // QPRINTDIALOG_H | 
|---|