Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryIExecutionListener.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 
14 #ifndef BERRYIEXECUTIONLISTENER_H_
15 #define BERRYIEXECUTIONLISTENER_H_
16 
17 #include <berryObject.h>
18 #include <berryMessage.h>
19 
22 
23 namespace berry {
24 
25 class ExecutionEvent;
26 
36 {
37 
38  struct Events {
39 
44 
45  virtual ~Events();
46 
47  virtual void AddListener(IExecutionListener* listener);
48  virtual void RemoveListener(IExecutionListener* listener);
49  virtual bool HasListeners() const;
50  virtual bool IsEmpty() const;
51 
52  private:
53 
58  };
59 
60  virtual ~IExecutionListener();
61 
72  virtual void NotHandled(const QString& commandId, const NotHandledException* exception) = 0;
73 
83  virtual void PostExecuteFailure(const QString& commandId,
84  const ExecutionException* exception) = 0;
85 
96  virtual void PostExecuteSuccess(const QString& commandId, const Object::Pointer& returnValue) = 0;
97 
108  virtual void PreExecute(const QString& commandId, const SmartPointer<const ExecutionEvent>& event) = 0;
109 };
110 
111 }
112 
113 #endif /* BERRYIEXECUTIONLISTENER_H_ */
Message2< const QString &, const ExecutionException * > postExecuteFailure
Message2< const QString &, const Object::Pointer & > postExecuteSuccess
Message2< const QString &, const SmartPointer< const ExecutionEvent > &> preExecute
Message2< const QString &, const NotHandledException * > notHandled