| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information (qt-info@nokia.com)
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the QtGui module of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** 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 are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department at qt-sales@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)
|
|---|
| 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)
|
|---|
| 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)
|
|---|
| 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)
|
|---|
| 147 | Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog())
|
|---|
| 148 | #endif
|
|---|
| 149 | # if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) && !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
|
|---|