rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvActionHistory Class Reference

A repository of user actions. More...

#include <ilviews/base/action.h>

Inheritance diagram for IlvActionHistory:
IlvObservable IlvSmartData IlvCommandHistory

Public Member Functions

 IlvActionHistory (IlUInt m=8)
 Constructor. More...
 
virtual void add (IlvAction *a)
 Adds an action or a command and executes it (if necessary). More...
 
void addProperty (const IlSymbol *key, IlAny value)
 Adds a property. More...
 
virtual IlvActioncanRepeat ()
 Specifies whether the last executed action can be repeated. More...
 
IlvActiongetAction (IlUInt i) const
 Returns the i th action stored in the history. More...
 
IlvValueInterface *const * getCurrentSelection (IlUInt &c)
 Simplifies access to the current selection in the attached document. More...
 
IlvActiongetLast () const
 Shortcut method for getAction(0). More...
 
IlUInt getLength () const
 Returns the number of actions stored in the history. More...
 
IlUInt getMaxLength () const
 Returns the maximum number of commands that can be stored in the history. More...
 
IlAny getProperty (const IlSymbol *key) const
 Gets a property. More...
 
IlvActionSelectionHandlergetSelectionHandler () const
 Returns the selection handler attached to this history. More...
 
IlBoolean hasProperty (const IlSymbol *key) const
 Property-setting member functions. More...
 
virtual void purge (IlUInt i=(IlUInt)-1)
 Purges the history of recorded actions or commands. More...
 
IlBoolean removeProperty (const IlSymbol *key)
 Removes a property. More...
 
virtual void repeatLast ()
 Repeats the last action stored in the history by duplicating it, executing it, and adding it to the history. More...
 
IlBoolean replaceProperty (const IlSymbol *key, IlAny value)
 Replaces a property. More...
 
virtual void setMaxLength (IlUInt maxLength)
 Sets the maximum number of commands that can be stored in the history. More...
 
void setSelectionHandler (IlvActionSelectionHandler *handler)
 Attaches a selection handler to a history. More...
 
- Public Member Functions inherited from IlvObservable
 IlvObservable ()
 Empty constructor. More...
 
virtual void notify (IlAny arg=0)
 Notification method, to be called in methods that modify the state of the object whenever required. More...
 
- Public Member Functions inherited from IlvSmartData
 IlvSmartData ()
 See below.
 
virtual ~IlvSmartData ()
 Constructors. More...
 
void decrRef ()
 Decrements the reference counter of the object and deletes this object when the counter reaches 0. More...
 
void incrRef ()
 Increments the reference counter.
 
int refCount ()
 Returns the number of references to this object. More...
 

Detailed Description

A repository of user actions.

Library: views

The class IlvActionHistory defines a repository of user actions. It allows you to implement user feedback, smart repeat, and other advanced input features based on the analysis of the recorded user actions.

See Also
IlvAction, IlvCommand, IlvCommandHistory.

Constructor & Destructor Documentation

IlvActionHistory::IlvActionHistory ( IlUInt  m = 8)

Constructor.

Parameters
mThe maximum number of actions that can be recorded in the history.

Member Function Documentation

virtual void IlvActionHistory::add ( IlvAction a)
virtual

Adds an action or a command and executes it (if necessary).

If the total number of actions exceeds the maximum number of actions that can be stored in the history, the least recently executed actions are deleted with the delete operator. This means actions added to an action history must be dynamically allocated with the new operator for the action history to keep track of more than one action.

Parameters
aThe action to be added to the history.

Reimplemented in IlvCommandHistory.

void IlvActionHistory::addProperty ( const IlSymbol key,
IlAny  value 
)

Adds a property.

See below.

virtual IlvAction* IlvActionHistory::canRepeat ( )
virtual

Specifies whether the last executed action can be repeated.

Returns
The last executed action if it can be repeated, or 0 if it cannot.
IlvAction* IlvActionHistory::getAction ( IlUInt  i) const

Returns the i th action stored in the history.

h.getAction(0) returns the last executed action. h.getAction(h.getLength()-1) returns the earliest executed action still stored in the history.

Parameters
iThe index of the action to be retrieved.
IlvValueInterface* const* IlvActionHistory::getCurrentSelection ( IlUInt c)

Simplifies access to the current selection in the attached document.

This method delegates its implementation to the attached IlvActionSelectionHandler object, if any.

IlvAction* IlvActionHistory::getLast ( ) const

Shortcut method for getAction(0).

Returns
A pointer to the last action.
IlUInt IlvActionHistory::getLength ( ) const

Returns the number of actions stored in the history.

Returns
The number of actions stored in the history.
IlUInt IlvActionHistory::getMaxLength ( ) const

Returns the maximum number of commands that can be stored in the history.

Returns
The maximum length of the history stack.
IlAny IlvActionHistory::getProperty ( const IlSymbol key) const

Gets a property.

See below.

IlvActionSelectionHandler* IlvActionHistory::getSelectionHandler ( ) const

Returns the selection handler attached to this history.

Returns
The selection handler of this history.
IlBoolean IlvActionHistory::hasProperty ( const IlSymbol key) const

Property-setting member functions.

Properties can be added to the history through commands or other objects, therefore allowing you to implement smart repeat features.

See Also
IlvPropClassInfo.
virtual void IlvActionHistory::purge ( IlUInt  i = (IlUInt)-1)
virtual

Purges the history of recorded actions or commands.

Parameters
iThe number of actions to be removed from the history.
IlBoolean IlvActionHistory::removeProperty ( const IlSymbol key)

Removes a property.

See below.

virtual void IlvActionHistory::repeatLast ( )
virtual

Repeats the last action stored in the history by duplicating it, executing it, and adding it to the history.

The latest repeatable action stored in the history is repeated.

IlBoolean IlvActionHistory::replaceProperty ( const IlSymbol key,
IlAny  value 
)

Replaces a property.

See below.

virtual void IlvActionHistory::setMaxLength ( IlUInt  maxLength)
virtual

Sets the maximum number of commands that can be stored in the history.

Parameters
maxLengthThe maximum length of the history stack.
void IlvActionHistory::setSelectionHandler ( IlvActionSelectionHandler handler)

Attaches a selection handler to a history.

Parameters
handlerThe selection handler to attach to this history. If this parameter is set to 0, the handler is detached.

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