Rogue Wave Views
Manager Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvApplyListener Class Referenceabstract

Listener class. More...

#include <ilviews/manager/applylst.h>

Inheritance diagram for IlvApplyListener:
IlvNamedProperty IlvValueInterface

Public Member Functions

 IlvApplyListener ()
 Constructor. More...
 
virtual void applied (IlvGraphic *object, const IlvRect &oldBBox, const IlvRect &newBBox, IlBoolean reDraw)=0
 Called by IlvManager::applyToObject. More...
 
void set (IlvGraphic *object)
 Sets the IlvApplyListener on a graphic object. More...
 

Static Public Member Functions

static IlvApplyListenerGet (const IlvGraphic *object)
 Returns the IlvApplyListener of a graphic object. More...
 
static IlUInt GetCardinal (IlvGraphic *object)
 Returns the number of listeners set on an object. More...
 
static IlvApplyListenerRemove (IlvGraphic *object, IlvApplyListener *lst)
 Removes an IlvApplyListener of a graphic object. More...
 
static IlvApplyListenerRemove (IlvGraphic *object)
 Removes all the listeners of a graphic object. More...
 

Detailed Description

Listener class.

Library: ilvmgr

IlvApplyListener is an abstract class that makes it possible to watch (or "listen" to) calls to IlvManager::applyToObject for a given object. This feature allows you to trigger further actions after a function was "applied" to an object. For example, when an object is moved using the parameter IlvSelectInteractor or by calling IlvManager::translateObject or IlvManager::applyToObject, you are notified of the event. This notification allows you to find the new location of the object and request that other objects (for example, decorations) follow the object. Note that, although IlvApplyListener is a subclass of IlvNamedProperty, you must not use IlvGraphic::setNamedProperty to associate it with an object; you should use IlvApplyListener::set instead. If you do not use IlvApplyListener::set, your listener will never be notified.

Constructor & Destructor Documentation

IlvApplyListener::IlvApplyListener ( )

Constructor.

Initializes the listener by assigning the proper symbol required by the IlvNamedProperty class.

Member Function Documentation

virtual void IlvApplyListener::applied ( IlvGraphic object,
const IlvRect oldBBox,
const IlvRect newBBox,
IlBoolean  reDraw 
)
pure virtual

Called by IlvManager::applyToObject.

This virtual member function, which makes the class abstract, is called by the manager when a function has just been applied to an object in IlvManager::applyToObject. This member function receives the previous and the new bounding boxes, which you can use for your own purpose, such as computing the location of another object you want to move. The reDraw parameter has the same value as the one that was provided in the initial call to IlvManager::applyToObject.

Parameters
objectThe graphic object.
oldBBoxPrevious bounding box of the object.
newBBoxNew bounding box of the object.
reDrawIndicates whether the manager will redraw the affected areas.
static IlvApplyListener* IlvApplyListener::Get ( const IlvGraphic object)
static

Returns the IlvApplyListener of a graphic object.

Returns
The IlvApplyListener of an object, or 0 if there is none.
Parameters
objectThe graphic object.
static IlUInt IlvApplyListener::GetCardinal ( IlvGraphic object)
static

Returns the number of listeners set on an object.

Parameters
objectThe graphic object.
Returns
The number of listeners set on the graphic object object.
static IlvApplyListener* IlvApplyListener::Remove ( IlvGraphic object,
IlvApplyListener lst 
)
static

Removes an IlvApplyListener of a graphic object.

Removes the listener lst of the graphic object object and returns it. You can then delete the listener, or set it to another object.

Parameters
objectThe graphic object.
lstThe listener to remove.
Returns
The removed listener, or 0 if lst is not set on the object.
static IlvApplyListener* IlvApplyListener::Remove ( IlvGraphic object)
static

Removes all the listeners of a graphic object.

Parameters
objectThe graphic object.
Returns
The removed listeners, or 0 if there are no listener set on the object.
void IlvApplyListener::set ( IlvGraphic object)

Sets the IlvApplyListener on a graphic object.

Parameters
objectThe graphic object. This member function sets the listener on the object.
Note
This is the only valid way of associating an IlvApplyListener and a graphic object. Typically, you will write:
MyListenerClass* myListener = new MyListenerClass(...);
myListener->set(myListenedObject);

© 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.