Reference Manual

Inti Logo
Main Page | Namespace List | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::GConf::ChangeSet Class Reference

A GConfChangeSet C++ wrapper class. More...

#include <inti/gconf/chnageset.h>

List of all members.

Public Types

Public Member Functions

Constructors
Accessors
Methods

Detailed Description

A GConfChangeSet C++ wrapper class.

A ChangeSet allows you to collect a set of changes to configuration keys (set/unset operations). You can then commit all the changes at once. This is convenient for something like a preferences dialog; you can collect all the pending changes in a ChangeSet, then when the user clicks apply send them all to the configuration database. The ChangeSet allows you to avoid sending every preferences setting when "apply" is clicked; you only have to send the settings the user changed.


Member Typedef Documentation

typedef Slot2<void, String&, const Value*> Inti::GConf::ChangeSet::ForeachSlot
 

Signature for the foreach method called to iterate over each change in a ChangeSet.

Example: Method signature for ForeachSlot.

             void method(const String& key, const Value *value);
            
             // key: A key whose value has been changed.
             // value: The new value for <EM>key</EM>, or null if the value was unset.

You must not call GConf::Change::set_remove() during the iteration, because you'll confuse the internal data structures and cause memory corruption.


Member Function Documentation

bool Inti::GConf::ChangeSet::check_value const String &  key,
Value value = 0
 

Checks whether the change set contains the given key;.

Parameters:
key The key to check.
value A pointer to an empty Value object.
Returns:
true if the key is in the ChangeSet.

If you just want to check for a value, and don't care what it is, value can be null. To get the value pass a pointer to an empty Value object. This method copies the key's value into your value object.

Example: An example of check_value() in action.

             GConf::Value value;
             if (check_value("/foo", &value) && value.is_set())
             {
                // do something with the value
                ...
             }

void Inti::GConf::ChangeSet::remove const String &  key  ) 
 

Removes a change from a ChangeSet.

Parameters:
key The key to remove from the change set.

The key given as the key argument will not be modified if this change set is committed. If key is not in the change set, this function has no effect.

void Inti::GConf::ChangeSet::set const String &  key,
const Value value
 

Adds a "set" operation to a change set.

Parameters:
key The key to change.
value The value to change the key to.

This method is similar to gconf_engine_set(), except that no errors can occur (errors occur later, when you try to commit the change set).

void Inti::GConf::ChangeSet::set_bool const String &  key,
bool  value
 

Adds a "set" operation; takes a bool argument, so you can avoid creating a Value.

Parameters:
key The key to set.
value The new value of key.

void Inti::GConf::ChangeSet::set_float const String &  key,
double  value
 

Adds a "set" operation; takes a double argument, so you can avoid creating a Value.

Parameters:
key The key to set.
value The new value of key.

void Inti::GConf::ChangeSet::set_int const String &  key,
int  value
 

Adds a "set" operation; takes an int argument, so you can avoid creating a Value.

Parameters:
key The key to set.
value The new value of key.

void Inti::GConf::ChangeSet::set_list const String &  key,
const std::vector< Schema > &  list
 

Adds a "set" operation; takes a vector of Schema, so you can avoid creating a list Value.

Parameters:
key The key you want set.
list A reference to a vector of Schema that contains the list elements.

void Inti::GConf::ChangeSet::set_list const String &  key,
const std::vector< String > &  list
 

Adds a "set" operation; takes a vector of String, so you can avoid creating a list Value.

Parameters:
key The key you want set.
list A reference to a vector of String that contains the list elements.

void Inti::GConf::ChangeSet::set_list const String &  key,
const std::vector< double > &  list
 

Adds a "set" operation; takes a vector of double, so you can avoid creating a list Value.

Parameters:
key The key you want set.
list A reference to a vector of double that contains the list elements.

void Inti::GConf::ChangeSet::set_list const String &  key,
const std::vector< bool > &  list
 

Adds a "set" operation; takes a vector of bool, so you can avoid creating a list Value.

Parameters:
key The key you want set.
list A reference to a vector of bool that contains the list elements.

void Inti::GConf::ChangeSet::set_list const String &  key,
const std::vector< int > &  list
 

Adds a "set" operation; takes a vector of int, so you can avoid creating a list Value.

Parameters:
key The key you want set.
list A reference to a vector of int that contains the list elements.

void Inti::GConf::ChangeSet::set_schema const String &  key,
const Schema value
 

Adds a "set" operation; takes a Schema argument, so you can avoid creating a Value.

Parameters:
key The key to set.
value The new value of key.

void Inti::GConf::ChangeSet::set_string const String &  key,
const String &  value
 

Adds a "set" operation; takes a String argument, so you can avoid creating a Value.

Parameters:
key The key to set.
value The new value of key.

void Inti::GConf::ChangeSet::unset const String &  key  ) 
 

Adds an "unset" operation to a ChangeSet.

Parameters:
key The key to change.
This function schedules a gconf_engine_unset().


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 23:52:40 2003 for Inti-GConf by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002