Medical Imaging Interaction Toolkit  2018.4.99-1640525a
Medical Imaging Interaction Toolkit
berryState.h
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 #ifndef BERRYSTATE_H_
14 #define BERRYSTATE_H_
15 
16 #include <berryMacros.h>
17 #include <berryObject.h>
19 
20 #include "berryIStateListener.h"
21 
22 namespace berry {
23 
42 class BERRY_COMMANDS State : public Object {
43 
44 public:
45 
47 
54  virtual void AddListener(IStateListener* listener);
55 
56  void AddListener(const IStateListener::Events::StateEvent::AbstractDelegate& delegate);
57 
63  QString GetId() const;
64 
73  virtual Object::Pointer GetValue() const;
74 
81  virtual void RemoveListener(IStateListener* listener);
82 
83  void RemoveListener(const IStateListener::Events::StateEvent::AbstractDelegate& delegate);
84 
92  virtual void SetId(const QString& id);
93 
100  virtual void SetValue(const Object::Pointer& value);
101 
102 
103 protected:
104 
111  void FireStateChanged(const Object::Pointer& oldValue);
112 
114 
115 private:
116 
121  QString id;
122 
126  Object::Pointer value;
127 
128 };
129 
130 }
131 
132 Q_DECLARE_INTERFACE(berry::State, "org.blueberry.core.commands.State")
133 
134 #endif /*BERRYSTATE_H_*/
IStateListener::Events stateEvents
Definition: berryState.h:113
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
#define berryObjectMacro(...)
Definition: berryMacros.h:33