Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIExecutionListener.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 
18 #ifndef BERRYIEXECUTIONLISTENER_H_
19 #define BERRYIEXECUTIONLISTENER_H_
20 
21 #include <berryObject.h>
22 #include <berryMessage.h>
23 
26 
27 namespace berry {
28 
29 class ExecutionEvent;
30 
40 {
41 
42  struct Events {
43 
48 
49  virtual ~Events();
50 
51  virtual void AddListener(IExecutionListener* listener);
52  virtual void RemoveListener(IExecutionListener* listener);
53  virtual bool HasListeners() const;
54  virtual bool IsEmpty() const;
55 
56  private:
57 
62  };
63 
64  virtual ~IExecutionListener();
65 
76  virtual void NotHandled(const QString& commandId, const NotHandledException* exception) = 0;
77 
87  virtual void PostExecuteFailure(const QString& commandId,
88  const ExecutionException* exception) = 0;
89 
100  virtual void PostExecuteSuccess(const QString& commandId, const Object::Pointer& returnValue) = 0;
101 
112  virtual void PreExecute(const QString& commandId, const SmartPointer<const ExecutionEvent>& event) = 0;
113 };
114 
115 }
116 
117 #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