35b60cf9dcbdab239782adb78859bc5351e933f1
[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 class YWidgetID;
30
31
32 class YQWizardButton : public YQGenericButton
33 {
34     Q_OBJECT
35
36 public:
37     /**
38      * Constructor.
39      **/
40     YQWizardButton( YQWizard *          wizard,
41                     QWidget *           buttonParent,
42                     const string &      label,
43                     YWidgetID *         id = 0 );
44
45     /**
46      * Destructor.
47      **/
48     virtual ~YQWizardButton();
49
50     /**
51      * Returns a descriptive name of this widget class for logging,
52      * debugging etc.
53      **/
54     virtual const char *widgetClass() const { return "YQWizardButton"; }
55
56     /**
57      * Hide the associated QPushButton.
58      **/
59     void hide();
60
61     /**
62      * Show the associated QPushButton - not this widget itself (!).
63      * This widget itself will never become visible.
64      **/
65     void show();
66
67     /**
68      * Returns 'true' if the associated QPushButton (!) is shown.
69      **/
70     bool isShown() const;
71         
72     /**
73      * Returns 'true' if the associated QPushButton (!) is hidden.
74      **/
75     bool isHidden() const;
76         
77     /**
78      * Preferred width of the widget.
79      *
80      * Reimplemented from YWidget.
81      **/
82     virtual int preferredWidth();
83
84     /**
85      * Preferred height of the widget.
86      *
87      * Reimplemented from YWidget.
88      **/
89     virtual int preferredHeight();
90
91     /**
92      * Set the new size of the widget.
93      *
94      * Reimplemented from YWidget.
95      **/
96     virtual void setSize( int newWidth, int newHeight );
97
98     /**
99      * Returns the wizard this wizard button belongs to.
100      **/
101     YQWizard * wizard() const { return _wizard; }
102
103 signals:
104
105     /**
106      * Emitted when the button is clicked or otherwise activated.
107      **/
108     void clicked();
109
110     
111 private:
112
113     YQWizard * _wizard;
114 };
115
116 #endif // YQWizardButton_h