Crazy Eddie's GUI System  0.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::PropertySet Class Reference

Class that contains a collection of Property objects. More...

Inherits CEGUI::PropertyReceiver.

Inherited by CEGUI::Element, CEGUI::Font, and CEGUI::XMLParser.

+ Collaboration diagram for CEGUI::PropertySet:

Public Types

typedef ConstMapIterator
< PropertyRegistry > 
PropertyIterator
 

Public Member Functions

 PropertySet (void)
 Constructs a new PropertySet object.
 
virtual ~PropertySet (void)
 Destructor for PropertySet objects.
 
void addProperty (Property *property)
 Adds a new Property to the PropertySet. More...
 
void removeProperty (const String &name)
 Removes a Property from the PropertySet. More...
 
PropertygetPropertyInstance (const String &name) const
 Retrieves a property instance (that was previously added) More...
 
void clearProperties (void)
 Removes all Property objects from the PropertySet. More...
 
bool isPropertyPresent (const String &name) const
 Checks to see if a Property with the given name is in the PropertySet. More...
 
const StringgetPropertyHelp (const String &name) const
 Return the help text for the specified Property. More...
 
String getProperty (const String &name) const
 Gets the current value of the specified Property. More...
 
template<typename T >
PropertyHelper< T >::return_type getProperty (const String &name) const
 Gets the current value of the specified Property. More...
 
void setProperty (const String &name, const String &value)
 Sets the current value of a Property. More...
 
template<typename T >
void setProperty (const String &name, typename PropertyHelper< T >::pass_type value)
 Sets the current value of a Property. More...
 
bool isPropertyDefault (const String &name) const
 Returns whether a Property is at it's default value. More...
 
String getPropertyDefault (const String &name) const
 Returns the default value of a Property as a String. More...
 
PropertyIterator getPropertyIterator (void) const
 Return a PropertySet::PropertyIterator object to iterate over the available Properties.
 

Detailed Description

Class that contains a collection of Property objects.

Member Function Documentation

void CEGUI::PropertySet::addProperty ( Property property)

Adds a new Property to the PropertySet.

Parameters
propertyPointer to the Property object to be added to the PropertySet.
Returns
Nothing.
Exceptions
NullObjectExceptionThrown if property is NULL.
AlreadyExistsExceptionThrown if a Property with the same name as property already exists in the PropertySet
void CEGUI::PropertySet::clearProperties ( void  )

Removes all Property objects from the PropertySet.

Returns
Nothing.
String CEGUI::PropertySet::getProperty ( const String name) const

Gets the current value of the specified Property.

Parameters
nameString containing the name of the Property who's value is to be returned.
Returns
String object containing a textual representation of the requested Property.
Exceptions
UnknownObjectExceptionThrown if no Property named name is in the PropertySet.
template<typename T >
PropertyHelper<T>::return_type CEGUI::PropertySet::getProperty ( const String name) const
inline

Gets the current value of the specified Property.

Parameters
nameString containing the name of the Property who's value is to be returned.
Returns
String object containing a textual representation of the requested Property.
Exceptions
UnknownObjectExceptionThrown if no Property named name is in the PropertySet.

References CEGUI::Property::get(), and CEGUI::TypedProperty< T >::getNative().

String CEGUI::PropertySet::getPropertyDefault ( const String name) const

Returns the default value of a Property as a String.

Parameters
nameString containing the name of the Property who's default string is to be returned.
Returns
String object containing a textual representation of the default value for this property.
const String& CEGUI::PropertySet::getPropertyHelp ( const String name) const

Return the help text for the specified Property.

Parameters
nameString holding the name of the Property who's help text is to be returned.
Returns
String object containing the help text for the Property name.
Exceptions
UnknownObjectExceptionThrown if no Property named name is in the PropertySet.
Property* CEGUI::PropertySet::getPropertyInstance ( const String name) const

Retrieves a property instance (that was previously added)

Parameters
nameString containing the name of the Property to be retrieved. If Property name is not in the set, exception is thrown.
Returns
Pointer to the property instance
bool CEGUI::PropertySet::isPropertyDefault ( const String name) const

Returns whether a Property is at it's default value.

Parameters
nameString containing the name of the Property who's default state is to be tested.
Returns
  • true if the property has it's default value.
  • false if the property has been modified from it's default value.
bool CEGUI::PropertySet::isPropertyPresent ( const String name) const

Checks to see if a Property with the given name is in the PropertySet.

Parameters
nameString containing the name of the Property to check for.
Returns
true if a Property named name is in the PropertySet. false if no Property named name is in the PropertySet.
void CEGUI::PropertySet::removeProperty ( const String name)

Removes a Property from the PropertySet.

Parameters
nameString containing the name of the Property to be removed. If Property name is not in the set, nothing happens.
Returns
Nothing.
void CEGUI::PropertySet::setProperty ( const String name,
const String value 
)

Sets the current value of a Property.

Parameters
nameString containing the name of the Property who's value is to be set.
valueString containing a textual representation of the new value for the Property
Returns
Nothing
Exceptions
UnknownObjectExceptionThrown if no Property named name is in the PropertySet.
InvalidRequestExceptionThrown when the Property was unable to interpret the content of value.
template<typename T >
void CEGUI::PropertySet::setProperty ( const String name,
typename PropertyHelper< T >::pass_type  value 
)
inline

Sets the current value of a Property.

Parameters
nameString containing the name of the Property who's value is to be set.
valueString containing a textual representation of the new value for the Property
Returns
Nothing
Exceptions
UnknownObjectExceptionThrown if no Property named name is in the PropertySet.
InvalidRequestExceptionThrown when the Property was unable to interpret the content of value.

References CEGUI::Property::set(), and CEGUI::TypedProperty< T >::setNative().