libyui  3.3.1
YFrame.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: YFrame.h
20 
21  Author: Stefan Hundhammer <sh@suse.de>
22 
23 /-*/
24 
25 #ifndef YFrame_h
26 #define YFrame_h
27 
28 #include <string>
29 #include "YSingleChildContainerWidget.h"
30 #include "ImplPtr.h"
31 
32 class YFramePrivate;
33 
34 
35 /**
36  * A labeled framed container.
37  **/
39 {
40 protected:
41  /**
42  * Constructor.
43  **/
44  YFrame( YWidget * parent, const std::string & label );
45 
46 public:
47  /**
48  * Destructor.
49  **/
50  virtual ~YFrame();
51 
52  /**
53  * Returns a descriptive name of this widget class for logging,
54  * debugging etc.
55  **/
56  virtual const char * widgetClass() const { return "YFrame"; }
57 
58  /**
59  * Change the frame label.
60  *
61  * Derived classes should overwrite this, but call this base class function
62  * in the overwritten function.
63  **/
64  virtual void setLabel( const std::string & newLabel );
65 
66  /**
67  * Get the current frame label.
68  **/
69  std::string label() const;
70 
71  /**
72  * Set a property.
73  * Reimplemented from YWidget.
74  *
75  * This method may throw exceptions, for example
76  * - if there is no property with that name
77  * - if the expected type and the type mismatch
78  * - if the value is out of range
79  *
80  * This function returns 'true' if the value was successfully set and
81  * 'false' if that value requires special handling (not in error cases:
82  * those are covered by exceptions).
83  **/
84  virtual bool setProperty( const std::string & propertyName,
85  const YPropertyValue & val );
86 
87  /**
88  * Get a property.
89  * Reimplemented from YWidget.
90  *
91  * This method may throw exceptions, for example
92  * - if there is no property with that name
93  **/
94  virtual YPropertyValue getProperty( const std::string & propertyName );
95 
96  /**
97  * Return this class's property set.
98  * This also initializes the property set upon the first call.
99  *
100  * Reimplemented from YWidget.
101  **/
102  virtual const YPropertySet & propertySet();
103 
104 
105 private:
106 
108 };
109 
110 
111 #endif // YFrame_h
YFrame(YWidget *parent, const std::string &label)
Constructor.
Definition: YFrame.cc:45
std::string label() const
Get the current frame label.
Definition: YFrame.cc:65
virtual ~YFrame()
Destructor.
Definition: YFrame.cc:53
virtual void setLabel(const std::string &newLabel)
Change the frame label.
Definition: YFrame.cc:59
Transport class for the value of simple properties.
Definition: YProperty.h:104
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
Definition: YFrame.cc:91
A set of properties to check names and types against.
Definition: YProperty.h:197
A labeled framed container.
Definition: YFrame.h:38
YWidget * parent() const
Return this widget&#39;s parent or 0 if it doesn&#39;t have a parent.
Definition: YWidget.cc:269
Container widget class that manages one child.
virtual const char * widgetClass() const
Returns a descriptive name of this widget class for logging, debugging etc.
Definition: YFrame.h:56
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
Definition: YFrame.cc:106
virtual const YPropertySet & propertySet()
Return this class&#39;s property set.
Definition: YFrame.cc:72
Abstract base class of all UI widgets.
Definition: YWidget.h:54