Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIPartListener.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 BERRYIPARTLISTENER_H_
18 #define BERRYIPARTLISTENER_H_
19 
20 #include <berryMacros.h>
21 #include <berryMessage.h>
22 
25 
26 namespace berry {
27 
39 {
40 
41  struct Events {
42 
43  enum Type {
44  NONE = 0x00000000,
45  ACTIVATED = 0x00000001,
46  BROUGHT_TO_TOP = 0x00000002,
47  CLOSED = 0x00000004,
48  DEACTIVATED = 0x00000008,
49  OPENED = 0x00000010,
50  HIDDEN = 0x00000020,
51  VISIBLE = 0x00000040,
52  INPUT_CHANGED = 0x00000080,
53 
54  ALL = 0xffffffff
55  };
56 
57  Q_DECLARE_FLAGS(Types, Type)
58 
60 
61  PartEvent partActivated;
62  PartEvent partBroughtToTop;
63  PartEvent partClosed;
64  PartEvent partDeactivated;
65  PartEvent partOpened;
66  PartEvent partHidden;
67  PartEvent partVisible;
68  PartEvent partInputChanged;
69 
70  void AddListener(IPartListener* listener);
71  void RemoveListener(IPartListener* listener);
72 
73  private:
75  };
76 
77  virtual ~IPartListener();
78 
79  virtual Events::Types GetPartEventTypes() const = 0;
80 
87  virtual void PartActivated(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
88 
102  virtual void PartBroughtToTop(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
103 
115  virtual void PartClosed(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
116 
123  virtual void PartDeactivated(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
124 
136  virtual void PartOpened(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
137 
143  virtual void PartHidden(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
144 
150  virtual void PartVisible(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
151 
157  virtual void PartInputChanged(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
158 };
159 
160 } // namespace berry
161 
162 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IPartListener::Events::Types)
163 
164 #endif /*BERRYIPARTLISTENER_H_*/
virtual void PartHidden(const IWorkbenchPartReference::Pointer &)
itk::SmartPointer< Self > Pointer
virtual void PartOpened(const IWorkbenchPartReference::Pointer &)
virtual void PartDeactivated(const IWorkbenchPartReference::Pointer &)
virtual void PartInputChanged(const IWorkbenchPartReference::Pointer &)
virtual void PartClosed(const IWorkbenchPartReference::Pointer &)
virtual void PartVisible(const IWorkbenchPartReference::Pointer &)
virtual void PartBroughtToTop(const IWorkbenchPartReference::Pointer &)
#define BERRY_UI_QT