source: trunk/src/gui/dialogs/qprintdialog.h@ 112

Last change on this file since 112 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 5.4 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
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 [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QPRINTDIALOG_H
43#define QPRINTDIALOG_H
44
45#include <QtGui/qabstractprintdialog.h>
46
47QT_BEGIN_HEADER
48
49QT_BEGIN_NAMESPACE
50
51QT_MODULE(Gui)
52
53#ifndef QT_NO_PRINTDIALOG
54
55class QPrintDialogPrivate;
56class QPushButton;
57class QPrinter;
58
59#if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC)
60class QUnixPrintWidgetPrivate;
61
62class Q_GUI_EXPORT QUnixPrintWidget : public QWidget
63{
64 Q_OBJECT
65
66public:
67 QUnixPrintWidget(QPrinter *printer, QWidget *parent = 0);
68 ~QUnixPrintWidget();
69 void updatePrinter();
70
71private:
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
81class 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
88public:
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
128public:
129 bool eventFilter(QObject *, QEvent *);
130#endif
131
132#ifdef Q_NO_USING_KEYWORD
133#ifndef Q_QDOC