VCF::Property Class Reference
The Property class represents a member attribute of a class. More...
#include <vcf/FoundationKit/Property.h>
Public Member Functions | |
| Property () | |
| Property (const Property &prop) | |
| virtual | ~Property () |
| Property & | operator= (const Property &rhs) |
| virtual Property * | clone ()=0 |
| makes a copy of the property. | |
| String | getName () const |
| gets the name of the property. | |
| String | getDisplayName () const |
| returns the display name, usually something longer and more descriptive than the name alone. | |
| String | getDescription () const |
| gets a description of the property, telling what the property does or represents. | |
| void | setDescription (const String &description) |
| sets the description of the property | |
| void | setDisplayName (const String &displayName) |
| sets the display name of the property | |
| void | setName (const String &name) |
| sets the name of the property | |
| virtual String | getTypeClassName ()=0 |
| This function returns the class name of the property's type. | |
| PropertyDescriptorType | getType () const |
| returns the type of the Property. | |
| void | setType (const PropertyDescriptorType &type) |
| sets the type of the Property | |
| virtual VariantData * | get (Object *source)=0 |
| gets the value of the property for the given instance of source. | |
| virtual void | set (Object *source, VariantData *value)=0 |
| sets a value on an object. | |
| virtual String | toString () |
| void | setSource (Object *source) |
| sets the source for the Property instance. | |
| Object * | getSource () |
| returns the object source that is associated with this property instance. | |
| VariantData * | get () |
| returns a VariandData object that represents the value of this property on the source object that was specified in the setSource() method. | |
| void | set (VariantData *value) |
| sets the value specified in the VariantData object passed in on the source obejct that was specified in the setSource() method. | |
| virtual void | set (Object *source, const String &value) |
| calls the value_'s setFromString method which converts the string into the right type and then calls set() | |
| void | set (const String &value) |
| convenience method for calling set on propertys that have their source assigned to a valid pointer. | |
| bool | isCollection () |
| returns whether or not the property represents a collection if the result is true, then it is safe to call the hasMoreElements() and nextElement() methods. | |
| virtual bool | hasMoreElements (Object *source) |
| returns whether or not the property collection has more elements | |
| virtual VariantData * | nextElement (Object *source) |
| returns the next element in the collection, currently only forward iterating. | |
| virtual void | startCollection (Object *source) |
| We can't call get() to grab the collection directly, since an Enumerator is a templated class, and this point we don't know the template type. | |
| void | startCollection () |
| void | add (VariantData *value) |
| virtual void | add (Object *source, VariantData *value) |
| virtual void | insert (Object *source, const uint32 &index, VariantData *value) |
| void | insert (const uint32 &index, VariantData *value) |
| virtual void | remove (Object *source, VariantData *value) |
| void | remove (VariantData *value) |
| virtual void | remove (Object *source, const uint32 &index) |
| void | remove (const uint32 &index) |
| virtual bool | collectionSupportsEditing () |
| bool | isReadOnly () |
| bool | isBound () |
| returns whether or not the property is "bound" to an object. | |
| void | setBound (const bool &bound) |
Public Attributes | |
| VCF::Delegate | PropertyChanged |
Protected Attributes | |
| VariantData | value_ |
| bool | isCollection_ |
| bool | isReadOnly_ |
Detailed Description
The Property class represents a member attribute of a class.Properties allow a programmer to dynamically query a class at runtime for all of it attributes with out knowing the exact type of class the object instance is. Property is an abstract base class, and only provides an interface to work with.
- Author:
- Jim Crafton
- Version:
- 1.0
Constructor & Destructor Documentation
|
|
|
|
|
|
|
|
|
Member Function Documentation
|
||||||||||||
|
|
|
|
|
|
|
makes a copy of the property. Implemented in the templated derived classes. |
|
|
|
|
|
returns a VariandData object that represents the value of this property on the source object that was specified in the setSource() method.
|
|
|
gets the value of the property for the given instance of source.
|
|
|
gets a description of the property, telling what the property does or represents.
|
|
|
returns the display name, usually something longer and more descriptive than the name alone.
|
|
|
gets the name of the property.
|
|
|
returns the object source that is associated with this property instance.
|
|
|
returns the type of the Property. These are the same types as VariantData::type. They can be int, long, uint32, short, float, double, char, bool, string, enums or Object*. |
|
|
This function returns the class name of the property's type. For primitive types it will return the primitive type name, i.e. for a property of type long it will return "long", while a property of type Color will return "VCF::Color".
|
|
|
returns whether or not the property collection has more elements
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
returns whether or not the property is "bound" to an object. "Bound" properties cause a onPropertyChanged() method to be fired in any listeners whenever the property's set() method is called |
|
|
returns whether or not the property represents a collection if the result is true, then it is safe to call the hasMoreElements() and nextElement() methods.
|
|
|
|
|
|
returns the next element in the collection, currently only forward iterating. Also no support for getting an item from an index |
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
|
convenience method for calling set on propertys that have their source assigned to a valid pointer.
|
|
||||||||||||
|
calls the value_'s setFromString method which converts the string into the right type and then calls set()
|
|
|
sets the value specified in the VariantData object passed in on the source obejct that was specified in the setSource() method.
|
|
||||||||||||
|
sets a value on an object.
|
|
|
|
|
|
sets the description of the property
|
|
|
sets the display name of the property
|
|
|
sets the name of the property
|
|
|
sets the source for the Property instance.
|
|
|
sets the type of the Property
|
|
|
|
|
|
We can't call get() to grab the collection directly, since an Enumerator is a templated class, and this point we don't know the template type. So instead, we call startCollection() to invoke the some getXXX function that returns an enumerator. This will mean that derived classes will now have the enumerator and can start calling methods on it. The base class implementation does nothing. |
|
|
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/FoundationKit/Property.h
