rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Manager Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvApplyListener Class Reference

Listener class. More...

#include <ilviews/manager/applylst.h>

Inheritance diagram for IlvApplyListener:
IlvNamedProperty

List of all members.

Public Member Functions

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

Static Public Member Functions

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

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:
object The graphic object.
oldBBox Previous bounding box of the object.
newBBox New bounding box of the object.
reDraw Indicates 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:
object The graphic object.
static IlUInt IlvApplyListener::GetCardinal ( IlvGraphic object  )  [static]

Returns the number of listeners set on an object.

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

Removes all the listeners of a graphic object.

Parameters:
object The graphic object.
Returns:
The removed listeners, or 0 if there are no listener set on the 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:
object The graphic object.
lst The listener to remove.
Returns:
The removed listener, or 0 if lst is not set on the object.
void IlvApplyListener::set ( IlvGraphic object  ) 

Sets the IlvApplyListener on a graphic object.

Parameters:
object The graphic object. This member function sets the listener on the object.
Warning:
[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);
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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