Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIPerspectiveListener.cpp
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 
18 
19 #include "berryIWorkbenchPage.h"
20 
21 namespace berry {
22 
23 void
26 {
27  if (listener == nullptr) return;
28 
29  Types types = listener->GetPerspectiveEventTypes();
30 
31  if (types & ACTIVATED)
32  this->perspectiveActivated += Delegate2(listener, &IPerspectiveListener::PerspectiveActivated);
33  if (types & CHANGED)
34  this->perspectiveChanged += PerspChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
35  if (types & PART_CHANGED)
36  this->perspectivePartChanged += PerspPartChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
37  if (types & OPENED)
38  this->perspectiveOpened += Delegate2(listener, &IPerspectiveListener::PerspectiveOpened);
39  if (types & CLOSED)
40  this->perspectiveClosed += Delegate2(listener, &IPerspectiveListener::PerspectiveClosed);
41  if (types & DEACTIVATED)
42  this->perspectiveDeactivated += Delegate2(listener, &IPerspectiveListener::PerspectiveDeactivated);
43  if (types & SAVED_AS)
44  this->perspectiveSavedAs += PerspSavedAsDelegate(listener, &IPerspectiveListener::PerspectiveSavedAs);
45  if (types & PRE_DEACTIVATE)
46  this->perspectivePreDeactivate += Delegate2(listener, &IPerspectiveListener::PerspectivePreDeactivate);
47 }
48 
49 void
52 {
53  if (listener == nullptr) return;
54 
55  this->perspectiveActivated -= Delegate2(listener, &IPerspectiveListener::PerspectiveActivated);
56  this->perspectiveChanged -= PerspChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
57  this->perspectivePartChanged -= PerspPartChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
58  this->perspectiveOpened -= Delegate2(listener, &IPerspectiveListener::PerspectiveOpened);
59  this->perspectiveClosed -= Delegate2(listener, &IPerspectiveListener::PerspectiveClosed);
60  this->perspectiveDeactivated -= Delegate2(listener, &IPerspectiveListener::PerspectiveDeactivated);
61  this->perspectiveSavedAs -= PerspSavedAsDelegate(listener, &IPerspectiveListener::PerspectiveSavedAs);
62  this->perspectivePreDeactivate -= Delegate2(listener, &IPerspectiveListener::PerspectivePreDeactivate);
63 }
64 
66 {
67 }
68 
70  const IPerspectiveDescriptor::Pointer& /*perspective*/)
71 {}
72 
74  const IPerspectiveDescriptor::Pointer& /*perspective*/, const QString& /*changeId*/)
75 {}
76 
78  const IPerspectiveDescriptor::Pointer& /*perspective*/,
79  const IWorkbenchPartReference::Pointer& /*partRef*/, const QString& /*changeId*/)
80 {}
81 
83  const IPerspectiveDescriptor::Pointer& /*perspective*/)
84 {}
85 
87  const IPerspectiveDescriptor::Pointer& /*perspective*/)
88 {}
89 
91  const IPerspectiveDescriptor::Pointer& /*perspective*/)
92 {}
93 
95  const IPerspectiveDescriptor::Pointer& /*oldPerspective*/,
96  const IPerspectiveDescriptor::Pointer& /*newPerspective*/)
97 {}
98 
100  const IPerspectiveDescriptor::Pointer& /*perspective*/)
101 {}
102 
103 }
virtual void PerspectiveActivated(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)
virtual void PerspectiveOpened(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)
Implements transparent reference counting.
virtual void PerspectiveClosed(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)
virtual Events::Types GetPerspectiveEventTypes() const =0
virtual void PerspectivePreDeactivate(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)
virtual void PerspectiveSavedAs(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &oldPerspective, const IPerspectiveDescriptor::Pointer &newPerspective)
void RemoveListener(IPerspectiveListener *l)
virtual void PerspectiveChanged(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective, const QString &changeId)
virtual void PerspectiveDeactivated(const SmartPointer< IWorkbenchPage > &page, const IPerspectiveDescriptor::Pointer &perspective)