}
GConfStringOption::GConfStringOption(const GConfKey& key, const std::string& name, const std::string& defaultValue):
- GConfOption(GCONF_VALUE_STRING, key, name),
+ GConfOption(key, name),
myDefaultValue(defaultValue) {
}
}
GConfBooleanOption::GConfBooleanOption(const GConfKey& key, const std::string& name, bool defaultValue):
- GConfOption(GCONF_VALUE_BOOL, key, name),
+ GConfOption(key, name),
myDefaultValue(defaultValue) {
}
}
GConfIntegerOption::GConfIntegerOption(const GConfKey& key, const std::string& name, int defaultValue):
- GConfOption(GCONF_VALUE_INT, key, name),
+ GConfOption(key, name),
myDefaultValue(defaultValue) {
}
class GConfOption : public GConfItem {
protected:
- GConfOption(GConfValueType kind, const GConfKey& key, const std::string& path): myKind(kind), myIsSynchronized(false), myPath(key.merge(path)) { }
+ GConfOption(const GConfKey& key, const std::string& path): myIsSynchronized(false), myPath(key.merge(path)) { }
- GConfValueType kind() const { return myKind; }
+ virtual GConfValueType kind() const = 0;
void setGConfValue(const GConfValue *);
GConfValue *getGConfValue() const;
void unsetGConfValue();
protected:
- const GConfValueType myKind;
mutable bool myIsSynchronized;
const std::string myPath;
};
public:
GConfStringOption(const GConfKey&, const std::string&, const std::string&);
+ virtual GConfValueType kind() const { return GCONF_VALUE_STRING; }
+
const std::string& value() const;
const std::string& setValue(const std::string& newValue);
public:
GConfBooleanOption(const GConfKey&, const std::string&, bool);
+ virtual GConfValueType kind() const { return GCONF_VALUE_BOOL; }
+
bool value() const;
bool setValue(bool newValue);
public:
GConfIntegerOption(const GConfKey&, const std::string&, int);
+ virtual GConfValueType kind() const { return GCONF_VALUE_INT; }
+
int value() const;
int setValue(int newValue);