Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::AbstractHandlerWithState Class Reference

#include <berryAbstractHandlerWithState.h>

Inheritance diagram for berry::AbstractHandlerWithState:
Collaboration diagram for berry::AbstractHandlerWithState:

Public Member Functions

 berryObjectMacro (berry::AbstractHandlerWithState) void AddState(const QString &stateId
 
SmartPointer< StateGetState (const QString &stateId) const override
 
QList< QString > GetStateIds () const override
 
void RemoveState (const QString &stateId) override
 
- Public Member Functions inherited from berry::AbstractHandler
 AbstractHandler ()
 
void AddHandlerListener (IHandlerListener *handlerListener) override
 
void Dispose () override
 
bool IsEnabled () const override
 
void SetEnabled (const Object::Pointer &evaluationContext) override
 
bool IsHandled () const override
 
void RemoveHandlerListener (IHandlerListener *handlerListener) override
 
- Public Member Functions inherited from berry::IHandler
 berryObjectMacro (berry::IHandler) virtual void AddHandlerListener(IHandlerListener *handlerListener)=0
 
virtual Object::Pointer Execute (const SmartPointer< const ExecutionEvent > &event)=0
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 
- Public Member Functions inherited from berry::IObjectWithState
 berryObjectMacro (berry::IObjectWithState) virtual void AddState(const QString &id
 

Public Attributes

const SmartPointer< State > &state override
 
- Public Attributes inherited from berry::AbstractHandler
berryObjectMacro(AbstractHandler) private IHandlerListener::Events handlerListeners
 
- Public Attributes inherited from berry::IObjectWithState
const SmartPointer< State > & state
 

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Member Functions inherited from berry::AbstractHandler
void FireHandlerChanged (const SmartPointer< HandlerEvent > &handlerEvent)
 
void SetBaseEnabled (bool state)
 
virtual bool HasListeners () const
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 
- Protected Member Functions inherited from berry::IStateListener
virtual ~IStateListener ()
 
virtual void HandleStateChange (const SmartPointer< State > &state, const SmartPointer< Object > &oldValue)=0
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

An abstract implementation of IObjectWithState. This provides basic handling for adding and remove state. When state is added, the handler attaches itself as a listener and fire a handleStateChange event to notify this handler. When state is removed, the handler removes itself as a listener.

Clients may extend this class.

Definition at line 42 of file berryAbstractHandlerWithState.h.

Member Function Documentation

berry::AbstractHandlerWithState::berryObjectMacro ( berry::AbstractHandlerWithState  ) const

Adds a state to this handler. This will add this handler as a listener to the state, and then fire a handleStateChange so that the handler can respond to the incoming state.

Clients may extend this method, but they should call this super method first before doing anything else.

Parameters
stateIdThe identifier indicating the type of state being added; must not be null.
stateThe state to add; must not be null.
SmartPointer< State > berry::AbstractHandlerWithState::GetState ( const QString &  stateId) const
overridevirtual

Gets the state with the given id.

Parameters
stateIdThe identifier of the state to retrieve; must not be null.
Returns
The state; may be null if there is no state with the given id.

Implements berry::IObjectWithState.

Definition at line 35 of file berryAbstractHandlerWithState.cpp.

QList< QString > berry::AbstractHandlerWithState::GetStateIds ( ) const
overridevirtual

Gets the identifiers for all of the state associated with this object.

Returns
All of the state identifiers; may be empty, but never null.

Implements berry::IObjectWithState.

Definition at line 42 of file berryAbstractHandlerWithState.cpp.

void berry::AbstractHandlerWithState::RemoveState ( const QString &  stateId)
overridevirtual

Removes a state from this handler. This will remove this handler as a listener to the state. No event is fired to notify the handler of this change.

Clients may extend this method, but they should call this super method first before doing anything else.

Parameters
stateIdThe identifier of the state to remove; must not be null.

Implements berry::IObjectWithState.

Definition at line 47 of file berryAbstractHandlerWithState.cpp.

Member Data Documentation

const SmartPointer<State>& state berry::AbstractHandlerWithState::override

Definition at line 75 of file berryAbstractHandlerWithState.h.


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