Classes | Public Member Functions | Protected Member Functions | Properties | Events

Romulus.ActionQueue-g< TQ, TAction > Class Template Reference

Manages a list of actions that can be done and undone. More...

Inheritance diagram for Romulus.ActionQueue-g< TQ, TAction >:
Romulus.ActionQueue

List of all members.

Classes

class  Action
 An action that can be done or undone with an ActionQueue. More...
class  ActionArgs
 Event agrs for an action. More...
class  ActionStack
 Represents a list of available actions to do or undo. More...

Public Member Functions

 ActionQueue ()
 Creates a new ActionQueue.
void DontCombineNextAction ()
 Call this method to prevent the next action to be performed from being combined with previous actions.
virtual TAction Undo ()
 Undoes one action and returns the action that was undone.
virtual TAction Redo ()
 Redoes one action and returns the action that was done.
virtual void Do (TAction a)
 Adds the specified action to the queue and performs the action.
void Clear ()
 Clears all undos and redos.

Protected Member Functions

void CropUndos ()
 Removes the oldest undo actions if the queue has more actions that are allowed by MaxQueueSize.
void CropRedos ()
 Removes the least recently undone actions if the queue has more actions than allowed by MaxQueueSize. This seems superfluous since there should never be too many actions when this method would be called.

Properties

ActionStack Undos [get]
 Gets a list of available undos.
ActionStack Redos [get]
 Gets a list of available redos.
int MaxQueueSize [get, set]
 Gets/sets the maximum number of actions the queue will hold.
bool CombineActions [get, set]
 If true, actions that can be combined will be. (This behavior is defined by the Action objects.).
bool CanUndo [get]
 Returns true if there are actions to undo.
string UndoText [get]
 Returns the text of the first undo action.
int UndoCount [get]
 Gets the number of undo actions available.
bool CanRedo [get]
 Returns true if there are actions to redo.
string RedoText [get]
 Returns the text of the first redo action.
int RedoCount [get]
 Returns the number of redo actions available.
int TotalCount [get]
 Gets the total number of undo and redo actions.

Events

EventHandler< ActionArgsActionDone
 Rasied when an action is done or redone.
EventHandler< ActionArgsActionUndone
 Raised when an action is undone.
EventHandler< ActionArgsActionsCombined
 Raised when two actions are combined into a single action.

Detailed Description

template<TQ, TAction>
class Romulus::ActionQueue-g< TQ, TAction >

Manages a list of actions that can be done and undone.

Template Parameters:
TQ The queue type. This type parameter should be set to the declaring type (self-referencing).
TAction The action type. This type must inherit from the declaring type's nested Action class.
Type Constraints
TQ :ActionQueue 
TQ :TQ 
TQ :TAction 
TAction :ActionQueue 
TAction :TQ 
TAction :TAction 
TAction :Action 

Member Function Documentation

template<TQ , TAction >
Romulus.ActionQueue-g< TQ, TAction >.ActionQueue (  ) 

Creates a new ActionQueue.

template<TQ , TAction >
void Romulus.ActionQueue-g< TQ, TAction >.Clear (  ) 

Clears all undos and redos.

template<TQ , TAction >
void Romulus.ActionQueue-g< TQ, TAction >.CropRedos (  )  [protected]

Removes the least recently undone actions if the queue has more actions than allowed by MaxQueueSize. This seems superfluous since there should never be too many actions when this method would be called.

template<TQ , TAction >
void Romulus.ActionQueue-g< TQ, TAction >.CropUndos (  )  [protected]

Removes the oldest undo actions if the queue has more actions that are allowed by MaxQueueSize.

template<TQ , TAction >
virtual void Romulus.ActionQueue-g< TQ, TAction >.Do ( TAction  a  )  [virtual]

Adds the specified action to the queue and performs the action.

Parameters:
a The action to perform.
template<TQ , TAction >
void Romulus.ActionQueue-g< TQ, TAction >.DontCombineNextAction (  ) 

Call this method to prevent the next action to be performed from being combined with previous actions.

template<TQ , TAction >
virtual TAction Romulus.ActionQueue-g< TQ, TAction >.Redo (  )  [virtual]

Redoes one action and returns the action that was done.

Returns:
The action that was redone.
template<TQ , TAction >
virtual TAction Romulus.ActionQueue-g< TQ, TAction >.Undo (  )  [virtual]

Undoes one action and returns the action that was undone.

Returns:
The action that was undone.

Property Documentation

template<TQ , TAction >
bool Romulus.ActionQueue-g< TQ, TAction >.CanRedo [get]

Returns true if there are actions to redo.

template<TQ , TAction >
bool Romulus.ActionQueue-g< TQ, TAction >.CanUndo [get]

Returns true if there are actions to undo.

template<TQ , TAction >
bool Romulus.ActionQueue-g< TQ, TAction >.CombineActions [get, set]

If true, actions that can be combined will be. (This behavior is defined by the Action objects.).

template<TQ , TAction >
int Romulus.ActionQueue-g< TQ, TAction >.MaxQueueSize [get, set]

Gets/sets the maximum number of actions the queue will hold.

template<TQ , TAction >
int Romulus.ActionQueue-g< TQ, TAction >.RedoCount [get]

Returns the number of redo actions available.

template<TQ , TAction >
ActionStack Romulus.ActionQueue-g< TQ, TAction >.Redos [get]

Gets a list of available redos.

template<TQ , TAction >
string Romulus.ActionQueue-g< TQ, TAction >.RedoText [get]

Returns the text of the first redo action.

template<TQ , TAction >
int Romulus.ActionQueue-g< TQ, TAction >.TotalCount [get]

Gets the total number of undo and redo actions.

template<TQ , TAction >
int Romulus.ActionQueue-g< TQ, TAction >.UndoCount [get]

Gets the number of undo actions available.

template<TQ , TAction >
ActionStack Romulus.ActionQueue-g< TQ, TAction >.Undos [get]

Gets a list of available undos.

template<TQ , TAction >
string Romulus.ActionQueue-g< TQ, TAction >.UndoText [get]

Returns the text of the first undo action.


Event Documentation

template<TQ , TAction >
EventHandler<ActionArgs> Romulus.ActionQueue-g< TQ, TAction >.ActionDone

Rasied when an action is done or redone.

template<TQ , TAction >
EventHandler<ActionArgs> Romulus.ActionQueue-g< TQ, TAction >.ActionsCombined

Raised when two actions are combined into a single action.

template<TQ , TAction >
EventHandler<ActionArgs> Romulus.ActionQueue-g< TQ, TAction >.ActionUndone

Raised when an action is undone.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events