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 #ifndef _CEGUIProperty_h_
00028 #define _CEGUIProperty_h_
00029
00030 #include "CEGUIBase.h"
00031 #include "CEGUIString.h"
00032
00033
00034
00035 namespace CEGUI
00036 {
00037
00042 class CEGUIEXPORT PropertyReceiver
00043 {
00044 public:
00045 PropertyReceiver() {}
00046 virtual ~PropertyReceiver() {}
00047 };
00048
00049
00057 class CEGUIEXPORT Property
00058 {
00059 public:
00077 Property(const String& name, const String& help, const String& defaultValue = "", bool writesXML = true) :
00078 d_name(name),
00079 d_help(help),
00080 d_default(defaultValue),
00081 d_writeXML(writesXML)
00082 {
00083 }
00084
00085
00090 virtual ~Property(void) {}
00091
00092
00100 const String& getHelp(void) const {return d_help;}
00101
00102
00110 const String& getName(void) const {return d_name;}
00111
00112
00123 virtual String get(const PropertyReceiver* receiver) const = 0;
00124
00125
00141 virtual void set(PropertyReceiver* receiver, const String& value) = 0;
00142
00143
00155 virtual bool isDefault(const PropertyReceiver* receiver) const;
00156
00157
00168 virtual String getDefault(const PropertyReceiver* receiver) const;
00169
00170
00179 void writeXMLToStream(const PropertyReceiver* receiver, OutStream& out_stream) const;
00180
00181 protected:
00182 String d_name;
00183 String d_help;
00184 String d_default;
00185 bool d_writeXML;
00186 };
00187
00188 }
00189
00190 #endif // end of guard _CEGUIProperty_h_