rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvActionSelectionHandler Class Reference

Links an IlvActionHistory object to its context. More...

#include <ilviews/base/action.h>

Public Member Functions

 IlvActionSelectionHandler ()
 
void addToResult (IlUInt c, const IlvValueInterface **r)
 Adds an object to the result of the execution of a list of commands. More...
 
virtual void commit ()
 Called after a list of commands has been executed. Enables, for example, the view to be refreshed after commands have been executed.
 
virtual IlvDisplaygetDisplay ()
 Should be redefined in subclasses to return the current display that could be used by commands that need to access a display.
 
virtual IlvValueInterface *const * getSelection (IlUInt &count, IlvActionHistory *h)
 Returns the current selection of the document object. More...
 
virtual void handleError (IlvAction *a)
 Should be redefined in subclasses to define error notification to users or enable error recovery by the document class. More...
 
void removeFromResult (const IlvValueInterface *r)
 Removes an object from the result of the execution of a list of commands. More...
 
virtual void reset ()
 Called before a list of commands is about to be executed. Prepares, for example, the view for refresh before commands are executed.
 
void setResult (IlUInt c, const IlvValueInterface **r)
 Sets the result of the execution of a list of commands. More...
 

Detailed Description

Links an IlvActionHistory object to its context.

Library: views

IlvActionSelectionHandler objects handle contextual information related to an action (or command) and its associated document or IlvManager. You should not derive the class IlvActionHistory to implement a history handling mechanism specific to a document class (such as a manager or a container command history). Instead, you should derive for a given document class a customized selection handler that links the action history to its context. The class IlvActionHistory should be derived only to implement special operations specific to the manipulation of IlvCommand and IlvAction objects. Examples of these special commands are smart repeat, log command histories, reading a list of commands, recording macros to perform a series of actions, and so on. Similarly, you should consider implementing observers for the action history instead of creating a subclass to implement new features. For example, the modified flag for the manager is handled by an observer rather than by a specialized subclass of command history.

Objects that handle an attached IlvActionHistory should create a subclass of IlvActionSelectionHandler that implements the document-specific features of action history handling, and attach it to an IlvActionHistory with the method IlvActionHistory::setSelectionHandler.

See Also
IlvActionHistory, IlvCommand, IlvCommandHistory.

Constructor & Destructor Documentation

IlvActionSelectionHandler::IlvActionSelectionHandler ( )

Constructor

Member Function Documentation

void IlvActionSelectionHandler::addToResult ( IlUInt  c,
const IlvValueInterface **  r 
)

Adds an object to the result of the execution of a list of commands.

Parameters
rAn array of objects representing the result of the list of commands. The array is copied.
cThe number of objects in r.
virtual IlvValueInterface* const* IlvActionSelectionHandler::getSelection ( IlUInt count,
IlvActionHistory h 
)
virtual

Returns the current selection of the document object.

For example, the special IlvActionSelectionHandler attached to an IlvManager class will return the result of IlvManager::getSelection.

Other classes of documents can implement their own selection mechanism, allowing commands that are repeated to retrieve their parameters from the current selection.

Parameters
countThis parameter is set to the number of returned objects.
hThe action history associated with this IlvSelectionHandler.
Returns
An array of objects currently selected and that could be provided as parameters to a command or an action.
virtual void IlvActionSelectionHandler::handleError ( IlvAction a)
virtual

Should be redefined in subclasses to define error notification to users or enable error recovery by the document class.

Parameters
aThe action whose execution reports an error.
void IlvActionSelectionHandler::removeFromResult ( const IlvValueInterface *  r)

Removes an object from the result of the execution of a list of commands.

Parameters
rThe object to be removed from the result.
void IlvActionSelectionHandler::setResult ( IlUInt  c,
const IlvValueInterface **  r 
)

Sets the result of the execution of a list of commands.

Parameters
rAn array of objects representing the result of the list of commands. The array is copied.
cThe number of objects in r.

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