Medical Imaging Interaction Toolkit  2024.06.00
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 
81  virtual void PartActivated(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
82 
94  virtual void PartBroughtToTop(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
95 
105  virtual void PartClosed(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
106 
111  virtual void PartDeactivated(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
112 
122  virtual void PartOpened(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
123 
127  virtual void PartHidden(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
128 
132  virtual void PartVisible(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
133 
137  virtual void PartInputChanged(const IWorkbenchPartReference::Pointer& /*partRef*/) {}
138 };
139 
140 } // namespace berry
141 
142 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IPartListener::Events::Types)
143 
144 #endif /*BERRYIPARTLISTENER_H_*/
berry::IPartListener::PartHidden
virtual void PartHidden(const IWorkbenchPartReference::Pointer &)
Definition: berryIPartListener.h:127
org_blueberry_ui_qt_Export.h
berryIWorkbenchPartReference.h
berryMacros.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berryMessage.h
berry::Message1
Definition: berryMessage.h:787
berry::IPartListener::Events::Type
Type
Definition: berryIPartListener.h:39
berry::IPartListener::PartDeactivated
virtual void PartDeactivated(const IWorkbenchPartReference::Pointer &)
Definition: berryIPartListener.h:111
berry::MessageDelegate1
Definition: berryMessage.h:170
berry::IPartListener::PartOpened
virtual void PartOpened(const IWorkbenchPartReference::Pointer &)
Definition: berryIPartListener.h:122
berry::IPartListener::Events
Definition: berryIPartListener.h:37
berry::IPartListener::PartInputChanged
virtual void PartInputChanged(const IWorkbenchPartReference::Pointer &)
Definition: berryIPartListener.h:137
berry::IPartListener
Definition: berryIPartListener.h:34
berry::IWorkbenchPartReference
Definition: berryIWorkbenchPartReference.h:36
BERRY_UI_QT
#define BERRY_UI_QT
Definition: org_blueberry_ui_qt_Export.h:26
berry::IPartListener::PartVisible
virtual void PartVisible(const IWorkbenchPartReference::Pointer &)
Definition: berryIPartListener.h:132
berry::IPartListener::PartClosed
virtual void PartClosed(const IWorkbenchPartReference::Pointer &)
Definition: berryIPartListener.h:105
berry::IPartListener::PartBroughtToTop
virtual void PartBroughtToTop(const IWorkbenchPartReference::Pointer &)
Definition: berryIPartListener.h:94
berry
Definition: QmitkPropertyItemModel.h:24