Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
A repository of user actions. More...
#include <ilviews/base/action.h>
Public Member Functions | |
IlvActionHistory (IlUInt m=8) | |
Constructor. | |
virtual void | add (IlvAction *a) |
Adds an action or a command and executes it (if necessary). | |
void | addProperty (const IlSymbol *key, IlAny value) |
Adds a property. | |
virtual IlvAction * | canRepeat () |
Specifies whether the last executed action can be repeated. | |
IlvAction * | getAction (IlUInt i) const |
Returns the i th action stored in the history. | |
IlvValueInterface *const * | getCurrentSelection (IlUInt &c) |
Simplifies access to the current selection in the attached document. | |
IlvAction * | getLast () const |
Shortcut method for getAction(0) . | |
IlUInt | getLength () const |
Returns the number of actions stored in the history. | |
IlUInt | getMaxLength () const |
Returns the maximum number of commands that can be stored in the history. | |
IlAny | getProperty (const IlSymbol *key) const |
Gets a property. | |
IlvActionSelectionHandler * | getSelectionHandler () const |
Returns the selection handler attached to this history. | |
IlBoolean | hasProperty (const IlSymbol *key) const |
Property-setting member functions. | |
virtual void | purge (IlUInt i=(IlUInt)-1) |
Purges the history of recorded actions or commands. | |
IlBoolean | removeProperty (const IlSymbol *key) |
Removes a property. | |
virtual void | repeatLast () |
Repeats the last action stored in the history by duplicating it, executing it, and adding it to the history. | |
IlBoolean | replaceProperty (const IlSymbol *key, IlAny value) |
Replaces a property. | |
virtual void | setMaxLength (IlUInt maxLength) |
Sets the maximum number of commands that can be stored in the history. | |
void | setSelectionHandler (IlvActionSelectionHandler *handler) |
Attaches a selection handler to a history. |
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.
IlvAction
, IlvCommand
, IlvCommandHistory
. IlvActionHistory::IlvActionHistory | ( | IlUInt | m = 8 |
) |
Constructor.
m | The maximum number of actions that can be recorded in the history. |
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.
a | The action to be added to the history. |
Reimplemented in IlvCommandHistory.
Adds a property.
See below.
virtual IlvAction* IlvActionHistory::canRepeat | ( | ) | [virtual] |
Specifies whether the last executed action can be repeated.
0
if it cannot. 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.
i | The 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)
.
IlUInt IlvActionHistory::getLength | ( | ) | const |
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.
IlvActionSelectionHandler* IlvActionHistory::getSelectionHandler | ( | ) | const |
Returns the selection handler attached to this history.
Property-setting member functions.
Properties can be added to the history through commands or other objects, therefore allowing you to implement smart repeat features.
IlvPropClassInfo
. Purges the history of recorded actions or commands.
i | The number of actions to be removed from the history. |
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.
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.
maxLength | The maximum length of the history stack. |
void IlvActionHistory::setSelectionHandler | ( | IlvActionSelectionHandler * | handler | ) |
Attaches a selection handler to a history.
handler | The selection handler to attach to this history. If this parameter is set to 0 , the handler is detached. |
© 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.