00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _GCONFMM_ENTRY_H 00004 #define _GCONFMM_ENTRY_H 00005 00006 00007 #include <glibmm.h> 00008 00009 // -*- Mode: C++; c-basic-offset: 4 -*- 00010 /* $Id: entry.hg,v 1.4 2002/12/10 23:26:01 murrayc Exp $ */ 00011 00012 /* entry.hg 00013 * 00014 * Copyright (C) 2000-2002 GConfmm Development Team 00015 * 00016 * This library is free software; you can redistribute it and/or 00017 * modify it under the terms of the GNU Library General Public 00018 * License as published by the Free Software Foundation; either 00019 * version 2 of the License, or (at your option) any later version. 00020 * 00021 * This library is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 * Library General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU Library General Public 00027 * License along with this library; if not, write to the Free 00028 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 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 /* DOXYGEN_SHOULD_SKIP_THIS */ 00057 00058 Entry(); 00059 00060 // Use make_a_copy=true when getting it directly from a struct. 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 /* Retrieve the configuration key this entry points to */ 00110 00111 Glib::ustring get_key() const; 00112 00113 /* Retrieve wether this Entry contains the default value, as defined in the Schema. */ 00114 00115 bool get_is_default() const; 00116 00117 /* Get the writeable status of the configuration key of this entry. */ 00118 00119 bool get_is_writable() const; 00120 00121 private: 00122 static GConfEntry* entry_copy(const GConfEntry*); 00123 00124 00125 }; 00126 00127 } /* namespace Conf */ 00128 } /* namespace Gnome */ 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 } // Namespace Container_Helpers 00151 } // namespace Glib 00152 #endif // DOXYGEN_SHOULD_SKIP_THIS 00153 00154 00155 namespace Glib 00156 { 00157 00163 Gnome::Conf::Entry wrap(GConfEntry* object, bool take_copy = false); 00164 00165 } // namespace Glib 00166 00167 00168 #endif /* _GCONFMM_ENTRY_H */ 00169