00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _CEGUIProperty_h_
00032 #define _CEGUIProperty_h_
00033
00034 #include "CEGUIBase.h"
00035 #include "CEGUIString.h"
00036 #include "CEGUIXMLSerializer.h"
00037
00038
00039 namespace CEGUI
00040 {
00041
00046 class CEGUIEXPORT PropertyReceiver
00047 {
00048 public:
00049 PropertyReceiver() {}
00050 virtual ~PropertyReceiver() {}
00051 };
00052
00053
00061 class CEGUIEXPORT Property
00062 {
00063 public:
00081 Property(const String& name, const String& help, const String& defaultValue = "", bool writesXML = true) :
00082 d_name(name),
00083 d_help(help),
00084 d_default(defaultValue),
00085 d_writeXML(writesXML)
00086 {
00087 }
00088
00089
00094 virtual ~Property(void) {}
00095
00096
00104 const String& getHelp(void) const {return d_help;}
00105
00106
00114 const String& getName(void) const {return d_name;}
00115
00116
00127 virtual String get(const PropertyReceiver* receiver) const = 0;
00128
00129
00145 virtual void set(PropertyReceiver* receiver, const String& value) = 0;
00146
00147
00159 virtual bool isDefault(const PropertyReceiver* receiver) const;
00160
00161
00172 virtual String getDefault(const PropertyReceiver* receiver) const;
00173
00174
00183 virtual void writeXMLToStream(const PropertyReceiver* receiver, XMLSerializer& xml_stream) const;
00184
00185 protected:
00186 String d_name;
00187 String d_help;
00188 String d_default;
00189 bool d_writeXML;
00190 };
00191
00192 }
00193
00194 #endif // end of guard _CEGUIProperty_h_