Rogue Wave Views Prototypes Package API Reference Guide |
Rogue Wave Views Documentation Home |
Mediator between a 'Business Graphic Object' and its corresponding object in the application. More...
#include <ilviews/protos/grouplin.h>
Public Member Functions | |
IlvGroupMediator (IlvGroup *presentation, IlAny object=0) | |
Links an object of the application domain with its representation. More... | |
IlBoolean | changeValue (const IlvValue &val) |
Changes the object's value. Both the name and the new value are contained in val. More... | |
IlBoolean | changeValues (const IlvValue *values, IlUShort count) |
Updates the object when the user has changed the presentation. More... | |
void | getAccessors (const IlSymbol *const **, const IlvValueTypeClass *const **, IlUInt &) const |
Returns the names of all the accessors known by this object. More... | |
const char * | getName () const |
Returns the object name. More... | |
IlAny | getObject () const |
Returns the object linked to the current presentation. More... | |
IlvGroup * | getPresentation () const |
Returns the presentation currently linked to the object. More... | |
void | lock () |
Locks the mediator. More... | |
IlBoolean | locked () |
Guard against update loops that could occur if the representation attribute does not match the attribute of the object it represents. More... | |
IlvValue & | queryValue (IlvValue &val) const |
Queries the value designated by value from the object. Both the value and the value type are stored in value. More... | |
void | queryValues (IlvValue *values, IlUShort count) const |
Updates the presentation from the object values. More... | |
virtual void | setObject (IlAny arg, IlBoolean refresh=IlTrue) |
Sets the object to link to the presentation. More... | |
virtual void | setPresentation (IlvGroup *group, IlBoolean refresh=IlTrue) |
Sets the presentation that will allow the user to edit the object. More... | |
void | unlock () |
Releases the lock. More... | |
virtual void | update (const IlSymbol *const *symbs=0, IlUInt count=0) |
Synchronizes the presentation with the object values. More... | |
Public Member Functions inherited from IlvAccessible | |
virtual IlUInt | compareAllValues (const IlvAccessible *ref, IlvValueArray &diffs, IlBoolean any=IlFalse) const |
Compares two objects and returns the differing attributes. More... | |
virtual IlUInt | compareValues (const IlvAccessible *ref, IlvValue *values, IlUShort count, IlvValueArray &diffs) const |
Compares two objects and returns the differing attributes. More... | |
virtual IlBoolean | convertValues (IlvValue *v, IlUShort c, IlvDisplay *d) const |
Convert values to match the types defined by the object accessors. More... | |
IlUInt | getSubscriptions (IlvAccessible *subscriber, IlSymbol **&sourceValue, IlSymbol **&subscriberValue, IlvValueTypeClass **&type, IlvValueSubscriptionMode *&mode, IlvAccessible ***subscribers=0) const |
Returns alls subscriptions made by subscriber. More... | |
virtual const IlvValueTypeClass * | getValueType (const IlSymbol *s) const |
Returns the type of a given attribute. More... | |
virtual IlBoolean | isOutputValue (const IlSymbol *value) const |
Indicates whether value designates an accessor that can generate notifying values. More... | |
virtual IlvValue & | pullValue (IlvValue &v) const |
See below. | |
virtual void | pullValues (IlvValue *vals, IlUShort c) const |
Propagates value queries to the subscribers to this object. More... | |
virtual IlBoolean | pushValue (const IlvValue &v) const |
See below. | |
virtual IlBoolean | pushValues (const IlvValue *vals, IlUShort c) const |
Propagates value changes to the subscribers to this object. More... | |
virtual void | subscribe (IlvAccessible *subscriber, IlSymbol *sourceValue, IlSymbol *subscriberValue, IlvValueTypeClass *type, IlvValueSubscriptionMode mode=IlvValueSubscriptionChange) |
Subscribes the subscriber object to the value sourceValue of this object. More... | |
virtual void | unSubscribe (IlvAccessible *subscriber, IlSymbol *sourceValue=0, IlSymbol *subscriberValue=0) |
Cancels subscriptions previously made. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvAccessible | |
static void | DeclareAccessor (const IlSymbol *attr, IlvValueTypeClass *type, const IlSymbol *const **accessors, const IlvValueTypeClass *const **types, IlUInt &count, IlBoolean checkDuplicates=IlFalse, IlAny accessorList=0) |
static const IlvValueTypeClass * | GetType (IlSymbol *name) |
Returns the type instance from a name. More... | |
static IlBoolean | StringToValue (const char *s, IlSymbol *type, IlvValue &v, IlvDisplay *display) |
Converts the character string s to an IlvValue with the type type. More... | |
static IlBoolean | StringToValue (const char *s, const IlvValueTypeClass *typeClass, IlvValue &v, IlvDisplay *d) |
Converts the character string s to an IlvValue with the type type. More... | |
static IlBoolean | ValuesAreEqual (IlvValue &v1, IlvValue &v2, IlBoolean compareNames=IlTrue) |
Compares two values. More... | |
Mediator between a 'Business Graphic Object' and its corresponding object in the application.
Library: ilvproto
The IlvGroupMediator
class allows you to link an application object to its corresponding presentation in a graphical user interface (GUI). The presentation is implemented as an IlvGroup
. This class reads the values exported from the group and keeps synchronized its object and the group implementing its user interface. Synchronization is used to refer to the following:
When, through accessors interpreting the user actions, one of the public attributes of the group is changed, the IlvGroupMediator
is notified and updates the object to reflect the changes by calling the changeValues()
method.
When the object changes and these changes need to be propagated to the presentation so that the user can see the changes, the IlvGroupMediator
will call its queryValues()
method, which updates the values with data corresponding to the internal state of the object.
Finally, whenever attributes change in the object, the application calls the update()
method to ensure that the presentation reflects these changes.
See the samples in the Views directory: samples/protos/inspector
Links an object of the application domain with its representation.
Creates an instance of IlvGroupMediator
by linking its presentation with its object. presentation implements the presentation under the form of an IlvGroup
while object is an object of the application domain.
presentation | A group that implements the visual appearance of an object. This group will usually require attributes that match the attributes of its attached object. |
object | Any reference to an applicative object that must be presented to the user. |
object | A reference to any kind of object of the application represented by the presentation. |
Changes the object's value. Both the name and the new value are contained in val.
v | The value to be set (both name and value). |
Reimplemented from IlvAccessible.
Updates the object when the user has changed the presentation.
This method must be overloaded. The implementation should read the values changed, update the internal state of the object to reflect these new values, and propagate these changes to other potential observers of the object. This method should start with if(locked()) return IlTrue
; to avoid possible feedback loops between the object and its representation. You may also want to use the lock()
method to lock the IlvGroupMediator
class before propagating the changes, and then use the unlock()
method when you have finished (to avoid unnecessary updates of the presentation).
values | Values that have changed in the IlvGroup and should be reflected in the application object. |
count | Number of values. |
IlTrue
if the change was successful. Reimplemented from IlvAccessible.
|
virtual |
Returns the names of all the accessors known by this object.
Subclasses of IlvAccessible
must override this method by calling the static method DeclareAccessor()
for each accessor handled by the subclass. The returned arrays are filled by the method and must not be freed.
a | Pointer to an array filled on return with the names of the accessors defined for the object. |
t | Pointer to an array filled on return with the type of each accessor. |
c | Number of accessors, set by the method. |
Implements IlvAccessible.
|
virtual |
Returns the object name.
Implements IlvAccessible.
IlAny IlvGroupMediator::getObject | ( | ) | const |
Returns the object linked to the current presentation.
setObject()
. IlvGroup* IlvGroupMediator::getPresentation | ( | ) | const |
Returns the presentation currently linked to the object.
void IlvGroupMediator::lock | ( | ) |
Locks the mediator.
Locks the IlvGroupMediator
so that further changes will not be propagated to the object. This avoids infinite update loops between the object and its representation.
IlBoolean IlvGroupMediator::locked | ( | ) |
Guard against update loops that could occur if the representation attribute does not match the attribute of the object it represents.
IlTrue
if the lock on the object has been set. This implies that changes are not propagated to the object or the group. Queries the value designated by value from the object. Both the value and the value type are stored in value.
value | The queried value name. |
Reimplemented from IlvAccessible.
Updates the presentation from the object values.
This method must be overloaded. The implementation should fill the values array with values representing the internal state of the object.
values | Values to be changed in the IlvGroup . |
count | Number of values. |
Reimplemented from IlvAccessible.
Sets the object to link to the presentation.
arg | The object that is linked to the presentation. |
refresh | Can be set to IlFalse if you don't want an immediate refresh. |
|
virtual |
Sets the presentation that will allow the user to edit the object.
group | The presentation that is linked to this object. |
refresh | Can be set to IlFalse if you don't want an immediate refresh. |
Reimplemented in IlvProtoMediator.
void IlvGroupMediator::unlock | ( | ) |
Releases the lock.
Releases the lock on the object, allowing further changes to be propagated.
|
virtual |
Synchronizes the presentation with the object values.
Use this method whenever the object is changed from the application and the presentation is to be updated to reflect these changes. The optional list of symbols indicates what attributes have changed. It can be used to minimize refreshes of the representation.
symbs | Array of attribute names that should be queried from the object and changed in the group serving as presentation. If symbs is 0 , all attributes that are notifying in the IlvGroup are queried from the object and changed in the presentation. |
count | Size of the symbs array. |
© Copyright 2018, 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.