Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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_*/
berry::State::stateEvents
IStateListener::Events stateEvents
Definition: berryState.h:113
org_blueberry_core_commands_Export.h
berryMacros.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berryIStateListener.h
BERRY_COMMANDS
#define BERRY_COMMANDS
Definition: org_blueberry_core_commands_Export.h:26
berry::Object
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
berry::MessageAbstractDelegate2
Definition: berryMessage.h:82
berryObjectMacro
#define berryObjectMacro(...)
Definition: berryMacros.h:31
berry::IStateListener
Definition: berryIStateListener.h:36
berryObject.h
berry::IStateListener::Events
Definition: berryIStateListener.h:39
berry
Definition: QmitkPropertyItemModel.h:24
berry::State
Definition: berryState.h:42