Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryIPartListener.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 BERRYIPARTLISTENER_H_
14 #define BERRYIPARTLISTENER_H_
15 
16 #include <berryMacros.h>
17 #include <berryMessage.h>
18 
21 
22 namespace berry {
23 
35 {
36 
37  struct Events {
38 
39  enum Type {
40  NONE = 0x00000000,
41  ACTIVATED = 0x00000001,
42  BROUGHT_TO_TOP = 0x00000002,
43  CLOSED = 0x00000004,
44  DEACTIVATED = 0x00000008,
45  OPENED = 0x00000010,
46  HIDDEN = 0x00000020,
47  VISIBLE = 0x00000040,
48  INPUT_CHANGED = 0x00000080,
49 
50  ALL = 0xffffffff
51  };
52 
53  Q_DECLARE_FLAGS(Types, Type)
54 
55  typedef Message1<const IWorkbenchPartReference::Pointer&> PartEvent;
56 
57  PartEvent partActivated;
58  PartEvent partBroughtToTop;
59  PartEvent partClosed;
60  PartEvent partDeactivated;
61  PartEvent partOpened;
62  PartEvent partHidden;
63  PartEvent partVisible;
64  PartEvent partInputChanged;
65 
66  void AddListener(IPartListener* listener);
67  void RemoveListener(IPartListener* listener);
68 
69  private:
71  };
72 
73  virtual ~IPartListener();
74 
75  virtual Events::Types GetPartEventTypes() const = 0;
76 
83  virtual void PartActivated(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
84 
98  virtual void PartBroughtToTop(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
99 
111  virtual void PartClosed(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
112 
119  virtual void PartDeactivated(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
120 
132  virtual void PartOpened(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
133 
139  virtual void PartHidden(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
140 
146  virtual void PartVisible(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
147 
153  virtual void PartInputChanged(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
154 };
155 
156 } // namespace berry
157 
158 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IPartListener::Events::Types)
159 
160 #endif /*BERRYIPARTLISTENER_H_*/
virtual void PartHidden(const IWorkbenchPartReference::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 &)
Message1< const IWorkbenchPartReference::Pointer & > PartEvent
#define BERRY_UI_QT