rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvActionHistory Class Reference

A repository of user actions. More...

#include <ilviews/base/action.h>

Inheritance diagram for IlvActionHistory:
IlvObservable IlvSmartData IlvCommandHistory

List of all members.

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 IlvActioncanRepeat ()
 Specifies whether the last executed action can be repeated.
IlvActiongetAction (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.
IlvActiongetLast () 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.
IlvActionSelectionHandlergetSelectionHandler () 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.

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:
m The 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:
a The 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:
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).

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:
i The 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:
maxLength The maximum length of the history stack.
void IlvActionHistory::setSelectionHandler ( IlvActionSelectionHandler handler  ) 

Attaches a selection handler to a history.

Parameters:
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.