Rogue Wave Views
Studio Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Types | Public Member Functions | Protected Member Functions | Friends
IlvStIPropertyAccessor Class Reference

Inspector class. More...

#include <ivstudio/inspectors/genacces.h>

Inheritance diagram for IlvStIPropertyAccessor:
IlvStIAccessor IlvStNamedObject IlvStICombinedAccessor IlvStIInspectedObjectAccessor IlvStIPropertiesAccessor IlvStIPropertyListAccessor IlvStIPropertyTreeAccessor

Public Types

enum  PropertyStatus { Uninitialized, Inaccessible, ReadWrite, ReadOnly }
 This enumeration type defines the status of the property stored in the object. This status is set when the accessor is initialized via the get() method. More...
 
- Public Types inherited from IlvStIAccessor
enum  BuildMode { , Create, Copy }
 This enumeration type defines the build mode of the inspected properties. More...
 
enum  DependencyMode {
  InitializeAfter, InitializeBefore, ApplyBefore, ApplyAfter,
  NoApply, Default, InitializeAndApplyBefore
}
 This enumeration type specifies when the dependent accessor is initialized and applied. properties. More...
 
enum  UpdateMode { NoUpdate, OnApply, Immediate, Inherited }
 This enumeration type specifies when the accessor must update the inspected property. The provided modes are mutually exclusive. More...
 

Public Member Functions

virtual IlvStIErrorcheck () const
 Validates the accessor value. More...
 
virtual IlvStIErrorcheckValue (const IlvStIProperty *prop) const
 Checks the value for a property. More...
 
virtual IlvStIPropertyget ()
 Returns the object's property. More...
 
IlvStIPreconditiongetPrecondition () const
 Returns the precondition. More...
 
IlvStIPropertyAccessorgetPreviewAccessor () const
 Returns the preview accessor. More...
 
PropertyStatus getPropertyStatus () const
 Returns the status of the current stored property. More...
 
IlvStIValidatorgetValidator () const
 Returns the validator used by the checkValue() method. More...
 
virtual IlBoolean initialize ()
 Called to initialize the accessor according to the inspected data. More...
 
virtual IlBoolean isReadOnly () const
 Returns IlTrue if the current property is read-only. More...
 
virtual IlBoolean isReadWrite () const
 Returns IlTrue if the current property has read and write access. More...
 
virtual void set (const IlvStIProperty *prop, IlvStIEditor *editor)
 Sets the current property to the property. More...
 
void setPrecondition (IlvStIPrecondition *precond)
 Sets the precondition. More...
 
void setPreviewAccessor (IlvStIPropertyAccessor *accessor)
 Sets the preview accessor. More...
 
void setValidator (IlvStIValidator *validator)
 Sets the validator to the accessor. More...
 
- Public Member Functions inherited from IlvStIAccessor
void addDependentAccessor (IlvStIAccessor *acc, DependencyMode mode=Default)
 Adds a dependent accessor with the specified dependency mode. More...
 
void addEditor (IlvStIEditor *edt)
 Adds the specified editor to the editors stored by the accessor. More...
 
virtual IlBoolean apply ()
 Called to apply all the changes made to the accessor. More...
 
virtual IlvStIErrorcheckAll (const IlvStIAccessor **accessor, IlBoolean modifiedOnly=IlTrue) const
 Checks the accessor and its hierarchical tree of dependencies. More...
 
IlvStIAccessorfindDependentAccessor (const char *name) const
 Searches an dependent accessor. More...
 
IlvStIEditorfindEditor (const char *name) const
 Searches the specified editor inside all dependent accessors. More...
 
virtual IlvStIEditorfindFirstEditor () const
 Returns the first editor owned by the accessor. More...
 
BuildMode getBuildMode () const
 Returns the building mode for the accessor. More...
 
IlvStIAccessorgetDependentAccessor (const char *name) const
 Returns the dependent accessor whose name is specified. More...
 
IlvStIAccessor ** getDependentAccessors (IlUInt &count) const
 Returns all direct dependent accessors. More...
 
IlvStIEditorgetEditor (IlUInt index) const
 Returns the editor stored at the wished position. More...
 
IlUInt getNumberOfEditors () const
 Returns the number of editors stored by the accessor. More...
 
virtual UpdateMode getUpdateMode () const
 Returns the update mode for the accessor. More...
 
IlBoolean isModified () const
 Returns IlTrue if the accessor has been modified. More...
 
void lock ()
 Locks the accessor once. More...
 
IlBoolean removeDependentAccessor (IlvStIAccessor *acc)
 Removes the specified dependent accessor. More...
 
IlBoolean removeEditor (IlvStIEditor *edt)
 Removes the specified editor from the accessor. More...
 
void setBuildMode (BuildMode mode)
 Sets the building mode for the accessor. More...
 
void setUpdateMode (UpdateMode updateMode)
 Sets the update mode for the accessor. More...
 
void unLock ()
 Unlocks the accessor once. More...
 
- Public Member Functions inherited from IlvStNamedObject
const char * getName () const
 Returns the name of the object. More...
 
virtual void setName (const char *name)
 Sets the name of the object. More...
 

Protected Member Functions

 IlvStIPropertyAccessor (const char *name=0, UpdateMode updateMode=NoUpdate, BuildMode buildMode=None)
 Initializes an instance of IlvStIPropertyAccessor. More...
 
virtual void applyValue (IlvStIProperty *prop)
 Called to change the property of the inspected object. More...
 
virtual IlvStIPropertycopyProperty (const IlvStIProperty *property)
 Called to copy the property when the accessor is in copy mode. More...
 
virtual IlvStIPropertycreateDefaultProperty () const
 Called to create a default property. More...
 
virtual IlvStIPropertygetOriginalValue ()
 Called to retrieve the property from the inspected object. More...
 
virtual IlBoolean getValidateOnApply () const
 Returns IlTrue if validation is performed. More...
 
- Protected Member Functions inherited from IlvStIAccessor
 IlvStIAccessor (const char *name=0, UpdateMode mode=NoUpdate, BuildMode build=None)
 Initializes a new instance of the IlvStIAccessor class. More...
 

Friends

class IlvStICombinedAccessor
 

Detailed Description

Inspector class.

Library: ivstudio

This class accesses an object property. The get() method of this class fetches the property and stores it in an IlvStIProperty object. This method is called by the initialize() method. The stored value is used by the dependent accessors and by the editors. Then, the apply() method assigns the new property to the inspected object.

When subtyping this class, you should redefine only the methods getOriginalValue() and applyValue(), which are used in the get() and apply() methods respectively.

A preview accessor can be set to the accessor. When the accessor is initialized, the preview accessor is also initialized with the same value. Likewise, when the accessor is set to a value, the preview accessor is assigned the same value. Using a preview accessor makes it possible to reflect changes to the accessor in another object, such as a graphic object in an inspector panel.

See also
IlvStIEditor, IlvStIPrecondition, IlvStIProperty, IlvStIAccessor.

Member Enumeration Documentation

§ PropertyStatus

This enumeration type defines the status of the property stored in the object. This status is set when the accessor is initialized via the get() method.

Enumerator
Uninitialized 

The property is uninitialized.

Inaccessible 

The property is inaccessible.

ReadWrite 

The property is readable and writable.

ReadOnly 

The property is read only.

Constructor & Destructor Documentation

§ IlvStIPropertyAccessor()

IlvStIPropertyAccessor::IlvStIPropertyAccessor ( const char *  name = 0,
UpdateMode  updateMode = NoUpdate,
BuildMode  buildMode = None 
)
protected

Initializes an instance of IlvStIPropertyAccessor.

Parameters
nameThe accessor name.
updateModeThe update mode.
buildModeThe build mode.

Member Function Documentation

§ applyValue()

virtual void IlvStIPropertyAccessor::applyValue ( IlvStIProperty prop)
protectedvirtual

Called to change the property of the inspected object.

Is called by the apply() method to change the property of the inspected object. Because the apply() method performs internal operations, such as handling the building mode, we recommend that you redefine the applyValue() method instead of the apply() method.

Parameters
propThe new value.

Reimplemented in IlvStIGraphicContainerAccessor, and IlvStIInspectedObjectAccessor.

§ check()

virtual IlvStIError* IlvStIPropertyAccessor::check ( ) const
virtual

Validates the accessor value.

Returns
An error if the current inspected value of the accessor is not available. Otherwise, it returns 0.

Reimplemented from IlvStIAccessor.

§ checkValue()

virtual IlvStIError* IlvStIPropertyAccessor::checkValue ( const IlvStIProperty prop) const
virtual

Checks the value for a property.

Tests whether the property provided as the parameter is valid. If not, it generates an error. If a validator has been set, it is used by default. Otherwise, the method does nothing.

Parameters
propThe property.
Returns
0 if no error occurs, otherwise returns an error.

§ copyProperty()

virtual IlvStIProperty* IlvStIPropertyAccessor::copyProperty ( const IlvStIProperty property)
protectedvirtual

Called to copy the property when the accessor is in copy mode.

Is called by the get() method to copy the property provided as the parameter when the accessor is in copy mode (see IlvStIAccessor::BuildMode). By default, this function calls the copy() function of the property and returns the result.

Parameters
propertyThe property.
Returns
A copy of the property.

§ createDefaultProperty()

virtual IlvStIProperty* IlvStIPropertyAccessor::createDefaultProperty ( ) const
protectedvirtual

Called to create a default property.

Is called only when the create mode is set (see IlvStIAccessor::BuildMode) to create a default property when no property has been found in the inspected object.

Returns
A default property.

Reimplemented in IlvStICombinedAccessor, and IlvStIPropertiesAccessor.

§ get()

virtual IlvStIProperty* IlvStIPropertyAccessor::get ( )
virtual

Returns the object's property.

Returns
The object's property, which is stored in the IlvStIProperty object.

Reimplemented in IlvStIPropertiesAccessor.

§ getOriginalValue()

virtual IlvStIProperty* IlvStIPropertyAccessor::getOriginalValue ( )
protectedvirtual

Called to retrieve the property from the inspected object.

Is called by the get() method to retrieve the property from the inspected object. Because the get() method performs internal operations, such as handling the building mode, we recommend that you redefine the getOriginalValue() method instead of the get() method.

Returns
The original value.

Reimplemented in IlvStIGraphicContainerAccessor, IlvStICombinedAccessor, IlvStIInspectedObjectAccessor, and IlvStIPropertiesAccessor.

§ getPrecondition()

IlvStIPrecondition* IlvStIPropertyAccessor::getPrecondition ( ) const

Returns the precondition.

Returns
The precondition used to test whether the object property can be accessed.

§ getPreviewAccessor()

IlvStIPropertyAccessor* IlvStIPropertyAccessor::getPreviewAccessor ( ) const

Returns the preview accessor.

Returns
The preview accessor.

§ getPropertyStatus()

PropertyStatus IlvStIPropertyAccessor::getPropertyStatus ( ) const

Returns the status of the current stored property.

Returns
The status of the current stored property.

§ getValidateOnApply()

virtual IlBoolean IlvStIPropertyAccessor::getValidateOnApply ( ) const
protectedvirtual

Returns IlTrue if validation is performed.

Returns
IlTrue if validation is performed when apply() is called. If it returns IlFalse, validation is performed as soon as the changes are made.

§ getValidator()

IlvStIValidator* IlvStIPropertyAccessor::getValidator ( ) const

Returns the validator used by the checkValue() method.

Returns
The validator used by the checkValue() method

§ initialize()

virtual IlBoolean IlvStIPropertyAccessor::initialize ( )
virtual

Called to initialize the accessor according to the inspected data.

By default, this method only initializes all dependent accessors.

Returns
IlTrue if successfull, otherwise return IlFalse.

Reimplemented from IlvStIAccessor.

Reimplemented in IlvStICombinedAccessor, and IlvStIPropertiesAccessor.

§ isReadOnly()

virtual IlBoolean IlvStIPropertyAccessor::isReadOnly ( ) const
virtual

Returns IlTrue if the current property is read-only.

Returns
IlTrue if the current property is read-only.

§ isReadWrite()

virtual IlBoolean IlvStIPropertyAccessor::isReadWrite ( ) const
virtual

Returns IlTrue if the current property has read and write access.

Returns
IlTrue if the current property has read and write access.

§ set()

virtual void IlvStIPropertyAccessor::set ( const IlvStIProperty prop,
IlvStIEditor editor 
)
virtual

Sets the current property to the property.

Sets the current property to the property provided as the parameter. The specified editor is the one that changed the property. All the editors that the accessor contains are reinitialized following this modification, except for the calling editor.

Parameters
propThe new property.
editorThe editor which must be not reinitialized.

Reimplemented in IlvStICombinedAccessor, and IlvStIPropertiesAccessor.

§ setPrecondition()

void IlvStIPropertyAccessor::setPrecondition ( IlvStIPrecondition precond)

Sets the precondition.

Sets the precondition used to test whether the object property can be accessed. If the precondition was already set, it is destroyed and replaced with the new one.

Parameters
precondThe new precondition.

§ setPreviewAccessor()

void IlvStIPropertyAccessor::setPreviewAccessor ( IlvStIPropertyAccessor accessor)

Sets the preview accessor.

Parameters
accessorThe accessor which uses the current accessor like preview accessor.

§ setValidator()

void IlvStIPropertyAccessor::setValidator ( IlvStIValidator validator)

Sets the validator to the accessor.

Parameters
validatorThe validator to the accessor.

© Copyright 2017, 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.