Salome HOME
Fix misprint
[tools/install.git] / src / InstallWizard.h
1 /****************************************************************************
2 ** $Id$
3 **
4 ** Definition of the QWizard class.
5 **
6 ** Created : 990101
7 **
8 ** Copyright (C) 1999 by Trolltech AS.  All rights reserved.
9 **
10 ** This file is part of the dialogs module of the Qt GUI Toolkit.
11 **
12 ** This file may be distributed under the terms of the Q Public License
13 ** as defined by Trolltech AS of Norway and appearing in the file
14 ** LICENSE.QPL included in the packaging of this file.
15 **
16 ** This file may be distributed and/or modified under the terms of the
17 ** GNU General Public License version 2 as published by the Free Software
18 ** Foundation and appearing in the file LICENSE.GPL included in the
19 ** packaging of this file.
20 **
21 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22 ** licenses may use this file in accordance with the Qt Commercial License
23 ** Agreement provided with the Software.
24 **
25 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27 **
28 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29 **   information about Qt Commercial License Agreements.
30 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
31 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
32 **
33 ** Contact info@trolltech.com if any conditions of this licensing are
34 ** not clear to you.
35 **
36 **********************************************************************/
37
38 #ifndef InstallWizard_h
39 #define InstallWizard_h
40
41 #include <qdialog.h>
42
43 /*!
44   This is the patched Qt 3.0.5 QWizard class
45 */
46 class QHBoxLayout;
47 class InstallWizardPrivate;
48
49 class InstallWizard : public QDialog
50 {
51   Q_OBJECT
52     
53 public:
54   InstallWizard( QWidget* parent=0, const char* name=0, bool modal=FALSE, WFlags f=0 );
55   ~InstallWizard();
56
57   static void postValidateEvent( InstallWizard* iw, const int val = 0, void* data = 0 );
58   
59   virtual void processValidateEvent( const int val, void* data );
60
61   bool event ( QEvent * e );
62
63   void show();
64   
65   void setFont( const QFont & font );
66   
67   virtual void addPage( QWidget *, const QString & );
68   virtual void insertPage( QWidget*, const QString&, int );
69   virtual void removePage( QWidget * );
70   
71   QString title( QWidget * ) const;
72   void setTitle( QWidget *, const QString & );
73   QFont titleFont() const;
74   void setTitleFont( const QFont & );
75   
76   virtual void showPage( QWidget * );
77   
78   QWidget * currentPage() const;
79   
80   QWidget* page( int ) const;
81   QWidget* page( const QString& ) const;
82   int pageCount() const;
83   int indexOf( QWidget* ) const;
84
85   void addLogo( const QPixmap& );
86   void removeLogos();
87   
88   void showAboutBtn( bool );
89   void setAboutIcon( const QPixmap& );
90   
91   virtual bool appropriate( QWidget * ) const;
92   virtual void setAppropriate( QWidget *, bool );
93   
94   QPushButton * backButton() const;
95   QPushButton * nextButton() const;
96   QPushButton * finishButton() const;
97   QPushButton * cancelButton() const;
98   QPushButton * helpButton() const;
99   
100   bool eventFilter( QObject *, QEvent * );
101   
102 public slots:
103   virtual void setBackEnabled( QWidget *, bool );
104   virtual void setNextEnabled( QWidget *, bool );
105   virtual void setFinishEnabled( QWidget *, bool );
106   
107   virtual void setHelpEnabled( QWidget *, bool );
108   
109   // obsolete
110   virtual void setFinish(  QWidget *, bool ) {}
111   
112 protected slots:
113   virtual void back();
114   virtual void next();
115   virtual void help();
116   
117 signals:
118   void nextClicked();
119   void backClicked();
120   void helpClicked();
121   void aboutClicked();
122   void selected( const QString& );
123   
124 protected:
125   virtual void layOutButtonRow( QHBoxLayout * );
126   virtual void layOutTitleRow( QHBoxLayout *, const QString & );
127   virtual bool acceptData( const QString& );
128   void layOut();
129   void setBackEnabled( bool );
130   void setNextEnabled( bool );
131   
132 private:
133   void setHelpEnabled( bool );
134   
135   void setNextPage( QWidget * );
136   
137   void updateButtons();
138   
139   InstallWizardPrivate *d;
140   
141 private:        // Disabled copy constructor and operator=
142 #if defined(Q_DISABLE_COPY)
143   InstallWizard( const InstallWizard & );
144   InstallWizard& operator=( const InstallWizard & );
145 #endif
146 };
147
148 #endif // InstallWizard_h