gconfmm: Gnome::Conf::ChangeSet Class Reference

A ChangeSet is a set of changes to the GConf database that can be commited and reversed easily. More...

Inheritance diagram for Gnome::Conf::ChangeSet:
Collaboration diagram for Gnome::Conf::ChangeSet:

List of all members.

Public Types

typedef sigc::slot< void,

const Glib::ustring &, const

Value& > 
ForeachSlot

Public Member Functions

 ChangeSet ()
 ChangeSet (GConfChangeSet* castitem, bool make_a_copy=false)
 ChangeSet (const ChangeSet& src)
ChangeSetoperator= (const ChangeSet& src)
virtual ~ChangeSet ()
GConfChangeSet* gobj ()
const GConfChangeSet* gobj () const
GConfChangeSet* gobj_copy () const
void clear ()
 Clear all entries.

unsigned int size () const
 Returns the number of keys in the changeset.

void remove (const Glib::ustring& key)
 Remove the specified key from the changeset.

Valueexists (const Glib::ustring& key) const
 Check whether the given key will be modified by a commit operation.

void unset (const Glib::ustring& key)
 Unset the given key.

virtual void set (const Glib::ustring& key, const Value&value)
virtual void set (const Glib::ustring& key, bool what)
virtual void set (const Glib::ustring& key, int what)
virtual void set (const Glib::ustring& key, double what)
virtual void set (const Glib::ustring& key, const Glib::ustring& what)
virtual void set (const Glib::ustring& key, const Schema& what)
void for_each (const ForeachSlot& slot)
 Iterate over the keys marked in this ChangeSet.

Protected Attributes

GConfChangeSet* gobject_

Detailed Description

A ChangeSet is a set of changes to the GConf database that can be commited and reversed easily.

The changes can be both set and unset operations. Currently the ChangeSet operations are not atomic, and not specially optimized for. However, it is suitable for use, for instance, preferences dialogs.

The set*() methods do not throw errors, they simply store the keys and the values.

See also:
Client::change_set_from_current(), Client::change_set_commit(), Client::change_set_reverse().

Member Typedef Documentation

typedef sigc::slot<void, const Glib::ustring&, const Value&> Gnome::Conf::ChangeSet::ForeachSlot

Constructor & Destructor Documentation

Gnome::Conf::ChangeSet::ChangeSet ( )
Gnome::Conf::ChangeSet::ChangeSet ( GConfChangeSet *  castitem,
bool  make_a_copy = false 
) [explicit]
Gnome::Conf::ChangeSet::ChangeSet ( const ChangeSet src)
virtual Gnome::Conf::ChangeSet::~ChangeSet ( ) [virtual]

Member Function Documentation

void Gnome::Conf::ChangeSet::clear ( )

Clear all entries.

After this method, commiting the changeset is a no-op.

Value* Gnome::Conf::ChangeSet::exists ( const Glib::ustring &  key) const

Check whether the given key will be modified by a commit operation.

Returns:
0 if the key will not be modified, else the modified value. Remember to delete the Value.
void Gnome::Conf::ChangeSet::for_each ( const ForeachSlot slot)

Iterate over the keys marked in this ChangeSet.

Calls slot for each key-value pair that is marked in the ChangeSet. Keys marked unset will have a Value with type VALUE_INVALID.

GConfChangeSet* Gnome::Conf::ChangeSet::gobj ( ) [inline]
const GConfChangeSet* Gnome::Conf::ChangeSet::gobj ( ) const [inline]
GConfChangeSet* Gnome::Conf::ChangeSet::gobj_copy ( ) const
ChangeSet& Gnome::Conf::ChangeSet::operator= ( const ChangeSet src)
void Gnome::Conf::ChangeSet::remove ( const Glib::ustring &  key)

Remove the specified key from the changeset.

This means that the given key will not be modified by a commit.

virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring &  key,
const Value value 
) [virtual]
virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring &  key,
bool  what 
) [virtual]
virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring &  key,
int  what 
) [virtual]
virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring &  key,
double  what 
) [virtual]
virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring &  key,
const Glib::ustring &  what 
) [virtual]
virtual void Gnome::Conf::ChangeSet::set ( const Glib::ustring &  key,
const Schema what 
) [virtual]
unsigned int Gnome::Conf::ChangeSet::size ( ) const

Returns the number of keys in the changeset.

void Gnome::Conf::ChangeSet::unset ( const Glib::ustring &  key)

Unset the given key.

Mark the key, so that it will be removed from the configuration database during a commit.


Member Data Documentation

GConfChangeSet* Gnome::Conf::ChangeSet::gobject_ [protected]

The documentation for this class was generated from the following file:
  • gconfmm/changeset.h