Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryAbstractHandler.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BERRYABSTRACTHANDLER_H_
14 #define BERRYABSTRACTHANDLER_H_
15 
16 #include "berryIHandler.h"
17 #include "berryIHandlerListener.h"
18 
20 
21 namespace berry {
22 
34 class BERRY_COMMANDS AbstractHandler : public QObject, public IHandler { // ,public EventManager {
35 
36  Q_OBJECT
37  Q_INTERFACES(berry::IHandler)
38 
39 public:
41 
42 private:
43 
47  bool baseEnabled;
48 
50 
51 public:
52 
54 
58  void AddHandlerListener(IHandlerListener* handlerListener) override;
59 
66  void Dispose() override;
67 
78  bool IsEnabled() const override;
79 
90  void SetEnabled(const Object::Pointer& evaluationContext) override;
91 
98  bool IsHandled() const override;
99 
103  void RemoveHandlerListener(IHandlerListener* handlerListener) override;
104 
105 protected:
106 
123  void FireHandlerChanged(const SmartPointer<HandlerEvent>& handlerEvent);
124 
134  void SetBaseEnabled(bool state);
135 
153  virtual bool HasListeners() const;
154 
155 };
156 
157 }
158 
159 #endif /*BERRYABSTRACTHANDLER_H_*/
berryObjectMacro(AbstractHandler) private IHandlerListener::Events handlerListeners
#define berryObjectMacro(...)
Definition: berryMacros.h:33