• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kleopatra

  • sources
  • kde-4.12
  • kdepim
  • kleopatra
  • utils
qwizard.h
Go to the documentation of this file.
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 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
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 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef KLEO_QWIZARD_H
43 #define KLEO_QWIZARD_H
44 
45 #include <qdialog.h>
46 
47 class QWizardPage;
48 class QAbstractButton;
49 class QWizardPrivate;
50 
51 class QWizard : public QDialog
52 {
53  Q_OBJECT
54  Q_ENUMS(WizardStyle WizardOption)
55  Q_FLAGS(WizardOptions)
56  Q_PROPERTY(WizardStyle wizardStyle READ wizardStyle WRITE setWizardStyle)
57  Q_PROPERTY(WizardOptions options READ options WRITE setOptions)
58  Q_PROPERTY(Qt::TextFormat titleFormat READ titleFormat WRITE setTitleFormat)
59  Q_PROPERTY(Qt::TextFormat subTitleFormat READ subTitleFormat WRITE setSubTitleFormat)
60  Q_PROPERTY(int startId READ startId WRITE setStartId)
61  Q_PROPERTY(int currentId READ currentId NOTIFY currentIdChanged)
62 
63 public:
64  enum WizardButton {
65  BackButton,
66  NextButton,
67  CommitButton,
68  FinishButton,
69  CancelButton,
70  HelpButton,
71  CustomButton1,
72  CustomButton2,
73  CustomButton3,
74  Stretch,
75 
76  NoButton = -1,
77  NStandardButtons = 6,
78  NButtons = 9
79  };
80 
81  enum WizardPixmap {
82  WatermarkPixmap,
83  LogoPixmap,
84  BannerPixmap,
85  BackgroundPixmap,
86  NPixmaps
87  };
88 
89  enum WizardStyle {
90  ClassicStyle,
91  ModernStyle,
92  MacStyle,
93  AeroStyle,
94  NStyles
95  };
96 
97  enum WizardOption {
98  IndependentPages = 0x00000001,
99  IgnoreSubTitles = 0x00000002,
100  ExtendedWatermarkPixmap = 0x00000004,
101  NoDefaultButton = 0x00000008,
102  NoBackButtonOnStartPage = 0x00000010,
103  NoBackButtonOnLastPage = 0x00000020,
104  DisabledBackButtonOnLastPage = 0x00000040,
105  HaveNextButtonOnLastPage = 0x00000080,
106  HaveFinishButtonOnEarlyPages = 0x00000100,
107  NoCancelButton = 0x00000200,
108  CancelButtonOnLeft = 0x00000400,
109  HaveHelpButton = 0x00000800,
110  HelpButtonOnRight = 0x00001000,
111  HaveCustomButton1 = 0x00002000,
112  HaveCustomButton2 = 0x00004000,
113  HaveCustomButton3 = 0x00008000
114  };
115 
116  Q_DECLARE_FLAGS(WizardOptions, WizardOption)
117 
118  explicit QWizard(QWidget *parent = 0, Qt::WindowFlags flags = 0);
119  ~QWizard();
120 
121  int addPage(QWizardPage *page);
122  void setPage(int id, QWizardPage *page);
123  void removePage(int id);
124  QWizardPage *page(int id) const;
125  bool hasVisitedPage(int id) const;
126  QList<int> visitedPages() const; // ### visitedIds()?
127  QList<int> pageIds() const;
128  void setStartId(int id);
129  int startId() const;
130  QWizardPage *currentPage() const;
131  int currentId() const;
132 
133  virtual bool validateCurrentPage();
134  virtual int nextId() const;
135 
136  void setField(const QString &name, const QVariant &value);
137  QVariant field(const QString &name) const;
138 
139  void setWizardStyle(WizardStyle style);
140  WizardStyle wizardStyle() const;
141 
142  void setOption(WizardOption option, bool on = true);
143  bool testOption(WizardOption option) const;
144  void setOptions(WizardOptions options);
145  WizardOptions options() const;
146 
147  void setButtonText(WizardButton which, const QString &text);
148  QString buttonText(WizardButton which) const;
149  void setButtonLayout(const QList<WizardButton> &layout);
150  void setButton(WizardButton which, QAbstractButton *button);
151  QAbstractButton *button(WizardButton which) const;
152 
153  void setTitleFormat(Qt::TextFormat format);
154  Qt::TextFormat titleFormat() const;
155  void setSubTitleFormat(Qt::TextFormat format);
156  Qt::TextFormat subTitleFormat() const;
157  void setPixmap(WizardPixmap which, const QPixmap &pixmap);
158  QPixmap pixmap(WizardPixmap which) const;
159 
160  void setSideWidget(QWidget *widget);
161  QWidget *sideWidget() const;
162 
163  void setDefaultProperty(const char *className, const char *property,
164  const char *changedSignal);
165 
166  void setVisible(bool visible);
167  QSize sizeHint() const;
168 
169 Q_SIGNALS:
170  void currentIdChanged(int id);
171  void helpRequested();
172  void customButtonClicked(int which);
173  void pageAdded(int id);
174  void pageRemoved(int id);
175 
176 public Q_SLOTS:
177  void back();
178  void next();
179  void restart();
180 
181 protected:
182  bool event(QEvent *event);
183  void resizeEvent(QResizeEvent *event);
184  void paintEvent(QPaintEvent *event);
185 #if defined(Q_WS_WIN)
186  bool winEvent(MSG * message, long * result);
187 #endif
188  void done(int result);
189  virtual void initializePage(int id);
190  virtual void cleanupPage(int id);
191 
192 private:
193  Q_DISABLE_COPY(QWizard)
194  Q_DECLARE_PRIVATE(QWizard)
195  Q_PRIVATE_SLOT(d_func(), void _q_emitCustomButtonClicked())
196  Q_PRIVATE_SLOT(d_func(), void _q_updateButtonStates())
197  Q_PRIVATE_SLOT(d_func(), void _q_handleFieldObjectDestroyed(QObject *))
198 
199  friend class QWizardPage;
200 };
201 
202 Q_DECLARE_OPERATORS_FOR_FLAGS(QWizard::WizardOptions)
203 
204 class QWizardPagePrivate;
205 
206 class QWizardPage : public QWidget
207 {
208  Q_OBJECT
209  Q_PROPERTY(QString title READ title WRITE setTitle)
210  Q_PROPERTY(QString subTitle READ subTitle WRITE setSubTitle)
211 
212 public:
213  explicit QWizardPage(QWidget *parent = 0);
214 
215  void setTitle(const QString &title);
216  QString title() const;
217  void setSubTitle(const QString &subTitle);
218  QString subTitle() const;
219  void setPixmap(QWizard::WizardPixmap which, const QPixmap &pixmap);
220  QPixmap pixmap(QWizard::WizardPixmap which) const;
221  void setFinalPage(bool finalPage);
222  bool isFinalPage() const;
223  void setCommitPage(bool commitPage);
224  bool isCommitPage() const;
225  void setButtonText(QWizard::WizardButton which, const QString &text);
226  QString buttonText(QWizard::WizardButton which) const;
227 
228  virtual void initializePage();
229  virtual void cleanupPage();
230  virtual bool validatePage();
231  virtual bool isComplete() const;
232  virtual int nextId() const;
233 
234 Q_SIGNALS:
235  void completeChanged();
236 
237 protected:
238  void setField(const QString &name, const QVariant &value);
239  QVariant field(const QString &name) const;
240  void registerField(const QString &name, QWidget *widget, const char *property = 0,
241  const char *changedSignal = 0);
242  QWizard *wizard() const;
243 
244 private:
245  Q_DISABLE_COPY(QWizardPage)
246  Q_DECLARE_PRIVATE(QWizardPage)
247  Q_PRIVATE_SLOT(d_func(), void _q_maybeEmitCompleteChanged())
248  Q_PRIVATE_SLOT(d_func(), void _q_updateCachedCompleteState())
249 
250  friend class QWizard;
251  friend class QWizardPrivate;
252 };
253 
254 #endif // QWIZARD_H
QWizard::helpRequested
void helpRequested()
QWizard::restart
void restart()
Definition: qwizard.cpp:3121
QWizard::ClassicStyle
Definition: qwizard.h:90
QWizard::paintEvent
void paintEvent(QPaintEvent *event)
Definition: qwizard.cpp:3178
flags
static const char * flags[]
Definition: readerstatus.cpp:115
QWizard::NStandardButtons
Definition: qwizard.h:77
QWizard::hasVisitedPage
bool hasVisitedPage(int id) const
Definition: qwizard.cpp:2365
QWizard::setButton
void setButton(WizardButton which, QAbstractButton *button)
Definition: qwizard.cpp:2743
QWizard::WizardButton
WizardButton
Definition: qwizard.h:64
QWizard::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: qwizard.cpp:3156
QWizard::HaveCustomButton1
Definition: qwizard.h:111
QWizard::ExtendedWatermarkPixmap
Definition: qwizard.h:100
QWizard::WatermarkPixmap
Definition: qwizard.h:82
QWizard::setWizardStyle
void setWizardStyle(WizardStyle style)
Definition: qwizard.cpp:2519
QWizard::BackButton
Definition: qwizard.h:65
QWizard::HelpButtonOnRight
Definition: qwizard.h:110
QWizard::setDefaultProperty
void setDefaultProperty(const char *className, const char *property, const char *changedSignal)
Definition: qwizard.cpp:2891
changedSignal
const char * changedSignal
Definition: qwizard.cpp:131
QWizard::HaveCustomButton3
Definition: qwizard.h:113
QDialog
QWizardPage
The QWizardPage class is the base class for wizard pages.
Definition: qwizard.h:206
QWizard::pageAdded
void pageAdded(int id)
QWizard::done
void done(int result)
Definition: qwizard.cpp:3231
QWizard::field
QVariant field(const QString &name) const
Definition: qwizard.cpp:2493
QWizard::CustomButton2
Definition: qwizard.h:72
QWidget
QWizard::NoBackButtonOnLastPage
Definition: qwizard.h:103
QWizard::customButtonClicked
void customButtonClicked(int which)
QWizard::setOption
void setOption(WizardOption option, bool on=true)
Definition: qwizard.cpp:2562
QWizard::NoDefaultButton
Definition: qwizard.h:101
QWizard::AeroStyle
Definition: qwizard.h:93
QWizard::cleanupPage
virtual void cleanupPage(int id)
Definition: qwizard.cpp:3280
QWizard::HaveCustomButton2
Definition: qwizard.h:112
option
const char * option
Definition: kleopatraapplication.cpp:91
QWizard::CancelButtonOnLeft
Definition: qwizard.h:108
QWizard::IndependentPages
Definition: qwizard.h:98
QWizard::currentId
int currentId() const
className
const char * className
Definition: qwizard.cpp:129
QWizard::NStyles
Definition: qwizard.h:94
QWizard::pageRemoved
void pageRemoved(int id)
QWizard::BannerPixmap
Definition: qwizard.h:84
QWizard::validateCurrentPage
virtual bool validateCurrentPage()
Definition: qwizard.cpp:3303
QWizard::Stretch
Definition: qwizard.h:74
QWizard::button
QAbstractButton * button(WizardButton which) const
Definition: qwizard.cpp:2773
QWizard::HaveNextButtonOnLastPage
Definition: qwizard.h:105
QWizard::CommitButton
Definition: qwizard.h:67
QWizard::setSubTitleFormat
void setSubTitleFormat(Qt::TextFormat format)
Definition: qwizard.cpp:2814
QWizard::addPage
int addPage(QWizardPage *page)
Definition: qwizard.cpp:2199
QWizard::wizardStyle
WizardStyle wizardStyle() const
QWizard::pixmap
QPixmap pixmap(WizardPixmap which) const
Definition: qwizard.cpp:2855
QWizard::event
bool event(QEvent *event)
Definition: qwizard.cpp:3133
QWizard::setButtonText
void setButtonText(WizardButton which, const QString &text)
Definition: qwizard.cpp:2646
QWizard::pageIds
QList< int > pageIds() const
Definition: qwizard.cpp:2389
QWizard::currentIdChanged
void currentIdChanged(int id)
QWizard::WizardOption
WizardOption
Definition: qwizard.h:97
QWizard::sizeHint
QSize sizeHint() const
Definition: qwizard.cpp:2969
QWizard::CustomButton3
Definition: qwizard.h:73
QWizard::titleFormat
Qt::TextFormat titleFormat() const
QWizard::setSideWidget
void setSideWidget(QWidget *widget)
Definition: qwizard.cpp:2928
QWizard::DisabledBackButtonOnLastPage
Definition: qwizard.h:104
QWizard::NoButton
Definition: qwizard.h:76
QWizard::setStartId
void setStartId(int id)
Definition: qwizard.cpp:2405
QWizard::startId
int startId() const
QWizard::NextButton
Definition: qwizard.h:66
QWizard::back
void back()
Definition: qwizard.cpp:3076
QWizard::setButtonLayout
void setButtonLayout(const QList< WizardButton > &layout)
Definition: qwizard.cpp:2706
QWizard::LogoPixmap
Definition: qwizard.h:83
QWizard::NButtons
Definition: qwizard.h:78
QWizard::HelpButton
Definition: qwizard.h:70
QWizard::setTitleFormat
void setTitleFormat(Qt::TextFormat format)
Definition: qwizard.cpp:2793
QWizard::next
void next()
Definition: qwizard.cpp:3092
QWizard::initializePage
virtual void initializePage(int id)
Definition: qwizard.cpp:3262
QWizard::setField
void setField(const QString &name, const QVariant &value)
Definition: qwizard.cpp:2470
QWizard::options
WizardOptions options() const
QWizard::CancelButton
Definition: qwizard.h:69
QWizard::MacStyle
Definition: qwizard.h:92
QWizard::currentPage
QWizardPage * currentPage() const
Definition: qwizard.cpp:2439
QWizard::WizardStyle
WizardStyle
Definition: qwizard.h:89
QWizard::setOptions
void setOptions(WizardOptions options)
Definition: qwizard.cpp:2595
QWizard::NoCancelButton
Definition: qwizard.h:107
QWizard::HaveHelpButton
Definition: qwizard.h:109
property
const char * property
Definition: qwizard.cpp:130
QWizard::CustomButton1
Definition: qwizard.h:71
QWizard::FinishButton
Definition: qwizard.h:68
QWizard::nextId
virtual int nextId() const
Definition: qwizard.cpp:3326
QWizard::HaveFinishButtonOnEarlyPages
Definition: qwizard.h:106
name
const char * name
Definition: uiserver/selectcertificatecommand.cpp:114
QWizard::setPixmap
void setPixmap(WizardPixmap which, const QPixmap &pixmap)
Definition: qwizard.cpp:2839
QWizard::page
QWizardPage * page(int id) const
Definition: qwizard.cpp:2349
QWizard::subTitleFormat
Qt::TextFormat subTitleFormat() const
QWizard::buttonText
QString buttonText(WizardButton which) const
Definition: qwizard.cpp:2671
QWizard::removePage
void removePage(int id)
Definition: qwizard.cpp:2275
QWizard::IgnoreSubTitles
Definition: qwizard.h:99
QWizard::visitedPages
QList< int > visitedPages() const
Definition: qwizard.cpp:2379
QWizard::testOption
bool testOption(WizardOption option) const
Definition: qwizard.cpp:2575
QWizard::WizardPixmap
WizardPixmap
Definition: qwizard.h:81
QWizard::NPixmaps
Definition: qwizard.h:86
QWizard::setPage
void setPage(int id, QWizardPage *page)
Definition: qwizard.cpp:2219
QWizard::ModernStyle
Definition: qwizard.h:91
QWizard::BackgroundPixmap
Definition: qwizard.h:85
QWizard::NoBackButtonOnStartPage
Definition: qwizard.h:102
QWizard::sideWidget
QWidget * sideWidget() const
Definition: qwizard.cpp:2946
QWizard
The QWizard class provides a framework for wizards.
Definition: qwizard.h:51
QWizard::setVisible
void setVisible(bool visible)
Definition: qwizard.cpp:2956
QList
Definition: commands/command.h:46
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kleopatra

Skip menu "kleopatra"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal