libyui-qt  2.46.13
YQWizardButton.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YQWizardButton.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YQWizardButton_h
27 #define YQWizardButton_h
28 
29 #include <qwidget.h>
30 #include "YQGenericButton.h"
31 
32 using std::string;
33 class YQDialog;
34 class YQWizard;
35 
36 
38 {
39  Q_OBJECT
40 
41 public:
42  /**
43  * Constructor.
44  **/
46  QWidget * buttonParent,
47  const std::string & label );
48 
49  /**
50  * Destructor.
51  **/
52  virtual ~YQWizardButton();
53 
54  /**
55  * Returns a descriptive name of this widget class for logging,
56  * debugging etc.
57  **/
58  virtual const char *widgetClass() const { return "YQWizardButton"; }
59 
60  /**
61  * Hide the associated QPushButton.
62  **/
63  void hide();
64 
65  /**
66  * Show the associated QPushButton - not this widget itself (!).
67  * This widget itself will never become visible.
68  **/
69  void show();
70 
71  /**
72  * Returns 'true' if the associated QPushButton (!) is shown.
73  **/
74  bool isShown() const;
75 
76  /**
77  * Returns 'true' if the associated QPushButton (!) is hidden.
78  **/
79  bool isHidden() const;
80 
81  /**
82  * Preferred width of the widget.
83  *
84  * Reimplemented from YWidget.
85  **/
86  virtual int preferredWidth();
87 
88  /**
89  * Preferred height of the widget.
90  *
91  * Reimplemented from YWidget.
92  **/
93  virtual int preferredHeight();
94 
95  /**
96  * Set the new size of the widget.
97  *
98  * Reimplemented from YWidget.
99  **/
100  virtual void setSize( int newWidth, int newHeight );
101 
102  /**
103  * Returns the wizard this wizard button belongs to.
104  **/
105  YQWizard * wizard() const { return _wizard; }
106 
107 signals:
108 
109  /**
110  * Emitted when the button is clicked or otherwise activated.
111  **/
112  void clicked();
113 
114 
115 private:
116 
117  YQWizard * _wizard;
118 };
119 
120 #endif // YQWizardButton_h
void clicked()
Emitted when the button is clicked or otherwise activated.
bool isShown() const
Returns 'true' if the associated QPushButton (!) is shown.
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
YQWizardButton(YQWizard *wizard, QWidget *buttonParent, const std::string &label)
Constructor.
YQWizard * wizard() const
Returns the wizard this wizard button belongs to.
virtual int preferredHeight()
Preferred height of the widget.
Abstract base class for push button and similar widgets - all that can become a YQDialog's "default b...
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
virtual int preferredWidth()
Preferred width of the widget.
void hide()
Hide the associated QPushButton.
bool isHidden() const
Returns 'true' if the associated QPushButton (!) is hidden.
virtual ~YQWizardButton()
Destructor.
void show()
Show the associated QPushButton - not this widget itself (!).