Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkIPreferences.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 mitkIPreferences_h
14 #define mitkIPreferences_h
15 
16 #include <mitkMessage.h>
17 
18 #include <MitkCoreExports.h>
19 
20 #include <cstddef>
21 #include <string>
22 #include <vector>
23 
24 namespace mitk
25 {
51  {
52  public:
57  {
58  public:
59  ChangeEvent(IPreferences* source, const std::string& property, const std::string& oldValue, const std::string& newValue);
60 
61  IPreferences* GetSource() const;
62  std::string GetProperty() const;
63  std::string GetOldValue() const;
64  std::string GetNewValue() const;
65 
66  private:
67  IPreferences* m_Source;
68  std::string m_Property;
69  std::string m_OldValue;
70  std::string m_NewValue;
71  };
72 
73  virtual ~IPreferences();
74 
85  virtual std::string Get(const std::string& key, const std::string& def) const = 0;
86 
96  virtual void Put(const std::string& key, const std::string& value) = 0;
97 
105  virtual int GetInt(const std::string& key, int def) const = 0;
106 
112  virtual void PutInt(const std::string& key, int value) = 0;
113 
120  virtual bool GetBool(const std::string& key, bool def) const = 0;
121 
128  virtual void PutBool(const std::string& key, bool value) = 0;
129 
137  virtual float GetFloat(const std::string& key, float def) const = 0;
138 
144  virtual void PutFloat(const std::string& key, float value) = 0;
145 
153  virtual double GetDouble(const std::string& key, double def) const = 0;
154 
160  virtual void PutDouble(const std::string& key, double value) = 0;
161 
180  virtual std::vector<std::byte> GetByteArray(const std::string& key, const std::byte* def, size_t size) const = 0;
181 
199  virtual void PutByteArray(const std::string& key, const std::byte* array, size_t size) = 0;
200 
210  virtual void Flush() = 0;
211 
217  virtual void Remove(const std::string& key) = 0;
218 
222  virtual void Clear() = 0;
223 
227  virtual std::vector<std::string> Keys() const = 0;
228 
237  virtual std::string Name() const = 0;
238 
245  virtual std::string AbsolutePath() const = 0;
246 
250  virtual std::vector<std::string> ChildrenNames() const = 0;
251 
255  virtual IPreferences* Parent() = 0;
256 
260  virtual const IPreferences* Parent() const = 0;
261 
265  virtual IPreferences* Root() = 0;
266 
270  virtual const IPreferences* Root() const = 0;
271 
282  virtual IPreferences* Node(const std::string& path) = 0;
283 
290  virtual void RemoveNode() = 0;
291 
294  };
295 }
296 
297 #endif
mitk::Message1
Definition: mitkMessage.h:480
mitk::IPreferences::ChangeEvent
Event object sent on IPreferences::OnPropertyChanged events.
Definition: mitkIPreferences.h:56
mitk::IPreferences::OnPropertyChanged
Message1< const ChangeEvent & > OnPropertyChanged
Notify on property changes.
Definition: mitkIPreferences.h:293
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::IPreferences::OnChanged
Message1< const IPreferences * > OnChanged
Notify on node changes.
Definition: mitkIPreferences.h:292
MitkCoreExports.h
mitkMessage.h
mitk::IPreferences
Interface to application preferences.
Definition: mitkIPreferences.h:50
mitk::MitkMultilabelIOMimeTypes::Get
MITKMULTILABELIO_EXPORT std::vector< CustomMimeType * > Get()
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15