00001
00002
00003 #ifndef _GCONFMM_ENTRY_H
00004 #define _GCONFMM_ENTRY_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 <gconfmm/value.h>
00032 #include <gconfmm/schema.h>
00033
00034
00035 extern "C" {
00036 typedef struct _GConfEntry GConfEntry;
00037 }
00038
00039 namespace Gnome
00040 {
00041
00042 namespace Conf
00043 {
00044
00050 class Entry
00051 {
00052 public:
00053 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00054 typedef Entry CppObjectType;
00055 typedef GConfEntry BaseObjectType;
00056 #endif
00057
00058 Entry();
00059
00060
00061 explicit Entry(GConfEntry* castitem, bool make_a_copy = false);
00062
00063 Entry(const Entry& src);
00064 Entry& operator=(const Entry& src);
00065
00066 ~Entry();
00067
00068 GConfEntry* gobj() { return gobject_; }
00069 const GConfEntry* gobj() const { return gobject_; }
00070
00072 GConfEntry* gobj_copy() const;
00073
00074 protected:
00075 GConfEntry* gobject_;
00076
00077 private:
00078
00079
00080 public:
00082 Entry(const Glib::ustring& key, const Value& value);
00083
00086 void set_value(const Value& val);
00087
00090 void set_schema_name(const Glib::ustring& val);
00091
00094 void set_is_default(bool is_default = true);
00095
00098 void set_is_writable(bool is_writable = true);
00099
00102 Value get_value() const;
00103
00104
00107 Glib::ustring get_schema_name() const;
00108
00109
00110
00111 Glib::ustring get_key() const;
00112
00113
00114
00115 bool get_is_default() const;
00116
00117
00118
00119 bool get_is_writable() const;
00120
00121 private:
00122 static GConfEntry* entry_copy(const GConfEntry*);
00123
00124
00125 };
00126
00127 }
00128 }
00129
00130
00131 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00132 namespace Glib
00133 {
00134 namespace Container_Helpers
00135 {
00136
00137 template<>
00138 struct TypeTraits<Gnome::Conf::Entry>
00139 {
00140 typedef Gnome::Conf::Entry CppType;
00141 typedef const GConfEntry* CType;
00142 typedef GConfEntry* CTypeNonConst;
00143
00144 static CType to_c_type (const CppType& item) { return item.gobj(); }
00145 static CType to_c_type (const CType& item) { return item; }
00146 static CppType to_cpp_type (const CType& item) { return Gnome::Conf::Entry(const_cast<CTypeNonConst>(item)); }
00147 static void release_c_type (const CType&) {}
00148 };
00149
00150 }
00151 }
00152 #endif // DOXYGEN_SHOULD_SKIP_THIS
00153
00154
00155 namespace Glib
00156 {
00157
00166 Gnome::Conf::Entry wrap(GConfEntry* object, bool take_copy = false);
00167
00168 }
00169
00170
00171 #endif
00172