Medical Imaging Interaction Toolkit  2018.4.99-4c24e3cb
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 
71  typedef MessageDelegate2<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer& > Delegate2;
72  typedef MessageDelegate3<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const QString&> PerspChangedDelegate;
73  typedef MessageDelegate3<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const IPerspectiveDescriptor::Pointer&> PerspSavedAsDelegate;
74  typedef MessageDelegate4<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const SmartPointer<IWorkbenchPartReference>&, const QString&> PerspPartChangedDelegate;
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_ */
Implements transparent reference counting.
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
#define BERRY_UI_QT