00001
00002
00003 #ifndef _GCONFMM_CHANGESET_H
00004 #define _GCONFMM_CHANGESET_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include <glibmm/ustring.h>
00032 #include <gconfmm/value.h>
00033 #include <gconfmm/setinterface.h>
00034 #include <sigc++/slot.h>
00035
00036
00037 extern "C" {
00038 typedef struct _GConfChangeSet GConfChangeSet;
00039 }
00040
00041 namespace Gnome
00042 {
00043 namespace Conf
00044 {
00045
00046
00057 class ChangeSet : public SetInterface
00058 {
00059 public:
00060 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00061 typedef ChangeSet CppObjectType;
00062 typedef GConfChangeSet BaseObjectType;
00063 #endif
00064
00065 private:
00066
00067
00068 public:
00069 ChangeSet();
00070 explicit ChangeSet(GConfChangeSet* castitem, bool make_a_copy = false);
00071
00072 ChangeSet(const ChangeSet& src);
00073 ChangeSet& operator=(const ChangeSet& src);
00074 virtual ~ChangeSet();
00075
00076 GConfChangeSet* gobj() { return gobject_; }
00077 const GConfChangeSet* gobj() const { return gobject_; }
00078 GConfChangeSet* gobj_copy() const;
00079
00080 protected:
00081 GConfChangeSet* gobject_;
00082
00083 public:
00087 void clear();
00088
00091 unsigned int size() const;
00092
00096 void remove(const Glib::ustring& key);
00097
00101 Value* exists(const Glib::ustring& key) const;
00102
00103
00107 void unset(const Glib::ustring& key);
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00121 virtual void set(const Glib::ustring& key, const Value& value);
00122 virtual void set(const Glib::ustring& key, bool what);
00123 virtual void set(const Glib::ustring& key, int what);
00124 virtual void set(const Glib::ustring& key, double what);
00125 virtual void set(const Glib::ustring& key, const Glib::ustring& what);
00126 virtual void set(const Glib::ustring& key, const Schema& what);
00127 #else
00128 virtual void set(const Glib::ustring& key, const Value& value, std::auto_ptr<Glib::Error>& error);
00129 virtual void set(const Glib::ustring& key, bool what, std::auto_ptr<Glib::Error>& error);
00130 virtual void set(const Glib::ustring& key, int what, std::auto_ptr<Glib::Error>& error);
00131 virtual void set(const Glib::ustring& key, double what, std::auto_ptr<Glib::Error>& error);
00132 virtual void set(const Glib::ustring& key, const Glib::ustring& what, std::auto_ptr<Glib::Error>& error);
00133 virtual void set(const Glib::ustring& key, const Schema& what, std::auto_ptr<Glib::Error>& error);
00134 #endif //GLIBMM_EXCEPTIONS_ENABLED
00135
00136
00137 typedef sigc::slot<void, const Glib::ustring&, const Value&> ForeachSlot;
00142 void for_each(const ForeachSlot& slot);
00143
00144 private:
00145 static GConfChangeSet* do_ref(GConfChangeSet*);
00146
00147
00148 };
00149
00150
00151 }
00152 }
00153
00154
00155 #endif
00156