Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIPerspectiveListener.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 
18 #ifndef BERRYIPERSPECTIVELISTENER_H_
19 #define BERRYIPERSPECTIVELISTENER_H_
20 
24 
25 #include <berryMacros.h>
26 
27 namespace berry {
28 
29 struct IWorkbenchPage;
30 
41 {
42 
43  struct Events {
44 
45  enum Type {
46  NONE = 0x00000000,
47  ACTIVATED = 0x00000001,
48  CHANGED = 0x00000002,
49  PART_CHANGED = 0x00000004,
50  OPENED = 0x00000008,
51  CLOSED = 0x00000010,
52  DEACTIVATED = 0x00000020,
53  SAVED_AS = 0x00000040,
54  PRE_DEACTIVATE = 0x00000080,
55 
56  ALL = 0xffffffff
57  };
58 
59  Q_DECLARE_FLAGS(Types, Type)
60 
61  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveActivated;
62  Message3<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const QString&> perspectiveChanged;
63  Message4<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const SmartPointer<IWorkbenchPartReference>&, const QString&> perspectivePartChanged;
64  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveOpened;
65  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveClosed;
66  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectiveDeactivated;
67  Message3<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const IPerspectiveDescriptor::Pointer&> perspectiveSavedAs;
68  Message2<const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&> perspectivePreDeactivate;
69 
70  void AddListener(IPerspectiveListener* l);
71  void RemoveListener(IPerspectiveListener* l);
72 
73  private:
74 
75  typedef MessageDelegate2<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer& > Delegate2;
76  typedef MessageDelegate3<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const QString&> PerspChangedDelegate;
77  typedef MessageDelegate3<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const IPerspectiveDescriptor::Pointer&> PerspSavedAsDelegate;
78  typedef MessageDelegate4<IPerspectiveListener, const SmartPointer<IWorkbenchPage>&, const IPerspectiveDescriptor::Pointer&, const SmartPointer<IWorkbenchPartReference>&, const QString&> PerspPartChangedDelegate;
79 
80  };
81 
82  virtual ~IPerspectiveListener();
83 
84  virtual Events::Types GetPerspectiveEventTypes() const = 0;
85 
94  virtual void PerspectiveActivated(const SmartPointer<IWorkbenchPage>& page,
95  const IPerspectiveDescriptor::Pointer& perspective);
96 
106  virtual void PerspectiveChanged(const SmartPointer<IWorkbenchPage>& page,
107  const IPerspectiveDescriptor::Pointer& perspective, const QString& changeId);
108 
118  virtual void PerspectiveChanged(const SmartPointer<IWorkbenchPage>& page,
119  const IPerspectiveDescriptor::Pointer& perspective,
120  const SmartPointer<IWorkbenchPartReference>& partRef, const QString& changeId);
121 
132  virtual void PerspectiveOpened(const SmartPointer<IWorkbenchPage>& page,
133  const IPerspectiveDescriptor::Pointer& perspective);
134 
146  virtual void PerspectiveClosed(const SmartPointer<IWorkbenchPage>& page,
147  const IPerspectiveDescriptor::Pointer& perspective);
148 
159  virtual void PerspectiveDeactivated(const SmartPointer<IWorkbenchPage>& page,
160  const IPerspectiveDescriptor::Pointer& perspective);
161 
174  virtual void PerspectiveSavedAs(const SmartPointer<IWorkbenchPage>& page,
175  const IPerspectiveDescriptor::Pointer& oldPerspective,
176  const IPerspectiveDescriptor::Pointer& newPerspective);
177 
193  virtual void PerspectivePreDeactivate(const SmartPointer<IWorkbenchPage>& page,
194  const IPerspectiveDescriptor::Pointer& perspective);
195 };
196 
197 }
198 
199 Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IPerspectiveListener::Events::Types)
200 
201 #endif /* BERRYIPERSPECTIVELISTENER_H_ */
itk::SmartPointer< Self > Pointer
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