Salome HOME
47dbd38fb198f30dc25ed338db9454efb7662084
[tools/install.git] / src / InstallWizard.h
1 //  File      : InstallWizard.h
2 //  Created   : Thu Mar 27 12:01:00 2003
3 //  Author    : Vadim SANDLER
4 //  Project   : PAL/SALOME
5 //  Module    : InstallWizard
6 //  Copyright : 2004 CEA
7 //  $Header$ 
8
9 #ifndef InstallWizard_h
10 #define InstallWizard_h
11
12 #include "qdialog.h"
13
14 /*!
15   This is the patched QWizard class
16 */
17 class QHBoxLayout;
18 class InstallWizardPrivate;
19
20 class InstallWizard : public QDialog
21 {
22   Q_OBJECT
23     
24 public:
25   InstallWizard( QWidget* parent=0, const char* name=0, bool modal=FALSE, WFlags f=0 );
26   ~InstallWizard();
27   
28   void show();
29   
30   void setFont( const QFont & font );
31   
32   virtual void addPage( QWidget *, const QString & );
33   virtual void insertPage( QWidget*, const QString&, int );
34   virtual void removePage( QWidget * );
35   
36   QString title( QWidget * ) const;
37   void setTitle( QWidget *, const QString & );
38   QFont titleFont() const;
39   void setTitleFont( const QFont & );
40   
41   virtual void showPage( QWidget * );
42   
43   QWidget * currentPage() const;
44   
45   QWidget* page( int ) const;
46   QWidget* page( const QString& title ) const;
47   int pageCount() const;
48   int indexOf( QWidget* ) const;
49
50   void addLogo( const QPixmap& pm );
51   void removeLogos();
52   
53   virtual bool appropriate( QWidget * ) const;
54   virtual void setAppropriate( QWidget *, bool );
55   
56   QPushButton * backButton() const;
57   QPushButton * nextButton() const;
58   QPushButton * finishButton() const;
59   QPushButton * cancelButton() const;
60   QPushButton * helpButton() const;
61   
62   bool eventFilter( QObject *, QEvent * );
63   
64 public slots:
65   virtual void setBackEnabled( QWidget *, bool );
66   virtual void setNextEnabled( QWidget *, bool );
67   virtual void setFinishEnabled( QWidget *, bool );
68   
69   virtual void setHelpEnabled( QWidget *, bool );
70   
71   // obsolete
72   virtual void setFinish(  QWidget *, bool ) {}
73   
74 protected slots:
75   virtual void back();
76   virtual void next();
77   virtual void help();
78   
79 signals:
80   void helpClicked();
81   void selected( const QString& );
82   
83 protected:
84   virtual void layOutButtonRow( QHBoxLayout * );
85   virtual void layOutTitleRow( QHBoxLayout *, const QString & );
86   virtual bool acceptData( const QString& );
87   void layOut();
88   
89 private:
90   void setBackEnabled( bool );
91   void setNextEnabled( bool );
92   
93   void setHelpEnabled( bool );
94   
95   void setNextPage( QWidget * );
96   
97   void updateButtons();
98   
99   InstallWizardPrivate *d;
100   
101 private:        // Disabled copy constructor and operator=
102 #if defined(Q_DISABLE_COPY)
103   InstallWizard( const InstallWizard & );
104   InstallWizard& operator=( const InstallWizard & );
105 #endif
106 };
107
108 #endif // InstallWizard_h