Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIPartListener.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 
17 #include "berryIPartListener.h"
18 
19 namespace berry {
20 
21 void
24 {
25  if (l == nullptr) return;
26 
27  Types t = l->GetPartEventTypes();
28 
29  if (t & ACTIVATED)
30  partActivated += Delegate(l, &IPartListener::PartActivated);
31  if (t & BROUGHT_TO_TOP)
32  partBroughtToTop += Delegate(l, &IPartListener::PartBroughtToTop);
33  if (t & CLOSED)
34  partClosed += Delegate(l, &IPartListener::PartClosed);
35  if (t & DEACTIVATED)
36  partDeactivated += Delegate(l, &IPartListener::PartDeactivated);
37  if (t & OPENED)
38  partOpened += Delegate(l, &IPartListener::PartOpened);
39  if (t & HIDDEN)
40  partHidden += Delegate(l, &IPartListener::PartHidden);
41  if (t & VISIBLE)
42  partVisible += Delegate(l, &IPartListener::PartVisible);
43  if (t & INPUT_CHANGED)
44  partInputChanged += Delegate(l, &IPartListener::PartInputChanged);
45 }
46 
47 void
50 {
51  if (l == nullptr) return;
52 
53  partActivated -= Delegate(l, &IPartListener::PartActivated);
54  partBroughtToTop -= Delegate(l, &IPartListener::PartBroughtToTop);
55  partClosed -= Delegate(l, &IPartListener::PartClosed);
56  partDeactivated -= Delegate(l, &IPartListener::PartDeactivated);
57  partOpened -= Delegate(l, &IPartListener::PartOpened);
58  partHidden -= Delegate(l, &IPartListener::PartHidden);
59  partVisible -= Delegate(l, &IPartListener::PartVisible);
60  partInputChanged -= Delegate(l, &IPartListener::PartInputChanged);
61 }
62 
64 {
65 }
66 
67 }
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