Qt 4.8
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 
45 #include <QtGui/qabstractprintdialog.h>
46 
48 
50 
51 QT_MODULE(Gui)
52 
53 #ifndef QT_NO_PRINTDIALOG
54 
56 class QPushButton;
57 class QPrinter;
58 
59 #if defined (Q_OS_UNIX) && !defined(QTOPIA_PRINTDIALOG) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN)
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;
75  Q_PRIVATE_SLOT(d, void _q_printerChanged(int))
78 };
79 #endif
80 
82 {
83  Q_OBJECT
86  PrintDialogOptions options;
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
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
double d
Definition: qnumeric_p.h:62
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
virtual void accept()
Hides the modal dialog and sets the result code to Accepted.
Definition: qdialog.cpp:639
The QPushButton widget provides a command button.
Definition: qpushbutton.h:57
#define Q_PRIVATE_SLOT(d, signature)
Definition: qobjectdefs.h:73
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_SIGNALS
Definition: qobjectdefs.h:72
#define Q_ENUMS(x)
Definition: qobjectdefs.h:84
The QPrintDialog class provides a dialog for specifying the printer&#39;s configuration.
Definition: qprintdialog.h:81
QPrinter * printer() const
Returns the printer that this printer dialog operates on.
void _q_printerChanged(int index)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
PrintDialogOption
Used to specify which parts of the print dialog should be visible.
The QPrinter class is a paint device that paints on a printer.
Definition: qprinter.h:66
#define Q_OBJECT
Definition: qobjectdefs.h:157
virtual void done(int)
Closes the dialog and sets its result code to r.
Definition: qdialog.cpp:617
The QAbstractPrintDialog class provides a base implementation for print dialogs used to configure pri...
bool eventFilter(QObject *, QEvent *)
Reimplemented Function
Definition: qdialog.cpp:656
void accepted()
This signal is emitted when the dialog has been accepted either by the user or by calling accept() or...
void open()
Shows the dialog as a window modal dialog, returning immediately.
Definition: qdialog.cpp:492
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
#define QT_END_HEADER
Definition: qglobal.h:137
void setVisible(bool visible)
Reimplemented Function
Definition: qdialog.cpp:756
#define text
Definition: qobjectdefs.h:80