Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryAbstractHandler.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRYABSTRACTHANDLER_H_
18 #define BERRYABSTRACTHANDLER_H_
19 
20 #include "berryIHandler.h"
21 #include "berryIHandlerListener.h"
22 
24 
25 namespace berry {
26 
38 class BERRY_COMMANDS AbstractHandler : public QObject, public IHandler { // ,public EventManager {
39 
40  Q_OBJECT
41  Q_INTERFACES(berry::IHandler)
42 
43 public:
45 
46 private:
47 
51  bool baseEnabled;
52 
53  IHandlerListener::Events handlerListeners;
54 
55 public:
56 
58 
62  void AddHandlerListener(IHandlerListener* handlerListener) override;
63 
70  void Dispose() override;
71 
82  bool IsEnabled() const override;
83 
94  void SetEnabled(const Object::Pointer& evaluationContext) override;
95 
102  bool IsHandled() const override;
103 
107  void RemoveHandlerListener(IHandlerListener* handlerListener) override;
108 
109 protected:
110 
127  void FireHandlerChanged(const SmartPointer<HandlerEvent>& handlerEvent);
128 
138  void SetBaseEnabled(bool state);
139 
157  virtual bool HasListeners() const;
158 
159 };
160 
161 }
162 
163 #endif /*BERRYABSTRACTHANDLER_H_*/
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
#define berryObjectMacro(...)
Definition: berryMacros.h:37