libyui
 
Loading...
Searching...
No Matches
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
31
32
33
37class YPushButton : public YWidget
38{
39protected:
43 YPushButton( YWidget * parent, const std::string & label );
44
45public:
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
226private:
227
229};
230
231
232std::ostream & operator<<( std::ostream & stream, YButtonRole role );
233
234
235typedef YPushButton YIconButton;
236
237
238#endif // YPushButton_h
Definition ImplPtr.h:43
Definition YProperty.h:198
Definition YProperty.h:105
Definition YPushButton.h:38
virtual void activate()=0
bool isDefaultButton() const
Definition YPushButton.cc:92
virtual void setRole(YButtonRole role)
Definition YPushButton.cc:154
virtual void setRelNotesButton(bool relNotesButton=true)
Definition YPushButton.cc:145
virtual std::string shortcutString() const
Definition YPushButton.h:208
virtual void setShortcutString(const std::string &str)
Definition YPushButton.h:215
virtual void setLabel(const std::string &label)
Definition YPushButton.cc:80
virtual ~YPushButton()
Definition YPushButton.cc:69
virtual void setIcon(const std::string &iconName)
Definition YPushButton.h:77
bool isHelpButton() const
Definition YPushButton.cc:127
virtual const char * widgetClass() const
Definition YPushButton.h:55
virtual void setHelpButton(bool helpButton=true)
Definition YPushButton.cc:133
std::string label() const
Definition YPushButton.cc:86
YPushButton(YWidget *parent, const std::string &label)
Definition YPushButton.cc:58
bool isRelNotesButton() const
Definition YPushButton.cc:139
YButtonRole role() const
Definition YPushButton.cc:178
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Definition YPushButton.cc:230
virtual void setDefaultButton(bool def=true)
Definition YPushButton.cc:98
virtual void setFunctionKey(int fkey_no)
Definition YPushButton.cc:186
virtual const YPropertySet & propertySet()
Definition YPushButton.cc:212
virtual YPropertyValue getProperty(const std::string &propertyName)
Definition YPushButton.cc:245
YWidget(YWidget *parent)
Definition YWidget.cc:106
YWidget * parent() const
Definition YWidget.cc:277
Definition YPushButton.cc:39