libyui
3.0.10
|
00001 /* 00002 Copyright (C) 2000-2012 Novell, Inc 00003 This library is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU Lesser General Public License as 00005 published by the Free Software Foundation; either version 2.1 of the 00006 License, or (at your option) version 3.0 of the License. This library 00007 is distributed in the hope that it will be useful, but WITHOUT ANY 00008 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00009 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00010 License for more details. You should have received a copy of the GNU 00011 Lesser General Public License along with this library; if not, write 00012 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 00013 Floor, Boston, MA 02110-1301 USA 00014 */ 00015 00016 00017 /*-/ 00018 00019 File: YFrame.h 00020 00021 Author: Stefan Hundhammer <sh@suse.de> 00022 00023 /-*/ 00024 00025 #ifndef YFrame_h 00026 #define YFrame_h 00027 00028 #include <string> 00029 #include "YSingleChildContainerWidget.h" 00030 #include "ImplPtr.h" 00031 00032 class YFramePrivate; 00033 00034 00035 class YFrame : public YSingleChildContainerWidget 00036 { 00037 protected: 00038 /** 00039 * Constructor. 00040 **/ 00041 YFrame( YWidget * parent, const std::string & label ); 00042 00043 public: 00044 /** 00045 * Destructor. 00046 **/ 00047 virtual ~YFrame(); 00048 00049 /** 00050 * Returns a descriptive name of this widget class for logging, 00051 * debugging etc. 00052 **/ 00053 virtual const char * widgetClass() const { return "YFrame"; } 00054 00055 /** 00056 * Change the frame label. 00057 * 00058 * Derived classes should overwrite this, but call this base class function 00059 * in the overwritten function. 00060 **/ 00061 virtual void setLabel( const std::string & newLabel ); 00062 00063 /** 00064 * Get the current frame label. 00065 **/ 00066 std::string label() const; 00067 00068 /** 00069 * Set a property. 00070 * Reimplemented from YWidget. 00071 * 00072 * This method may throw exceptions, for example 00073 * - if there is no property with that name 00074 * - if the expected type and the type mismatch 00075 * - if the value is out of range 00076 * 00077 * This function returns 'true' if the value was successfully set and 00078 * 'false' if that value requires special handling (not in error cases: 00079 * those are covered by exceptions). 00080 **/ 00081 virtual bool setProperty( const std::string & propertyName, 00082 const YPropertyValue & val ); 00083 00084 /** 00085 * Get a property. 00086 * Reimplemented from YWidget. 00087 * 00088 * This method may throw exceptions, for example 00089 * - if there is no property with that name 00090 **/ 00091 virtual YPropertyValue getProperty( const std::string & propertyName ); 00092 00093 /** 00094 * Return this class's property set. 00095 * This also initializes the property set upon the first call. 00096 * 00097 * Reimplemented from YWidget. 00098 **/ 00099 virtual const YPropertySet & propertySet(); 00100 00101 00102 private: 00103 00104 ImplPtr<YFramePrivate> priv; 00105 }; 00106 00107 00108 #endif // YFrame_h