MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Mezzanine::UI::Action Class Reference

This class represents an action to be taken. Can have multiple inputs bound to it. More...

#include <action.h>

+ Inheritance diagram for Mezzanine::UI::Action:
+ Collaboration diagram for Mezzanine::UI::Action:

Public Member Functions

Boolean _HandleInput (const Input::MetaCode &Code)
 Handles input passed to this Action. More...
 
void _OnActivateAction ()
 Runs all logic associated with this Action being activated. More...
 
void _OnDeactivateAction ()
 Runs all logic associated with this Action being deactivated. More...
 
const StringGetName () const
 Gets the name of this Action. More...
 
- Public Member Functions inherited from Mezzanine::EventPublisher
 EventPublisher ()
 Class constructor.
 
virtual ~EventPublisher ()
 Class destructor.
 
EventGetEvent (const String &EventName) const
 Gets an event in this publisher. More...
 
EventGetEventExcept (const String &EventName) const
 Gets an event in this publisher.

Exceptions
Thisversion differs from the non-except version in that if it fails to find the event specified it will throw a "II_IDENTITY_NOT_FOUND_EXCEPTION".
More...
 
EventSubscriberSlotSubscribe (const String &EventName, EventSubscriber *Sub)
 Adds a subscriber to this event. More...
 
EventSubscriberSlotSubscribe (const String &EventName, FunctorSubscriberSlot::FunctorDefinition *Funct, Boolean CleanUpAfter)
 Subscribes a functor object to this event. More...
 
EventSubscriberSlotSubscribe (const String &EventName, CFunctionSubscriberSlot::SubscriberFunction *CFunct)
 Subscribes a C-style function to this event. More...
 
EventSubscriberSlotSubscribe (const String &EventName, Scripting::iScript *SubScript)
 Subscribes a script to this event. More...
 
void Unsubscribe (EventSubscriber *Subscriber)
 Unsubscribes a single subscriber all events in this publisher. More...
 
void Unsubscribe (FunctorSubscriberSlot::FunctorDefinition *Funct)
 Unsubscribes a single subscriber all events in this publisher. More...
 
void Unsubscribe (CFunctionSubscriberSlot::SubscriberFunction *CFunct)
 Unsubscribes a single subscriber from all events in this publisher. More...
 
void Unsubscribe (Scripting::iScript *SubScript)
 Unsubscribes a single subscriber from all events in this publisher. More...
 
void Unsubscribe (EventSubscriberSlot *SubSlot)
 Unsubscribes a single subscriber from all events in this publisher. More...
 
void Unsubscribe (const String &EventName, EventSubscriber *Subscriber)
 Unsubscribes a single subscriber from the named event. More...
 
void Unsubscribe (const String &EventName, FunctorSubscriberSlot::FunctorDefinition *Funct)
 Unsubscribes a single subscriber from the named event. More...
 
void Unsubscribe (const String &EventName, CFunctionSubscriberSlot::SubscriberFunction *CFunct)
 Unsubscribes a single subscriber from the named event. More...
 
void Unsubscribe (const String &EventName, Scripting::iScript *SubScript)
 Unsubscribes a single subscriber from the named event. More...
 
void Unsubscribe (const String &EventName, EventSubscriberSlot *SubSlot)
 Unsubscribes a single subscriber from the named event. More...
 
Whole UnsubscribeAll ()
 Unsubscribes all subscribers from all events in this publisher. More...
 
Whole UnsubscribeAll (const String &EventName)
 Unsubscribes all subscribers from the named Event. More...
 

Static Public Attributes

static const String EventActionActivated = "ActionActivated"
 Event name for when this Action is activated.
 
static const String EventActionDeactivated = "ActionDeactivated"
 Event name for when this Action is deactivated.
 

Protected Member Functions

 Action (const String &Name, ActionHandler *Handler)
 Class constructor. More...
 
 ~Action ()
 Class destructor.
 
- Protected Member Functions inherited from Mezzanine::EventPublisher
EventAddEvent (const String &EventName)
 Creates a new event this Publisher can fire. More...
 
void FireEvent (const EventArguments &Args)
 Fires an event. More...
 
void RemoveAllEvents ()
 Removes all events in this Publisher. More...
 
void RemoveEvent (const String &EventName)
 Removes an existing event in this Publisher. More...
 

Protected Attributes

const String ActionName
 The name of this action. More...
 
ActionHandlerParent
 A pointer to the handler that owns this Action. More...
 
- Protected Attributes inherited from Mezzanine::EventPublisher
EventContainer Events
 A container storing all the Events published by this class by name. More...
 

Friends

class ActionHandler
 

Additional Inherited Members

- Public Types inherited from Mezzanine::EventPublisher
typedef
EventContainer::const_iterator 
ConstEventIterator
 Const Iterator type for Event instances stored by this class.
 
typedef std::map< String, Event * > EventContainer
 Basic container type for Event storage by this class.
 
typedef EventContainer::iterator EventIterator
 Iterator type for Event instances stored by this class.
 

Detailed Description

This class represents an action to be taken. Can have multiple inputs bound to it.

Definition at line 78 of file action.h.

Constructor & Destructor Documentation

Mezzanine::UI::Action::Action ( const String Name,
ActionHandler Handler 
)
protected

Class constructor.

Parameters
NameThe name to be given to the action.

Definition at line 52 of file action.cpp.

Member Function Documentation

Boolean Mezzanine::UI::Action::_HandleInput ( const Input::MetaCode Code)

Handles input passed to this Action.

Parameters
CodeThe MetaCode to be processed.
Returns
Returns true if this input was consumed/handled, false otherwise.

Definition at line 87 of file action.cpp.

void Mezzanine::UI::Action::_OnActivateAction ( )

Runs all logic associated with this Action being activated.

Definition at line 75 of file action.cpp.

void Mezzanine::UI::Action::_OnDeactivateAction ( )

Runs all logic associated with this Action being deactivated.

Definition at line 81 of file action.cpp.

const String & Mezzanine::UI::Action::GetName ( ) const

Gets the name of this Action.

Returns
Returns a const reference to a string containing the name of this Action.

Definition at line 67 of file action.cpp.

Member Data Documentation

const String Mezzanine::UI::Action::ActionName
protected

The name of this action.

Definition at line 89 of file action.h.

ActionHandler* Mezzanine::UI::Action::Parent
protected

A pointer to the handler that owns this Action.

Definition at line 92 of file action.h.


The documentation for this class was generated from the following files: