Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIExecutionListenerWithChecks.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 "berryExecutionEvent.h"
21 #include "berryCommandCategory.h"
22 #include "berryState.h"
23 #include "berryIHandler.h"
24 
25 namespace berry {
26 
27 void
30 {
31  if (l == nullptr) return;
32 
34 
35  if (IExecutionListenerWithChecks* cl = dynamic_cast<IExecutionListenerWithChecks*>(l))
36  {
39  }
40 }
41 
42 void
45 {
46  if (l == nullptr) return;
47 
49 
50  if (IExecutionListenerWithChecks* cl = dynamic_cast<IExecutionListenerWithChecks*>(l))
51  {
54  }
55 }
56 
57 bool
60 {
61  return IExecutionListener::Events::HasListeners() || notDefined.HasListeners() ||
62  notEnabled.HasListeners();
63 }
64 
65 bool
67 ::IsEmpty() const
68 {
69  return !this->HasListeners();
70 }
71 
72 }
void RemoveListener(IExecutionListener *listener) override
virtual void RemoveListener(IExecutionListener *listener)
virtual void NotDefined(const QString &commandId, const NotDefinedException *exception)=0
virtual void NotEnabled(const QString &commandId, const NotEnabledException *exception)=0
virtual void AddListener(IExecutionListener *listener)
void AddListener(IExecutionListener *listener) override