X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=gconf-wrapper.h;h=be949059e0cc5fbeee5b3c067fee2b6e5ff619b7;hb=30a96982c959f9c5d99cbb6e980a938608844dee;hp=ab52c5a484a82f645d4421bccc487ef8ff27bbb4;hpb=e1fe4eeb4079792c6be4d47694a7288ef79d423d;p=simple-launcher diff --git a/gconf-wrapper.h b/gconf-wrapper.h index ab52c5a..be94905 100644 --- a/gconf-wrapper.h +++ b/gconf-wrapper.h @@ -52,54 +52,59 @@ private: 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; }; -class GConfStringValue : public GConfOption { +class GConfStringOption : public GConfOption { public: - GConfStringValue(const GConfKey&, const std::string&, const std::string& = ""); + 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); private: mutable std::string myValue; - std::string myDefaultValue; + const std::string myDefaultValue; }; -class GConfBooleanValue : public GConfOption { +class GConfBooleanOption : public GConfOption { public: - GConfBooleanValue(const GConfKey&, const std::string&, bool = false); + GConfBooleanOption(const GConfKey&, const std::string&, bool); + + virtual GConfValueType kind() const { return GCONF_VALUE_BOOL; } bool value() const; bool setValue(bool newValue); private: mutable bool myValue; - bool myDefaultValue; + const bool myDefaultValue; }; -class GConfIntegerValue : public GConfOption { +class GConfIntegerOption : public GConfOption { public: - GConfIntegerValue(const GConfKey&, const std::string&, int = false); + GConfIntegerOption(const GConfKey&, const std::string&, int); + + virtual GConfValueType kind() const { return GCONF_VALUE_INT; } int value() const; int setValue(int newValue); private: mutable int myValue; - int myDefaultValue; + const int myDefaultValue; }; #endif