Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryIPartListener.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 
13 #include "berryIPartListener.h"
14 
15 namespace berry {
16 
17 void
20 {
21  if (l == nullptr) return;
22 
23  Types t = l->GetPartEventTypes();
24 
25  if (t & ACTIVATED)
26  partActivated += Delegate(l, &IPartListener::PartActivated);
27  if (t & BROUGHT_TO_TOP)
28  partBroughtToTop += Delegate(l, &IPartListener::PartBroughtToTop);
29  if (t & CLOSED)
30  partClosed += Delegate(l, &IPartListener::PartClosed);
31  if (t & DEACTIVATED)
32  partDeactivated += Delegate(l, &IPartListener::PartDeactivated);
33  if (t & OPENED)
34  partOpened += Delegate(l, &IPartListener::PartOpened);
35  if (t & HIDDEN)
36  partHidden += Delegate(l, &IPartListener::PartHidden);
37  if (t & VISIBLE)
38  partVisible += Delegate(l, &IPartListener::PartVisible);
39  if (t & INPUT_CHANGED)
40  partInputChanged += Delegate(l, &IPartListener::PartInputChanged);
41 }
42 
43 void
46 {
47  if (l == nullptr) return;
48 
49  partActivated -= Delegate(l, &IPartListener::PartActivated);
50  partBroughtToTop -= Delegate(l, &IPartListener::PartBroughtToTop);
51  partClosed -= Delegate(l, &IPartListener::PartClosed);
52  partDeactivated -= Delegate(l, &IPartListener::PartDeactivated);
53  partOpened -= Delegate(l, &IPartListener::PartOpened);
54  partHidden -= Delegate(l, &IPartListener::PartHidden);
55  partVisible -= Delegate(l, &IPartListener::PartVisible);
56  partInputChanged -= Delegate(l, &IPartListener::PartInputChanged);
57 }
58 
60 {
61 }
62 
63 }
virtual void PartHidden(const IWorkbenchPartReference::Pointer &)
virtual void PartOpened(const IWorkbenchPartReference::Pointer &)
virtual void PartDeactivated(const IWorkbenchPartReference::Pointer &)
void RemoveListener(IPartListener *listener)
virtual void PartActivated(const IWorkbenchPartReference::Pointer &)
virtual void PartInputChanged(const IWorkbenchPartReference::Pointer &)
void AddListener(IPartListener *listener)
virtual void PartClosed(const IWorkbenchPartReference::Pointer &)
virtual void PartVisible(const IWorkbenchPartReference::Pointer &)
virtual void PartBroughtToTop(const IWorkbenchPartReference::Pointer &)
virtual Events::Types GetPartEventTypes() const =0