QtGui/qprintdialog.h Source File

qprintdialog.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QPRINTDIALOG_H
43 #define QPRINTDIALOG_H
44 
46 
48 
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_OS_SYMBIAN)
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);
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)
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  QT3_SUPPORT void setPrinter(QPrinter *, bool = false);
101  QT3_SUPPORT QPrinter *printer() const;
102  QT3_SUPPORT 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 
171 
173 
174 #endif // QPRINTDIALOG_H
#define QT_END_NAMESPACE
Definition: qglobal.h:128
#define Q_PROPERTY(text)
Definition: qobjectdefs.h:80
QPrinter * printer() const
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
void setVisible(bool visible)
GLXDrawable GLXDrawable member
Definition: GLee.h:10556
#define Q_PRIVATE_SLOT(d, signature)
Definition: qobjectdefs.h:73
#define Q_SIGNALS
Definition: qobjectdefs.h:72
#define Q_ENUMS(x)
Definition: qobjectdefs.h:84
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
virtual void done(int)
void open()
virtual void accept()
#define Q_OBJECT
Definition: qobjectdefs.h:157
void accepted()
GLubyte GLubyte b
Definition: GLee.h:5404
bool eventFilter(QObject *, QEvent *)
#define QT_END_HEADER
Definition: qglobal.h:142