Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryState.h
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 #ifndef BERRYSTATE_H_
18 #define BERRYSTATE_H_
19 
20 #include <berryMacros.h>
21 #include <berryObject.h>
23 
24 #include "berryIStateListener.h"
25 
26 namespace berry {
27 
46 class BERRY_COMMANDS State : public Object {
47 
48 public:
49 
51 
58  virtual void AddListener(IStateListener* listener);
59 
60  void AddListener(const IStateListener::Events::StateEvent::AbstractDelegate& delegate);
61 
67  QString GetId() const;
68 
77  virtual Object::Pointer GetValue() const;
78 
85  virtual void RemoveListener(IStateListener* listener);
86 
87  void RemoveListener(const IStateListener::Events::StateEvent::AbstractDelegate& delegate);
88 
96  virtual void SetId(const QString& id);
97 
104  virtual void SetValue(const Object::Pointer& value);
105 
106 
107 protected:
108 
115  void FireStateChanged(const Object::Pointer& oldValue);
116 
118 
119 private:
120 
125  QString id;
126 
130  Object::Pointer value;
131 
132 };
133 
134 }
135 
136 Q_DECLARE_INTERFACE(berry::State, "org.blueberry.core.commands.State")
137 
138 #endif /*BERRYSTATE_H_*/
IStateListener::Events stateEvents
Definition: berryState.h:117
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
#define berryObjectMacro(...)
Definition: berryMacros.h:37