Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
Medical Imaging Interaction Toolkit
berryIPerspectiveListener.cpp
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 
14 
15 #include "berryIWorkbenchPage.h"
16 
17 namespace berry {
18 
19 void
22 {
23  if (listener == nullptr) return;
24 
25  Types types = listener->GetPerspectiveEventTypes();
26 
27  if (types & ACTIVATED)
28  this->perspectiveActivated += Delegate2(listener, &IPerspectiveListener::PerspectiveActivated);
29  if (types & CHANGED)
30  this->perspectiveChanged += PerspChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
31  if (types & PART_CHANGED)
32  this->perspectivePartChanged += PerspPartChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
33  if (types & OPENED)
34  this->perspectiveOpened += Delegate2(listener, &IPerspectiveListener::PerspectiveOpened);
35  if (types & CLOSED)
36  this->perspectiveClosed += Delegate2(listener, &IPerspectiveListener::PerspectiveClosed);
37  if (types & DEACTIVATED)
38  this->perspectiveDeactivated += Delegate2(listener, &IPerspectiveListener::PerspectiveDeactivated);
39  if (types & SAVED_AS)
40  this->perspectiveSavedAs += PerspSavedAsDelegate(listener, &IPerspectiveListener::PerspectiveSavedAs);
41  if (types & PRE_DEACTIVATE)
42  this->perspectivePreDeactivate += Delegate2(listener, &IPerspectiveListener::PerspectivePreDeactivate);
43 }
44 
45 void
48 {
49  if (listener == nullptr) return;
50 
51  this->perspectiveActivated -= Delegate2(listener, &IPerspectiveListener::PerspectiveActivated);
52  this->perspectiveChanged -= PerspChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
53  this->perspectivePartChanged -= PerspPartChangedDelegate(listener, &IPerspectiveListener::PerspectiveChanged);
54  this->perspectiveOpened -= Delegate2(listener, &IPerspectiveListener::PerspectiveOpened);
55  this->perspectiveClosed -= Delegate2(listener, &IPerspectiveListener::PerspectiveClosed);
56  this->perspectiveDeactivated -= Delegate2(listener, &IPerspectiveListener::PerspectiveDeactivated);
57  this->perspectiveSavedAs -= PerspSavedAsDelegate(listener, &IPerspectiveListener::PerspectiveSavedAs);
58  this->perspectivePreDeactivate -= Delegate2(listener, &IPerspectiveListener::PerspectivePreDeactivate);
59 }
60 
62 {
63 }
64 
66  const IPerspectiveDescriptor::Pointer& /*perspective*/)
67 {}
68 
70  const IPerspectiveDescriptor::Pointer& /*perspective*/, const QString& /*changeId*/)
71 {}
72 
74  const IPerspectiveDescriptor::Pointer& /*perspective*/,
75  const IWorkbenchPartReference::Pointer& /*partRef*/, const QString& /*changeId*/)
76 {}
77 
79  const IPerspectiveDescriptor::Pointer& /*perspective*/)
80 {}
81 
83  const IPerspectiveDescriptor::Pointer& /*perspective*/)
84 {}
85 
87  const IPerspectiveDescriptor::Pointer& /*perspective*/)
88 {}
89 
91  const IPerspectiveDescriptor::Pointer& /*oldPerspective*/,
92  const IPerspectiveDescriptor::Pointer& /*newPerspective*/)
93 {}
94 
96  const IPerspectiveDescriptor::Pointer& /*perspective*/)
97 {}
98 
99 }
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)