libyui
YPushButton.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: YPushButton.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 #ifndef YPushButton_h
26 #define YPushButton_h
27 
28 #include "YWidget.h"
29 
30 class YPushButtonPrivate;
31 
32 
33 
37 class YPushButton : public YWidget
38 {
39 protected:
43  YPushButton( YWidget * parent, const std::string & label );
44 
45 public:
49  virtual ~YPushButton();
50 
55  virtual const char * widgetClass() const { return "YPushButton"; }
56 
60  std::string label() const;
61 
68  virtual void setLabel( const std::string & label );
69 
77  virtual void setIcon( const std::string & iconName ) {}
78 
84  bool isDefaultButton() const;
85 
92  virtual void setDefaultButton( bool def = true );
93 
113  virtual void setRole( YButtonRole role );
114 
118  YButtonRole role() const;
119 
129  virtual void setFunctionKey( int fkey_no );
130 
131 
145  bool isHelpButton() const;
146 
153  virtual void setHelpButton( bool helpButton = true );
154 
164  bool isRelNotesButton() const;
165 
172  virtual void setRelNotesButton( bool relNotesButton = true );
173 
184  virtual bool setProperty( const std::string & propertyName,
185  const YPropertyValue & val );
186 
193  virtual YPropertyValue getProperty( const std::string & propertyName );
194 
201  virtual const YPropertySet & propertySet();
202 
208  virtual std::string shortcutString() const { return label(); }
209 
215  virtual void setShortcutString( const std::string & str )
216  { setLabel( str ); }
217 
218 
224  virtual void activate() = 0;
225 
226 private:
227 
229 };
230 
231 
232 std::ostream & operator<<( std::ostream & stream, YButtonRole role );
233 
234 
235 typedef YPushButton YIconButton;
236 
237 
238 #endif // YPushButton_h
Definition: YPushButton.cc:38
bool isHelpButton() const
Definition: YPushButton.cc:127
Definition: YProperty.h:104
bool isDefaultButton() const
Definition: YPushButton.cc:92
virtual void setDefaultButton(bool def=true)
Definition: YPushButton.cc:98
Definition: YProperty.h:197
YWidget * parent() const
Definition: YWidget.cc:271
virtual ~YPushButton()
Definition: YPushButton.cc:69
virtual const char * widgetClass() const
Definition: YPushButton.h:55
virtual void setShortcutString(const std::string &str)
Definition: YPushButton.h:215
virtual void activate()=0
std::string label() const
Definition: YPushButton.cc:86
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition: YPushButton.cc:230
virtual std::string shortcutString() const
Definition: YPushButton.h:208
virtual const YPropertySet & propertySet()
Definition: YPushButton.cc:212
Definition: YPushButton.h:37
virtual void setRole(YButtonRole role)
Definition: YPushButton.cc:154
virtual void setIcon(const std::string &iconName)
Definition: YPushButton.h:77
YButtonRole role() const
Definition: YPushButton.cc:178
virtual void setFunctionKey(int fkey_no)
Definition: YPushButton.cc:186
virtual void setRelNotesButton(bool relNotesButton=true)
Definition: YPushButton.cc:145
bool isRelNotesButton() const
Definition: YPushButton.cc:139
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition: YPushButton.cc:245
YPushButton(YWidget *parent, const std::string &label)
Definition: YPushButton.cc:58
virtual void setLabel(const std::string &label)
Definition: YPushButton.cc:80
Definition: YWidget.h:54
virtual void setHelpButton(bool helpButton=true)
Definition: YPushButton.cc:133