libdebugger: Add string setting type.

- Needed in order to properly implement a settings description for
  a remote interface.
This commit is contained in:
Rene Gollent
2016-12-05 18:17:48 -05:00
parent 9e4d0fd483
commit 25ec63dbf5
2 changed files with 63 additions and 3 deletions
@@ -1,6 +1,6 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Copyright 2011-2013, Rene Gollent, [email protected].
* Copyright 2011-2016, Rene Gollent, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef SETTING_H
@@ -20,7 +20,8 @@ enum setting_type {
SETTING_TYPE_OPTIONS,
SETTING_TYPE_BOUNDED,
SETTING_TYPE_RANGE,
SETTING_TYPE_RECT
SETTING_TYPE_RECT,
SETTING_TYPE_STRING
};
@@ -106,6 +107,16 @@ public:
};
class StringSetting : public virtual Setting {
public:
virtual setting_type Type() const;
virtual BVariant DefaultValue() const;
virtual const BString& DefaultStringValue() const = 0;
};
class AbstractSetting : public virtual Setting {
public:
AbstractSetting(const BString& id,
@@ -230,4 +241,17 @@ private:
};
class StringSettingImpl : public AbstractSetting, public StringSetting {
public:
StringSettingImpl(const BString& id,
const BString& name,
const BString& defaultValue);
virtual const BString& DefaultStringValue() const;
private:
BString fDefaultValue;
};
#endif // SETTING_H