This class is the core class responsible for the management of actions. More...
#include <actionhandler.h>
Public Types | |
typedef std::map< String, Action * > | ActionContainer |
Container type for Action instances that are stored by this class. | |
typedef ActionContainer::iterator | ActionIterator |
Iterator type for Action instances that are stored in this class. | |
typedef std::vector< Action * > | ActivatedContainer |
Container type for in-progress Action instances that are stored by this class. | |
typedef ActivatedContainer::iterator | ActivatedIterator |
Iterator type for in-progress Action instances that are stored in this class. | |
typedef std::multimap< Input::MetaCodeKey, Action * > | BindingContainer |
Container for bindings that connect to input codes to actions. | |
typedef BindingContainer::iterator | BindingIterator |
Iterator type for input-action bindings stored in this class. | |
typedef std::pair< Input::MetaCodeKey, Action * > | BindingPair |
A convenience type for the actual input-action binding. | |
typedef std::pair< BindingIterator, BindingIterator > | BindingRange |
A convenience type for an iterator range of bindings. | |
typedef ActionContainer::const_iterator | ConstActionIterator |
Const Iterator type for Action instances that are stored in this class. | |
typedef ActivatedContainer::const_iterator | ConstActivatedIterator |
Const Iterator type for in-progress Action instances that are stored in this class. | |
typedef BindingContainer::const_iterator | ConstBindingIterator |
Const Iterator type for input-action bindings stored in this class. | |
typedef std::pair< ConstBindingIterator, ConstBindingIterator > | ConstBindingRange |
A convenience type for a const iterator range of bindings. | |
Public Member Functions | |
ActionHandler () | |
Class constructor. | |
~ActionHandler () | |
Class destructor. | |
bool | _HandleInput (const Input::MetaCode &Code) |
Handles input passed to this handler. More... | |
void | _NotifyActionActivated (Action *BeingActivated) |
Used by Actions to notify this handler it was activated. More... | |
void | _ProcessAllActions () |
Processes all active actions, and deactivates them if necessary. More... | |
ActionIterator | BeginAction () |
Gets an iterator to the first Action. More... | |
ConstActionIterator | BeginAction () const |
Gets a const iterator to the first Action. More... | |
BindingIterator | BeginBinding () |
Gets an iterator to the first Binding. More... | |
ConstBindingIterator | BeginBinding () const |
Gets a const iterator to the first Binding. More... | |
void | Bind (const Input::MetaCode &Code, Action *ToBind, bool ForceUnique=true) |
Binds a MetaCode to an action, making the action fire when this handler recieves the code. More... | |
Action * | CreateAction (const String &Name) |
Creates a new Action that can be bound to a MetaCode. More... | |
void | DestroyAction (Action *ToBeDestroyed) |
Destroy's an action. More... | |
void | DestroyAllActions () |
Destroys all Actions being stored by this Handler. | |
ActionIterator | EndAction () |
Gets an iterator to one-passed-the-last Action. More... | |
ConstActionIterator | EndAction () const |
Gets a const iterator to one-passed-the-last Action. More... | |
BindingIterator | EndBinding () |
Gets an iterator to one-passed-the-last Binding. More... | |
ConstBindingIterator | EndBinding () const |
Gets a const iterator to one-passed-the-last Binding. More... | |
Action * | GetAction (const String &Name) |
Gets an Action by name. More... | |
ConstBindingRange | GetActionsBoundToCode (const Input::MetaCode &Code) |
Gets all Actions bound to a MetaCode. More... | |
void | RemoveAllBindings () |
Completely removes all bindings from this Handler. | |
void | Unbind (const Input::MetaCode &Code) |
Unbinds Actions via MetaCode. More... | |
void | Unbind (Action *ToUnbind) |
Unbinds an Action via Action pointer. More... | |
void | UnbindAll () |
Unbinds all actions in this handler. More... | |
Protected Attributes | |
ActionContainer | Actions |
Container storing all registered actions. More... | |
ActivatedContainer | ActivatedActions |
Container storing all the actions that are in-progress. More... | |
BindingContainer | Bindings |
Container storing all the bindings that connect inputs to actions. More... | |
This class is the core class responsible for the management of actions.
Definition at line 54 of file actionhandler.h.
bool Mezzanine::UI::ActionHandler::_HandleInput | ( | const Input::MetaCode & | Code | ) |
Handles input passed to this handler.
Code | The MetaCode to be processed. |
Definition at line 208 of file actionhandler.cpp.
void Mezzanine::UI::ActionHandler::_NotifyActionActivated | ( | Action * | BeingActivated | ) |
Used by Actions to notify this handler it was activated.
BeingActivated | The Action calling this method and being activated. |
Definition at line 198 of file actionhandler.cpp.
void Mezzanine::UI::ActionHandler::_ProcessAllActions | ( | ) |
Processes all active actions, and deactivates them if necessary.
Definition at line 219 of file actionhandler.cpp.
ActionHandler::ActionIterator Mezzanine::UI::ActionHandler::BeginAction | ( | ) |
Gets an iterator to the first Action.
Definition at line 104 of file actionhandler.cpp.
ActionHandler::ConstActionIterator Mezzanine::UI::ActionHandler::BeginAction | ( | ) | const |
Gets a const iterator to the first Action.
Definition at line 114 of file actionhandler.cpp.
ActionHandler::BindingIterator Mezzanine::UI::ActionHandler::BeginBinding | ( | ) |
Gets an iterator to the first Binding.
Definition at line 175 of file actionhandler.cpp.
ActionHandler::ConstBindingIterator Mezzanine::UI::ActionHandler::BeginBinding | ( | ) | const |
Gets a const iterator to the first Binding.
Definition at line 185 of file actionhandler.cpp.
void Mezzanine::UI::ActionHandler::Bind | ( | const Input::MetaCode & | Code, |
Action * | ToBind, | ||
bool | ForceUnique = true |
||
) |
Binds a MetaCode to an action, making the action fire when this handler recieves the code.
Code | The code to trigger the Action. |
ToBind | The Action to be triggered. |
ForceUnique | If true this will clear any previous entries that are equal to the MetaCode provided in the binding multimap. |
Definition at line 132 of file actionhandler.cpp.
Creates a new Action that can be bound to a MetaCode.
Name | The name to be given to the created Action. |
Definition at line 63 of file actionhandler.cpp.
void Mezzanine::UI::ActionHandler::DestroyAction | ( | Action * | ToBeDestroyed | ) |
Destroy's an action.
ToBeDestroyed | The action to be destroyed. |
Definition at line 83 of file actionhandler.cpp.
ActionHandler::ActionIterator Mezzanine::UI::ActionHandler::EndAction | ( | ) |
Gets an iterator to one-passed-the-last Action.
Definition at line 109 of file actionhandler.cpp.
ActionHandler::ConstActionIterator Mezzanine::UI::ActionHandler::EndAction | ( | ) | const |
Gets a const iterator to one-passed-the-last Action.
Definition at line 119 of file actionhandler.cpp.
ActionHandler::BindingIterator Mezzanine::UI::ActionHandler::EndBinding | ( | ) |
Gets an iterator to one-passed-the-last Binding.
Definition at line 180 of file actionhandler.cpp.
ActionHandler::ConstBindingIterator Mezzanine::UI::ActionHandler::EndBinding | ( | ) | const |
Gets a const iterator to one-passed-the-last Binding.
Definition at line 190 of file actionhandler.cpp.
Gets an Action by name.
Name | The name of the Action to retrieve. |
Definition at line 76 of file actionhandler.cpp.
ActionHandler::ConstBindingRange Mezzanine::UI::ActionHandler::GetActionsBoundToCode | ( | const Input::MetaCode & | Code | ) |
Gets all Actions bound to a MetaCode.
Code | The MetaCode to use to search for bound Actions. |
Definition at line 127 of file actionhandler.cpp.
void Mezzanine::UI::ActionHandler::Unbind | ( | const Input::MetaCode & | Code | ) |
Unbinds Actions via MetaCode.
Code | The MetaCode to find and remove all bindings to actions. |
Definition at line 146 of file actionhandler.cpp.
void Mezzanine::UI::ActionHandler::Unbind | ( | Action * | ToUnbind | ) |
void Mezzanine::UI::ActionHandler::UnbindAll | ( | ) |
Unbinds all actions in this handler.
Definition at line 162 of file actionhandler.cpp.
|
protected |
Container storing all registered actions.
Definition at line 84 of file actionhandler.h.
|
protected |
Container storing all the actions that are in-progress.
Definition at line 90 of file actionhandler.h.
|
protected |
Container storing all the bindings that connect inputs to actions.
Definition at line 87 of file actionhandler.h.