Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
berryIPerspectiveListener.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 BERRYIPERSPECTIVELISTENER_H_
15 #define BERRYIPERSPECTIVELISTENER_H_
16 
20 
21 #include <berryMacros.h>
22 
23 namespace berry {
24 
25 struct IWorkbenchPage;
26 
37 {
38 
39  struct Events {
40 
41  enum Type {
42  NONE = 0x00000000,
43  ACTIVATED = 0x00000001,
44  CHANGED = 0x00000002,
45  PART_CHANGED = 0x00000004,
46  OPENED = 0x00000008,
47  CLOSED = 0x00000010,
48  DEACTIVATED = 0x00000020,
49  SAVED_AS = 0x00000040,
50  PRE_DEACTIVATE = 0x00000080,
51 
52  ALL = 0xffffffff
53  };
54 
55  Q_DECLARE_FLAGS(Types, Type)
56 
57  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveActivated;
58  Message3<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const QString&> perspectiveChanged;
59  Message4<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const SmartPointer<IWorkbenchPartReference>&, const QString&> perspectivePartChanged;
60  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveOpened;
61  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveClosed;
62  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveDeactivated;
63  Message3<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const IPerspectiveDescriptor::Pointer&> perspectiveSavedAs;
64  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectivePreDeactivate;
65 
66  void AddListener(IPerspectiveListener* l);
67  void RemoveListener(IPerspectiveListener* l);
68 
69  private:
70 
75 
76  };
77 
78  virtual ~IPerspectiveListener();
79 
80  virtual Events::Types GetPerspectiveEventTypes() const = 0;
81 
90  virtual void PerspectiveActivated(const SmartPointer<IWorkbenchPage>& page,
91  const IPerspectiveDescriptor::Pointer& perspective);
92 
102  virtual void PerspectiveChanged(const SmartPointer<IWorkbenchPage>& page,
103  const IPerspectiveDescriptor::Pointer& perspective, const QString& changeId);
104 
114  virtual void PerspectiveChanged(const SmartPointer<IWorkbenchPage>& page,
115  const IPerspectiveDescriptor::Pointer& perspective,
116  const SmartPointer<IWorkbenchPartReference>& partRef, const QString& changeId);
117 
128  virtual void PerspectiveOpened(const SmartPointer<IWorkbenchPage>& page,
129  const IPerspectiveDescriptor::Pointer& perspective);
130 
142  virtual void PerspectiveClosed(const SmartPointer<IWorkbenchPage>& page,
143  const IPerspectiveDescriptor::Pointer& perspective);
144 
155  virtual void PerspectiveDeactivated(const SmartPointer<IWorkbenchPage>& page,
156  const IPerspectiveDescriptor::Pointer& perspective);
157 
170  virtual void PerspectiveSavedAs(const SmartPointer<IWorkbenchPage>& page,
171  const IPerspectiveDescriptor::Pointer& oldPerspective,
172  const IPerspectiveDescriptor::Pointer& newPerspective);
173 
189  virtual void PerspectivePreDeactivate(const SmartPointer<IWorkbenchPage>& page,
190  const IPerspectiveDescriptor::Pointer& perspective);
191 };
192 
193 }
194 
195 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IPerspectiveListener::Events::Types)
196 
197 #endif /* BERRYIPERSPECTIVELISTENER_H_ */
org_blueberry_ui_qt_Export.h
berryIWorkbenchPartReference.h
berry::MessageDelegate4
Definition: berryMessage.h:309
berryMacros.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berry::Message3
Definition: berryMessage.h:929
perspective
The custom viewer plugin implements simple viewer functionality presented in a customized look and feel It was developed to demonstrate extensibility and customizability of the blueberry application framework As an example for the GUI customization capabilities provided by the BlueBerry application the custom viewer plugin was developed It features simple viewer functionality presented in a customized look and feel The custom viewer consists of two i e a viewer perspective and a DICOM perspective As part of the viewer perspective
Definition: CustomViewerExample.dox:312
berry::IPerspectiveListener::Events::Type
Type
Definition: berryIPerspectiveListener.h:41
berry::Message2
Definition: berryMessage.h:858
berry::IPerspectiveListener::Events
Definition: berryIPerspectiveListener.h:39
berry::Message4
Definition: berryMessage.h:1000
berry::IWorkbenchPartReference
Definition: berryIWorkbenchPartReference.h:36
BERRY_UI_QT
#define BERRY_UI_QT
Definition: org_blueberry_ui_qt_Export.h:26
berry::MessageDelegate2
Definition: berryMessage.h:216
berry::IPerspectiveListener
Definition: berryIPerspectiveListener.h:36
berryIPerspectiveDescriptor.h
berry::IWorkbenchPage
Definition: berryIWorkbenchPage.h:65
berry
Definition: QmitkPropertyItemModel.h:24
berry::IPerspectiveDescriptor
Definition: berryIPerspectiveDescriptor.h:56
berry::MessageDelegate3
Definition: berryMessage.h:262