Crazy Eddie's GUI System  0.8.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::Property Class Referenceabstract

An abstract class that defines the interface to access object properties by name. More...

Inherits CEGUI::AllocatedObject< Property >.

Inherited by CEGUI::TypedProperty< T >, CEGUI::XercesParserProperties::SchemaDefaultResourceGroup, and CEGUI::TypedProperty< String >.

+ Collaboration diagram for CEGUI::Property:

Public Member Functions

 Property (const String &name, const String &help, const String &defaultValue="", bool writesXML=true, const String &dataType="Unknown", const String &origin="Unknown")
 Creates a new Property object. More...
 
virtual ~Property (void)
 Destructor for Property objects.
 
const StringgetHelp (void) const
 Return a String that describes the purpose and usage of this Property. More...
 
const StringgetName (void) const
 Return a the name of this Property. More...
 
const StringgetDataType (void) const
 Return string data type of this Property. More...
 
const StringgetOrigin (void) const
 Return string origin of this Property. More...
 
virtual String get (const PropertyReceiver *receiver) const =0
 Return the current value of the Property as a String. More...
 
virtual void set (PropertyReceiver *receiver, const String &value)=0
 Sets the value of the property. More...
 
virtual bool isDefault (const PropertyReceiver *receiver) const
 Returns whether the property is at it's default value. More...
 
virtual String getDefault (const PropertyReceiver *receiver) const
 Returns the default value of the Property as a String. More...
 
virtual void writeXMLToStream (const PropertyReceiver *receiver, XMLSerializer &xml_stream) const
 Writes out an XML representation of this class to the given stream. More...
 
virtual bool isReadable () const
 Returns whether the property is readable. More...
 
virtual bool isWritable () const
 Returns whether the property is writable. More...
 
virtual bool doesWriteXML () const
 Returns whether the property writes to XML streams.
 
virtual void initialisePropertyReceiver (PropertyReceiver *) const
 function to allow initialisation of a PropertyReceiver.
 
virtual Propertyclone () const =0
 

Static Public Attributes

static const String XMLElementName
 
static const String NameXMLAttributeName
 
static const String ValueXMLAttributeName
 

Protected Attributes

String d_name
 String that stores the Property name.
 
String d_help
 String that stores the Property help text.
 
String d_default
 String that stores the Property default value string.
 
bool d_writeXML
 Specifies whether writeXMLToStream should do anything for this property.
 
String d_dataType
 Holds data type of this property.
 
String d_origin
 Holds origin of this property.
 

Detailed Description

An abstract class that defines the interface to access object properties by name.

Property objects allow (via a PropertySet) access to certain properties of objects by using simple get/set functions and the name of the property to be accessed.

Constructor & Destructor Documentation

CEGUI::Property::Property ( const String name,
const String help,
const String defaultValue = "",
bool  writesXML = true,
const String dataType = "Unknown",
const String origin = "Unknown" 
)
inline

Creates a new Property object.

Parameters
nameString containing the name of the new Property.
helpString containing a description of the Property and it's usage.
defaultValueString holding the textual representation of the default value for this Property
writesXMLSpecifies whether the writeXMLToStream method should do anything for this Property. This enables selectivity in what properties within a PropertySet will get output as XML.
dataTypeString representation of the data type this property is held in ("int", "UVector2", ...)
originString describing the origin class of this Property (Window, FrameWindow, ...)

Member Function Documentation

virtual String CEGUI::Property::get ( const PropertyReceiver receiver) const
pure virtual

Return the current value of the Property as a String.

Parameters
receiverPointer to the target object.
Returns
String object containing a textual representation of the current value of the Property

Implemented in CEGUI::TypedProperty< T >, CEGUI::TypedProperty< String >, and CEGUI::XercesParserProperties::SchemaDefaultResourceGroup.

Referenced by CEGUI::PropertySet::getProperty().

const String& CEGUI::Property::getDataType ( void  ) const
inline

Return string data type of this Property.

Returns
String containing the data type of the Property
virtual String CEGUI::Property::getDefault ( const PropertyReceiver receiver) const
virtual

Returns the default value of the Property as a String.

Parameters
receiverPointer to the target object.
Returns
String object containing a textual representation of the default value for this property.
const String& CEGUI::Property::getHelp ( void  ) const
inline

Return a String that describes the purpose and usage of this Property.

Returns
String that contains the help text
const String& CEGUI::Property::getName ( void  ) const
inline

Return a the name of this Property.

Returns
String containing the name of the Property
const String& CEGUI::Property::getOrigin ( void  ) const
inline

Return string origin of this Property.

Returns
String containing the origin of the Property
virtual bool CEGUI::Property::isDefault ( const PropertyReceiver receiver) const
virtual

Returns whether the property is at it's default value.

Parameters
receiverPointer to the target object.
Returns
  • true if the property has it's default value.
  • false if the property has been modified from it's default value.
virtual bool CEGUI::Property::isReadable ( ) const
virtual

Returns whether the property is readable.

Returns
  • true if the property is readable.
  • false if the property isn't readable.

Reimplemented in CEGUI::TplProperty< C, T >, and CEGUI::TplProperty< Window, String >.

Referenced by CEGUI::TypedProperty< String >::getNative().

virtual bool CEGUI::Property::isWritable ( ) const
virtual

Returns whether the property is writable.

Returns
  • true if the property is writable.
  • false if the property isn't writable.

Reimplemented in CEGUI::TplProperty< C, T >, and CEGUI::TplProperty< Window, String >.

Referenced by CEGUI::TypedProperty< String >::setNative().

virtual void CEGUI::Property::set ( PropertyReceiver receiver,
const String value 
)
pure virtual

Sets the value of the property.

Parameters
receiverPointer to the target object.
valueA String object that contains a textual representation of the new value to assign to the Property.
Returns
Nothing.
Exceptions
InvalidRequestExceptionThrown when the Property was unable to interpret the content of value.

Implemented in CEGUI::TypedProperty< T >, CEGUI::TypedProperty< String >, and CEGUI::XercesParserProperties::SchemaDefaultResourceGroup.

Referenced by CEGUI::PropertySet::setProperty().

virtual void CEGUI::Property::writeXMLToStream ( const PropertyReceiver receiver,
XMLSerializer xml_stream 
) const
virtual

Writes out an XML representation of this class to the given stream.

Note
This would normally have been implemented via XMLGenerator base class, but in this case we require the target PropertyReceiver in order to obtain the property value.

Reimplemented in CEGUI::Window::LookNFeelProperty, and CEGUI::Window::WindowRendererProperty.