rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvInteractor Class Reference

Abstract base class for interactors. More...

#include <ilviews/base/inter.h>

Inheritance diagram for IlvInteractor:
IlvButtonInteractor IlvDragDropInteractor IlvGadgetInteractor IlvGaugeInteractor IlvGraphicComAdapterInteractor IlvMoveInteractor IlvMoveReshapeInteractor IlvReshapeInteractor IlvSelectorInteractor

List of all members.

Public Member Functions

virtual void abort (IlvGraphic *obj)
 Aborts the interactor.
virtual IlBoolean accept (const IlvGraphic *obj) const
 Indicates whether the current interactor can be associated with a given object.
virtual void endOperation ()
 Performs the actions needed when the interaction ends.
virtual void getCallbackTypes (IlUInt &count, const char *const **names, const IlSymbol *const **types) const
 Gets the number of register callback types for the interactor.
const char * getRegisteredName () const
 Returns the name of the predefined shared instance.
virtual IlBoolean handleEvent (IlvGraphic *g, IlvEvent &event, const IlvTransformer *t=0)=0
 Handles events received by the interactor.
IlBoolean isAborted () const
 Indicates whether the current interactor is in an aborted state.
IlBoolean isInOperation () const
 Indicates whether the current interactor is in an interaction state.
void lock ()
 Locks the current instance. Increments the counter that is used to know how many objects reference the current instance.
virtual void startOperation ()
 Performs the actions needed when the interaction starts.
void unLock ()
 Unlocks the current instance. Decrements the reference counter. When the counter drops down to zero, the current instance is deleted.

Static Public Member Functions

static IlvInteractorGet (const char *name, IlBoolean=((IlBoolean) 1))
 Returns a predefined shared interactor instance.

Detailed Description

Abstract base class for interactors.

Library: views

This class lets you define a behavior that can be associated with an IlvGraphic object.

IlvInteractor instances can be shared between several graphic objects. Each subclass can provide a predefined shared instance that is stored in a registry. This instance can be accessed by its registered name through the IlvInteractor::Get function. To register a predefined shared instance, you must use the IlvRegisterSharedInteractorClass macro in the implementation file of your interactor.

Warning:
Interactor instances should never be allocated on the stack as they are automatically deleted with the delete operator when they are no longer referenced (see the IlvInteractor::unLock method).

Member Function Documentation

virtual void IlvInteractor::abort ( IlvGraphic obj  )  [virtual]

Aborts the interactor.

The default implementation toggles the aborted flag.

See also:
isAborted
virtual IlBoolean IlvInteractor::accept ( const IlvGraphic obj  )  const [virtual]

Indicates whether the current interactor can be associated with a given object.

Parameters:
obj The considered graphic object.
Returns:
xxIlTrue if the interactor can safely be attached to obj, and xxIlFalse otherwise.
See also:
IlvGraphic::setInteractor

Reimplemented in IlvGadgetInteractor, IlvGaugeInteractor, IlvSelectorInteractor, and IlvGraphicComAdapterInteractor.

virtual void IlvInteractor::endOperation (  )  [virtual]

Performs the actions needed when the interaction ends.

The default implementation resets the interactor flags and remove it from its parent, if it exists.

See also:
IlvStackInteractorInterface::removeFromParent

Reimplemented in IlvMoveInteractor, and IlvDragDropInteractor.

static IlvInteractor* IlvInteractor::Get ( const char *  name,
IlBoolean  = ((IlBoolean) 1) 
) [static]

Returns a predefined shared interactor instance.

This method lets you retrieve the predefined shared instance corresponding to a given interactor class.

Parameters:
name The name under which the shared instance was registered.
Returns:
The shared instance if it was found in the registry and 0 otherwise.
virtual void IlvInteractor::getCallbackTypes ( IlUInt count,
const char *const **  names,
const IlSymbol *const **  types 
) const [virtual]

Gets the number of register callback types for the interactor.

If you provide a non-0 pointer to an array of strings in the parameter names, it is set on return to point to an array of strings that describe each of the callback types. Some of these descriptions may be 0. You must not modify nor delete this array. If you provide a non-0 pointer to an array of symbols in the parameter types, it is set on return to point to an array of symbols that define each of the callback types. You must not modify nor delete this array. If you create a new callback type and want it returned by a call to getCallbackTypes, you can use the static member function IlvGraphic::AddToCallbackTypeList. The default implementation registers one callback with the shared name of the interactor as symbol. For example, the IlvMoveInteractor class has a callback registered on the symbol "Move".

Parameters:
count The number of elements in the returned arrays names and types. This parameter must be set to 0 before calling this method.
names An array of strings.
types An array of symbols.
Returns:
The number of register callback types for this object.

Reimplemented in IlvGadgetInteractor, and IlvMoveReshapeInteractor.

const char* IlvInteractor::getRegisteredName (  )  const

Returns the name of the predefined shared instance.

Returns the name by which the shared instance of this class is known.

Returns:
The name of the predefined shared instance if it exists, 0 otherwise.
virtual IlBoolean IlvInteractor::handleEvent ( IlvGraphic g,
IlvEvent event,
const IlvTransformer t = 0 
) [pure virtual]

Handles events received by the interactor.

This method is the entry point of all events dispatched to this interactor.

Parameters:
g The graphic object that receives the event.
event The received event.
t The transformer applied to the view in which the event occurred.
Returns:
IlTrue if the event was successfully handled and IlFalse otherwise.

Implemented in IlvGadgetInteractor, IlvGaugeInteractor, IlvButtonInteractor, IlvToggleInteractor, IlvMoveInteractor, IlvReshapeInteractor, IlvMoveReshapeInteractor, IlvDragDropInteractor, IlvSelectorInteractor, and IlvGraphicComAdapterInteractor.

IlBoolean IlvInteractor::isAborted (  )  const

Indicates whether the current interactor is in an aborted state.

Returns:
A Boolean value indicating whether the interactor is aborted.
IlBoolean IlvInteractor::isInOperation (  )  const

Indicates whether the current interactor is in an interaction state.

Returns:
A Boolean value indicating whether the interactor is in an interaction state.
void IlvInteractor::lock (  ) 

Locks the current instance. Increments the counter that is used to know how many objects reference the current instance.

Warning:
An interactor should only be locked or unlocked if it has been allocated on the heap.
virtual void IlvInteractor::startOperation (  )  [virtual]

Performs the actions needed when the interaction starts.

The default implementation sets the IlvInteractorInOperation flag.

See also:
isInOperation()
void IlvInteractor::unLock (  ) 

Unlocks the current instance. Decrements the reference counter. When the counter drops down to zero, the current instance is deleted.

Warning:
An interactor should only be locked or unlocked if it has been allocated on the heap.
 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.