Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryIWindowListener.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 "berryIWindowListener.h"
14 
15 namespace berry {
16 
17 void
20 {
21  if (listener == nullptr) return;
22 
23  windowActivated += Delegate(listener, &IWindowListener::WindowActivated);
24  windowDeactivated += Delegate(listener, &IWindowListener::WindowDeactivated);
25  windowClosed += Delegate(listener, &IWindowListener::WindowClosed);
26  windowOpened += Delegate(listener, &IWindowListener::WindowOpened);
27 }
28 
29 void
32 {
33  if (listener == nullptr) return;
34 
35  windowActivated -= Delegate(listener, &IWindowListener::WindowActivated);
36  windowDeactivated -= Delegate(listener, &IWindowListener::WindowDeactivated);
37  windowClosed -= Delegate(listener, &IWindowListener::WindowClosed);
38  windowOpened -= Delegate(listener, &IWindowListener::WindowOpened);
39 }
40 
42 {
43 }
44 
45 }
void RemoveListener(IWindowListener *listener)
virtual void WindowClosed(const IWorkbenchWindow::Pointer &)
virtual void WindowOpened(const IWorkbenchWindow::Pointer &)
virtual void WindowDeactivated(const IWorkbenchWindow::Pointer &)
void AddListener(IWindowListener *listener)
virtual void WindowActivated(const IWorkbenchWindow::Pointer &)