00001 // -*- c++ -*- 00002 // Generated by gtkmmproc -- DO NOT MODIFY! 00003 #ifndef _GCONFMM_ENTRY_H 00004 #define _GCONFMM_ENTRY_H 00005 00006 #include <glibmm.h> 00007 00008 // -*- Mode: C++; c-basic-offset: 4 -*- 00009 /* $Id: entry.hg,v 1.4 2002/12/10 23:26:01 murrayc Exp $ */ 00010 00011 /* entry.hg 00012 * 00013 * Copyright (C) 2000-2002 GConfmm Development Team 00014 * 00015 * This library is free software; you can redistribute it and/or 00016 * modify it under the terms of the GNU Library General Public 00017 * License as published by the Free Software Foundation; either 00018 * version 2 of the License, or (at your option) any later version. 00019 * 00020 * This library is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00023 * Library General Public License for more details. 00024 * 00025 * You should have received a copy of the GNU Library General Public 00026 * License along with this library; if not, write to the Free 00027 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00028 */ 00029 00030 #include <gconfmm/value.h> 00031 #include <gconfmm/schema.h> 00032 00033 00034 extern "C" { 00035 typedef struct _GConfEntry GConfEntry; 00036 } 00037 00038 namespace Gnome 00039 { 00040 00041 namespace Conf 00042 { 00043 00049 class Entry 00050 { 00051 public: 00052 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00053 typedef Entry CppObjectType; 00054 typedef GConfEntry BaseObjectType; 00055 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 00056 00057 Entry(); 00058 00059 // Use make_a_copy=true when getting it directly from a struct. 00060 explicit Entry(GConfEntry* castitem, bool make_a_copy = false); 00061 00062 Entry(const Entry& src); 00063 Entry& operator=(const Entry& src); 00064 00065 ~Entry(); 00066 00067 GConfEntry* gobj() { return gobject_; } 00068 const GConfEntry* gobj() const { return gobject_; } 00069 00070 // The caller is responsible for freeing it. Use when directly setting fields in structs. 00071 GConfEntry* gobj_copy() const; 00072 00073 protected: 00074 GConfEntry* gobject_; 00075 00076 private: 00077 00078 00079 public: 00081 Entry(const Glib::ustring& key, const Value& value); 00082 00085 void set_value(const Value& val); 00086 00089 void set_schema_name(const Glib::ustring& val); 00090 00093 void set_is_default(bool is_default = true); 00094 00097 void set_is_writable(bool is_writable = true); 00098 00101 Value get_value() const; 00102 00103 00106 Glib::ustring get_schema_name() const; 00107 00108 /* Retrieve the configuration key this entry points to */ 00109 00110 Glib::ustring get_key() const; 00111 00112 /* Retrieve wether this Entry contains the default value, as defined in the Schema. */ 00113 00114 bool get_is_default() const; 00115 00116 /* Get the writeable status of the configuration key of this entry. */ 00117 00118 bool get_is_writable() const; 00119 00120 private: 00121 static GConfEntry* entry_copy(const GConfEntry*); 00122 00123 00124 }; 00125 00126 } /* namespace Conf */ 00127 } /* namespace Gnome */ 00128 00129 00130 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00131 namespace Glib 00132 { 00133 namespace Container_Helpers 00134 { 00135 00136 template<> 00137 struct TypeTraits<Gnome::Conf::Entry> 00138 { 00139 typedef Gnome::Conf::Entry CppType; 00140 typedef const GConfEntry* CType; 00141 typedef GConfEntry* CTypeNonConst; 00142 00143 static CType to_c_type (const CppType& item) { return item.gobj(); } 00144 static CType to_c_type (const CType& item) { return item; } 00145 static CppType to_cpp_type (const CType& item) { return Gnome::Conf::Entry(const_cast<CTypeNonConst>(item)); } 00146 static void release_c_type (const CType&) {} 00147 }; 00148 00149 } // Namespace Container_Helpers 00150 } // namespace Glib 00151 #endif // DOXYGEN_SHOULD_SKIP_THIS 00152 00153 00154 namespace Glib 00155 { 00156 00158 Gnome::Conf::Entry wrap(GConfEntry* object, bool take_copy = false); 00159 00160 } // namespace Glib 00161 00162 #endif /* _GCONFMM_ENTRY_H */ 00163