13 #ifndef mitkIPreferences_h
14 #define mitkIPreferences_h
68 std::string m_Property;
69 std::string m_OldValue;
70 std::string m_NewValue;
85 virtual std::string
Get(
const std::string& key,
const std::string& def)
const = 0;
96 virtual void Put(
const std::string& key,
const std::string& value) = 0;
105 virtual int GetInt(
const std::string& key,
int def)
const = 0;
112 virtual void PutInt(
const std::string& key,
int value) = 0;
120 virtual bool GetBool(
const std::string& key,
bool def)
const = 0;
128 virtual void PutBool(
const std::string& key,
bool value) = 0;
137 virtual float GetFloat(
const std::string& key,
float def)
const = 0;
144 virtual void PutFloat(
const std::string& key,
float value) = 0;
153 virtual double GetDouble(
const std::string& key,
double def)
const = 0;
160 virtual void PutDouble(
const std::string& key,
double value) = 0;
180 virtual std::vector<std::byte>
GetByteArray(
const std::string& key,
const std::byte* def,
size_t size)
const = 0;
199 virtual void PutByteArray(
const std::string& key,
const std::byte* array,
size_t size) = 0;
217 virtual void Remove(
const std::string& key) = 0;
227 virtual std::vector<std::string>
Keys()
const = 0;
237 virtual std::string
Name()
const = 0;
Event object sent on IPreferences::OnPropertyChanged events.
std::string GetProperty() const
std::string GetOldValue() const
IPreferences * GetSource() const
std::string GetNewValue() const
ChangeEvent(IPreferences *source, const std::string &property, const std::string &oldValue, const std::string &newValue)
Interface to application preferences.
virtual std::vector< std::byte > GetByteArray(const std::string &key, const std::byte *def, size_t size) const =0
Get a property value as typeless binary representation.
virtual std::vector< std::string > ChildrenNames() const =0
Get the names of all direct child preference nodes.
virtual std::string AbsolutePath() const =0
Get the absolute path (relative to the root node) of this preferences node.
virtual std::vector< std::string > Keys() const =0
Get the names of all properties of this preferences node.
virtual void PutFloat(const std::string &key, float value)=0
Set a float property value.
virtual void Remove(const std::string &key)=0
Remove a property from this preferences node.
virtual double GetDouble(const std::string &key, double def) const =0
Get a property value as double.
virtual void PutDouble(const std::string &key, double value)=0
Set a double property value.
virtual void Put(const std::string &key, const std::string &value)=0
Set a property value.
Message1< const IPreferences * > OnChanged
Notify on node changes.
virtual void PutInt(const std::string &key, int value)=0
Set an int property value.
virtual int GetInt(const std::string &key, int def) const =0
Get a property value as int.
virtual std::string Get(const std::string &key, const std::string &def) const =0
Get a property value as string.
virtual float GetFloat(const std::string &key, float def) const =0
Get a property value as float.
virtual IPreferences * Root()=0
Get the root preferences node.
virtual void PutBool(const std::string &key, bool value)=0
Set a bool property value.
virtual void Flush()=0
Write all (!) preferences to disk.
virtual void PutByteArray(const std::string &key, const std::byte *array, size_t size)=0
Put binary data into a property value.
virtual const IPreferences * Root() const =0
virtual IPreferences * Parent()=0
Get the parent preferences node or nullptr in case of the root node.
virtual void Clear()=0
Remove all properties from this preferences node.
virtual bool GetBool(const std::string &key, bool def) const =0
Get a property value as bool.
virtual IPreferences * Node(const std::string &path)=0
Get (and possibly create) the preferences node specified by the given path.
virtual const IPreferences * Parent() const =0
Message1< const ChangeEvent & > OnPropertyChanged
Notify on property changes.
virtual void RemoveNode()=0
Remove this preferences node from its parent node.
virtual std::string Name() const =0
Get the name of this preferences node.
Find image slices visible on a given plane.