1
// -*- Mode: C++; c-basic-offset: 4 -*-
2
/* $Id: entry.hg,v 1.4 2002/12/10 23:26:01 murrayc Exp $ */
6
* Copyright (C) 2000-2002 GConfmm Development Team
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Library General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Library General Public License for more details.
18
* You should have received a copy of the GNU Library General Public
19
* License along with this library; if not, write to the Free
20
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
#include <gconfmm/value.h>
24
#include <gconfmm/schema.h>
29
typedef struct _GConfEntry GConfEntry;
38
/** An Entry stores an entry from a GConf "directory", including a
39
* key-value pair, the name of the Schema applicable to this entry,
40
* whether the value is a default value, and whether GConf can write
41
* a new value at this key. The key should be an absolute key, not a relative key.
45
_CLASS_OPAQUE_COPYABLE(Entry,GConfEntry,NONE,entry_copy,gconf_entry_free)
46
_IGNORE(gconf_entry_free, gconf_entry_new, gconf_entry_new_nocopy)
47
_IGNORE(gconf_entry_equal, gconf_entry_set_value_nocopy)
48
_IGNORE(gconf_entry_steal_value)
51
/** Construct an Entry with the given @p key and @p value */
52
Entry(const Glib::ustring& key, const Value& value);
54
/** Set the Value of the entry. */
55
_WRAP_METHOD(void set_value(const Value& val), gconf_entry_set_value)
57
/** Set the Schema name of the entry. */
58
_WRAP_METHOD(void set_schema_name(const Glib::ustring& val), gconf_entry_set_schema_name)
60
/** Set whether the value has orginated from the default given in the Schema */
61
_WRAP_METHOD(void set_is_default(bool is_default = true), gconf_entry_set_is_default)
63
/** Set whether the given configuration key iw writeable. */
64
_WRAP_METHOD(void set_is_writable(bool is_writable = true), gconf_entry_set_is_writable)
66
/** Retrieve the value of the entry.
67
* @return a copy the entry's value. */
68
Value get_value() const;
69
_IGNORE(gconf_entry_get_value)
71
/** Retrieve the Schema name associated with the given entry */
72
_WRAP_METHOD(Glib::ustring get_schema_name() const, gconf_entry_get_schema_name)
74
/* Retrieve the configuration key this entry points to */
75
_WRAP_METHOD(Glib::ustring get_key() const, gconf_entry_get_key)
77
/* Retrieve wether this Entry contains the default value, as defined in the Schema. */
78
_WRAP_METHOD(bool get_is_default() const, gconf_entry_get_is_default)
80
/* Get the writeable status of the configuration key of this entry. */
81
_WRAP_METHOD(bool get_is_writable() const, gconf_entry_get_is_writable)
84
static GConfEntry* entry_copy(const GConfEntry*);
87
} /* namespace Conf */
88
} /* namespace Gnome */
91
#ifndef DOXYGEN_SHOULD_SKIP_THIS
94
namespace Container_Helpers
98
struct TypeTraits<Gnome::Conf::Entry>
100
typedef Gnome::Conf::Entry CppType;
101
typedef const GConfEntry* CType;
102
typedef GConfEntry* CTypeNonConst;
104
static CType to_c_type (const CppType& item) { return item.gobj(); }
105
static CType to_c_type (const CType& item) { return item; }
106
static CppType to_cpp_type (const CType& item) { return Gnome::Conf::Entry(const_cast<CTypeNonConst>(item)); }
107
static void release_c_type (const CType&) {}
110
} // Namespace Container_Helpers
112
#endif // DOXYGEN_SHOULD_SKIP_THIS