Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
berry::IHandler Struct Referenceabstract

#include <berryIHandler.h>

Inheritance diagram for berry::IHandler:
Collaboration diagram for berry::IHandler:

Public Member Functions

 berryObjectMacro (berry::IHandler)
 
virtual void AddHandlerListener (IHandlerListener *handlerListener)=0
 
virtual void Dispose ()=0
 
virtual Object::Pointer Execute (const SmartPointer< const ExecutionEvent > &event)=0
 
virtual void SetEnabled (const Object::Pointer &evaluationContext)=0
 
virtual bool IsEnabled () const =0
 
virtual bool IsHandled () const =0
 
virtual void RemoveHandlerListener (IHandlerListener *handlerListener)=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
 

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::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 Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

A handler is the pluggable piece of a command that handles execution. Each command can have zero or more handlers associated with it (in general), of which only one will be active at any given moment in time. When the command is asked to execute, it will simply pass that request on to its active handler, if any.

See also
AbstractHandler

Definition at line 34 of file berryIHandler.h.

Member Function Documentation

◆ AddHandlerListener()

virtual void berry::IHandler::AddHandlerListener ( IHandlerListener handlerListener)
pure virtual

Registers an instance of IHandlerListener to listen for changes to properties of this instance.

Parameters
handlerListenerthe instance to register. Must not be null. If an attempt is made to register an instance which is already registered with this instance, no operation is performed.

Implemented in berry::AbstractHandler.

◆ berryObjectMacro()

berry::IHandler::berryObjectMacro ( berry::IHandler  )

◆ Dispose()

virtual void berry::IHandler::Dispose ( )
pure virtual

Disposes of this handler. This method is run once when the object is no longer referenced. This can be used as an opportunity to unhook listeners from other objects.

Implemented in berry::AbstractHandler.

◆ Execute()

virtual Object::Pointer berry::IHandler::Execute ( const SmartPointer< const ExecutionEvent > &  event)
pure virtual

Executes with the map of parameter values by name.

Parameters
eventAn event containing all the information about the current state of the application; must not be null.
Returns
the result of the execution. Reserved for future use, must be null.
Exceptions
ExecutionExceptionif an exception occurred during execution.

◆ IsEnabled()

virtual bool berry::IHandler::IsEnabled ( ) const
pure virtual

Returns whether this handler is capable of executing at this moment in time. If the enabled state is other than true clients should also consider implementing IHandler2 so they can be notified about framework execution contexts.

Returns
true if the command is enabled; false otherwise.
See also
IHandler2::setEnabled(Object)

Implemented in berry::AbstractHandler.

◆ IsHandled()

virtual bool berry::IHandler::IsHandled ( ) const
pure virtual

Returns whether this handler is really capable of handling delegation. In the case of a handler that is a composition of other handlers, this reply is intended to indicate whether the handler is truly capable of receiving delegated responsibilities at this time.

Returns
true if the handler is handled; false otherwise.

Implemented in berry::AbstractHandler.

◆ RemoveHandlerListener()

virtual void berry::IHandler::RemoveHandlerListener ( IHandlerListener handlerListener)
pure virtual

Unregisters an instance of IHandlerListener listening for changes to properties of this instance.

Parameters
handlerListenerthe instance to unregister. Must not be null. If an attempt is made to unregister an instance which is not already registered with this instance, no operation is performed.

Implemented in berry::AbstractHandler.

◆ SetEnabled()

virtual void berry::IHandler::SetEnabled ( const Object::Pointer evaluationContext)
pure virtual

Called by the framework to allow the handler to update its enabled state.

Parameters
evaluationContextthe state to evaluate against. May be null which indicates that the handler can query whatever model that is necessary. This context must not be cached.

Implemented in berry::AbstractHandler.


The documentation for this struct was generated from the following file: