- Don't create layouts with parent. Qt 4.x automatically reparents
[duncan/yast2-qt4.git] / src / YQWizardButton.h
1 /*---------------------------------------------------------------------\
2 |                                                                      |
3 |                      __   __    ____ _____ ____                      |
4 |                      \ \ / /_ _/ ___|_   _|___ \                     |
5 |                       \ V / _` \___ \ | |   __) |                    |
6 |                        | | (_| |___) || |  / __/                     |
7 |                        |_|\__,_|____/ |_| |_____|                    |
8 |                                                                      |
9 |                               core system                            |
10 |                                                        (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12
13   File:       YQWizardButton.h
14
15   Author:     Stefan Hundhammer <sh@suse.de>
16
17 /-*/
18
19
20 #ifndef YQWizardButton_h
21 #define YQWizardButton_h
22
23 #include <qwidget.h>
24 #include "YQGenericButton.h"
25
26 using std::string;
27 class YQDialog;
28 class YQWizard;
29
30
31 class YQWizardButton : public YQGenericButton
32 {
33     Q_OBJECT
34
35 public:
36     /**
37      * Constructor.
38      **/
39     YQWizardButton( YQWizard *          wizard,
40                     QWidget *           buttonParent,
41                     const string &      label );
42
43     /**
44      * Destructor.
45      **/
46     virtual ~YQWizardButton();
47
48     /**
49      * Returns a descriptive name of this widget class for logging,
50      * debugging etc.
51      **/
52     virtual const char *widgetClass() const { return "YQWizardButton"; }
53
54     /**
55      * Hide the associated QPushButton.
56      **/
57     void hide();
58
59     /**
60      * Show the associated QPushButton - not this widget itself (!).
61      * This widget itself will never become visible.
62      **/
63     void show();
64
65     /**
66      * Returns 'true' if the associated QPushButton (!) is shown.
67      **/
68     bool isShown() const;
69         
70     /**
71      * Returns 'true' if the associated QPushButton (!) is hidden.
72      **/
73     bool isHidden() const;
74         
75     /**
76      * Preferred width of the widget.
77      *
78      * Reimplemented from YWidget.
79      **/
80     virtual int preferredWidth();
81
82     /**
83      * Preferred height of the widget.
84      *
85      * Reimplemented from YWidget.
86      **/
87     virtual int preferredHeight();
88
89     /**
90      * Set the new size of the widget.
91      *
92      * Reimplemented from YWidget.
93      **/
94     virtual void setSize( int newWidth, int newHeight );
95
96     /**
97      * Returns the wizard this wizard button belongs to.
98      **/
99     YQWizard * wizard() const { return _wizard; }
100
101 signals:
102
103     /**
104      * Emitted when the button is clicked or otherwise activated.
105      **/
106     void clicked();
107
108     
109 private:
110
111     YQWizard * _wizard;
112 };
113
114 #endif // YQWizardButton_h