Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Named property class. More...
#include <ilviews/util/proplist.h>
Public Member Functions | |
IlvNamedProperty (IlSymbol *) | |
Constructor. More... | |
IlvNamedProperty (const IlvNamedProperty &source) | |
Constructor. More... | |
IlvNamedProperty * | copy () const =0 |
Copies the property. More... | |
const char * | getName () const |
Gets the name of the property. More... | |
IlSymbol * | getSymbol () 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 IlvValue & | queryValue (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 *IlvInputFile & | stream |
Reads an instance of the property class. More... | |
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
.
IlvGraphic
("Named Properties"), DeclarePropertyInfo
, DeclarePropertyInfoRO
, DeclarePropertyIOConstructors
, IlvPredefinedPropertyIOMembers
, IlvRegisterPropertyClass
.Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue()
, IlvValueInterface::queryValues()
, IlvValueInterface::changeValue()
, IlvValueInterface::changeValues()
. This class inherits the accessors of its superclass IlvValueInterface
.
IlvNamedProperty::IlvNamedProperty | ( | IlSymbol * | ) |
Constructor.
Initializes a new instance of IlvNamedProperty
, setting the property name to name.
IlvNamedProperty::IlvNamedProperty | ( | const IlvNamedProperty & | source | ) |
Constructor.
Initializes a new instance of IlvNamedProperty
with a copy of source.
|
pure virtual |
Copies the property.
Creates and returns a copy of the property.
|
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.
char*
. Reimplemented from IlvValueInterface.
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.
IlSymbol*
.
|
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.
IlTrue
if this property must save itself when the object is saved, and IlFalse
otherwise.
|
pure virtual |
Saves the description of the property.
Saves a description of this property into the output stream stream.
stream | The output 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.
stream | The input stream. |
name | The name of the new instance. |
© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.