Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Public Attributes
IlvNamedProperty Class Referenceabstract

Named property class. More...

#include <ilviews/util/proplist.h>

Inheritance diagram for IlvNamedProperty:
IlvValueInterface IlvAnimator IlvToolTip IlvBitmapAnimator IlvGraphicAnimator

Public Member Functions

 IlvNamedProperty (const IlvNamedProperty &source)
 Constructor. More...
 
 IlvNamedProperty (IlSymbol *)
 Constructor. More...
 
IlvNamedPropertycopy () const =0
 Copies the property. More...
 
const char * getName () const
 Gets the name of the property. More...
 
IlSymbolgetSymbol () const
 Gets the name of the property. More...
 
virtual IlBoolean isPersistent () const
 Specifies whether the property must save itself. More...
 
void write (IlvOutputFile &stream) const =0
 Saves the description of the property. More...
 
- Public Member Functions inherited from IlvValueInterface
virtual IlBoolean applyValue (const IlvValue &value)
 Apply an accessor. More...
 
virtual IlBoolean changeValue (const IlvValue &val)
 Changes the value of an accessor. More...
 
virtual IlBoolean changeValues (const IlvValue *values, IlUShort count=0)
 Changes several accessor values simultaneously. More...
 
virtual void getAccessors (const IlSymbol *const **names, const IlvValueTypeClass *const **types, IlUInt &count) const
 Retrieves the list of available accessors of an object. More...
 
virtual IlvValuequeryValue (IlvValue &val) const
 Retrieves an accessor value. More...
 
virtual void queryValues (IlvValue *values, IlUShort count) const
 Retrieves multiple accessor values simultaneously. More...
 

Public Attributes

IlvNamedProperty *IlvInputFilestream
 Reads an instance of the property class. More...
 

Detailed Description

Named property class.

Library: views

The class IlvNamedProperty is used to associate persistent properties with graphic objects. These properties are instances of subclasses of IlvNamedProperty, and they can save themselves and be read back from a data stream. They are deleted when the graphic object they are associated with is destroyed.
A named property is identified by a name, which is a symbol referred to as the property name. This class is an abstract class, so every named property is an instance of a subclass of IlvNamedProperty.
To implement the persistence of a new subclass of IlvNamedProperty, you must use one of the two macros DeclarePropertyInfo or DeclarePropertyInfoRO in the body of the class declaration, and register the new class using the macro IlvRegisterPropertyClass.

See also
IlvGraphic ("Named Properties"), DeclarePropertyInfo, DeclarePropertyInfoRO, DeclarePropertyIOConstructors, IlvPredefinedPropertyIOMembers, IlvRegisterPropertyClass.

Accessors\nAccessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods <tt>IlvValueInterface::queryValue()</tt>, <tt>IlvValueInterface::queryValues()</tt>, <tt>IlvValueInterface::changeValue()</tt>, <tt>IlvValueInterface::changeValues()</tt>.\n\n\nThis class inherits the accessors of its superclass \c IlvValueInterface.

Constructor & Destructor Documentation

◆ IlvNamedProperty() [1/2]

IlvNamedProperty::IlvNamedProperty ( IlSymbol )

Constructor.

Initializes a new instance of IlvNamedProperty, setting the property name to name.

◆ IlvNamedProperty() [2/2]

IlvNamedProperty::IlvNamedProperty ( const IlvNamedProperty source)

Constructor.

Initializes a new instance of IlvNamedProperty with a copy of source.

Member Function Documentation

◆ copy()

IlvNamedProperty* IlvNamedProperty::copy ( ) const
pure virtual

Copies the property.

Creates and returns a copy of the property.

Returns
A copy of the property.

◆ getName()

const char* IlvNamedProperty::getName ( ) const
virtual

Gets the name of the property.

Gets the name of this property, as a char*. This string must not be deleted nor modified by the user.

Returns
The name of this property, as a char*.

Reimplemented from IlvValueInterface.

◆ getSymbol()

IlSymbol* IlvNamedProperty::getSymbol ( ) const

Gets the name of the property.

Gets the name of this property as an IlSymbol. This symbol is the one provided in the constructors.

Returns
The name of this property as an IlSymbol*.

◆ isPersistent()

virtual IlBoolean IlvNamedProperty::isPersistent ( ) const
virtual

Specifies whether the property must save itself.

Specifies whether the property must save itself when the object is saved. The purpose of this function is to have smaller Rogue Wave Views data files when handling named properties that do not need to be persistent (such as temporary flags).
The default implementation returns IlTrue, so that all named properties are saved and can be loaded by default.

Returns
IlTrue if this property must save itself when the object is saved, and IlFalse otherwise.

◆ write()

void IlvNamedProperty::write ( IlvOutputFile stream) const
pure virtual

Saves the description of the property.

Saves a description of this property into the output stream stream.

Parameters
streamThe output stream.

Member Data Documentation

◆ stream

IlvNamedProperty* IlvInputFile& IlvNamedProperty::stream

Reads an instance of the property class.

Creates and returns a new instance of this property class, from the input stream stream, with the name name.

Parameters
streamThe input stream.
nameThe name of the new instance.
Returns
A new instance of the property class.