Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

global_settings.h File Reference


Detailed Description

File public header for the ALP Global Settings service APIs.

#include <glib.h>
#include <hiker/config.h>
#include <hiker/sysclass.h>
#include <hiker/types.h>
#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  _AlpGlobalSettingsValue
struct  _AlpGlobalSettingsEntry

Defines

#define ALP_GLOBAL_SETTINGS_H_   1
#define ALP_GLOBAL_SETTINGS_RPC
#define ALP_GLOBAL_SETTINGS_VERSION   1
#define GLOBAL_SETTINGS_APP_ID   "com.access.sys.global_settings"
#define GLOBAL_SETTINGS_CHANNEL_NAME   "global settings"
#define GLOBAL_SETTINGS_TIMEOUT   500000
#define ALP_NOTIFY_EVENT_GLOBAL_SETTINGS_KEY_CHANGE   "/alp/globalsettings/keychange"
#define ALP_STATUS_GLOBAL_SETTINGS_ERROR   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00010000)
#define ALP_STATUS_GLOBAL_SETTINGS_KEY_NOT_FOUND   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00020000)
#define ALP_STATUS_GLOBAL_SETTINGS_VALUE_NOT_FOUND   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00030000)
#define ALP_STATUS_GLOBAL_SETTINGS_ENTRY_ITERATOR_AT_END   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00040000)
#define ALP_STATUS_GLOBAL_SETTINGS_ENTRY_ITERATOR_INVALID   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00050000)
#define ALP_STATUS_GLOBAL_SETTINGS_VALUE_NOT_DIR   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00060000)
#define ALP_STATUS_GLOBAL_SETTINGS_INCORRECT_TYPE   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00070000)
#define ALP_STATUS_GLOBAL_SETTINGS_ENTRY_INVALID   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00080000)
#define ALP_STATUS_GLOBAL_SETTINGS_VALUE_INVALID   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x00090000)
#define ALP_STATUS_GLOBAL_SETTINGS_ARGUMENT_INVALID   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x000a0000)
#define ALP_STATUS_GLOBAL_SETTINGS_BUFFER_TOO_SMALL   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x000b0000)
#define ALP_STATUS_GLOBAL_SETTINGS_PERMISSION_DENIED   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x000c0000)
#define ALP_STATUS_GLOBAL_SETTINGS_KEY_EXISTS   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x000d0000)
#define ALP_STATUS_GLOBAL_SETTINGS_VERSION_MISMATCH   ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x000e0000)
#define GLOBAL_SETTINGS_VALUE_INITIALIZER   { ALP_GLOBAL_SETTINGS_TYPE_INVALID, 0, 0, 0, 0, 0, { 0, 0 } }

Typedefs

typedef _AlpGlobalSettingsContext AlpGlobalSettingsContext
 Opaque type for representing a preference service instance.
typedef _AlpGlobalSettingsValue AlpGlobalSettingsValue
 type for representing a preference value; must be initialized to 0 before use
typedef _AlpGlobalSettingsEntry AlpGlobalSettingsEntry
 a simple key-value preference entry; must be initialized to 0 before use
typedef _AlpGlobalSettingsEntryIterator AlpGlobalSettingsEntryIterator
 the iterator for traversing a dir tree key value

Enumerations

enum  AlpGlobalSettingsValueType {
  ALP_GLOBAL_SETTINGS_TYPE_INVALID = 0, ALP_GLOBAL_SETTINGS_TYPE_STRING, ALP_GLOBAL_SETTINGS_TYPE_INT, ALP_GLOBAL_SETTINGS_TYPE_FLOAT,
  ALP_GLOBAL_SETTINGS_TYPE_BOOL, ALP_GLOBAL_SETTINGS_TYPE_LIST, ALP_GLOBAL_SETTINGS_TYPE_DIR, ALP_GLOBAL_SETTINGS_TYPE_BLOB
}
 enums for types of preference values More...

Functions

AlpGlobalSettingsEntryalp_global_settings_entry_alloc (void)
 allocate a new entry struct
void alp_global_settings_entry_free (AlpGlobalSettingsEntry *e)
 decllocates a previously allocated entry object
AlpGlobalSettingsValuealp_global_settings_value_alloc (void)
 allocate a new value struct
void alp_global_settings_value_free (AlpGlobalSettingsValue *e)
 decllocates a previously allocated value object
void alp_global_settings_value_clean (AlpGlobalSettingsValue *e)
 decllocates resources used by a value object but not the value object itself
void alp_global_settings_value_list_free (GList *l)
 decllocates a list of value obbjects; the list is used to represent a list value
alp_status_t alp_global_settings_init (void)
 initialize the Global Settings system
alp_status_t alp_global_settings_open (AlpGlobalSettingsContext **context)
 obtain the preference service
alp_status_t alp_global_settings_close (AlpGlobalSettingsContext *context)
 frees the reference to the preference service
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_begin_transaction (AlpGlobalSettingsContext *context)
 begins a transaction in which all changes will occur in one shot automatically
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_complete_transaction (AlpGlobalSettingsContext *context)
 commits a transaction which has accumulated a serious of previous write commands
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_cancel_transaction (AlpGlobalSettingsContext *context)
 cancels a transaction which has accumulated a serious of previous write commands
alp_status_t alp_global_settings_set_cwd (AlpGlobalSettingsContext *context, const char *cwd)
 set the current "directory" in the key space then following key paths which are not absolute will be treated as relative to the "directory"
alp_status_t alp_global_settings_get_cwd (AlpGlobalSettingsContext *context, char *buf, size_t buf_size)
 get the current "directory" in the key space then following key paths which are not absolute are treated as relative to the "directory"
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_set_default_mode (AlpGlobalSettingsContext *context, mode_t mode)
 set the permission used when creating new keys
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_get_default_mode (AlpGlobalSettingsContext *context, mode_t *mode)
 get the permission used when creating new keys
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_set_mode (AlpGlobalSettingsContext *context, const char *key, mode_t mode)
 set the permission on an existing key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_get_mode (AlpGlobalSettingsContext *context, const char *key, mode_t *mode)
 get the permission on an existing key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_set_uid (AlpGlobalSettingsContext *context, const char *key, uid_t id)
 set the user id on an existing key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_get_uid (AlpGlobalSettingsContext *context, const char *key, uid_t *id)
 get the current user id of a key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_set_gid (AlpGlobalSettingsContext *context, const char *key, gid_t id)
 set the group id of an existing key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_get_gid (AlpGlobalSettingsContext *context, const char *key, gid_t *id)
 get the group id of an existing key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_set (AlpGlobalSettingsContext *context, const char *key, const AlpGlobalSettingsValue *value)
 set the value of a key; a new key is created if the key does not exist and the old value is overwritten if the key already exists
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_get (AlpGlobalSettingsContext *context, const char *key, AlpGlobalSettingsValue *value)
 get the current value of a key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_delete (AlpGlobalSettingsContext *context, const char *key)
 deletes the current key setting, and reverts the key value to default if there is one
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_delete_tree (AlpGlobalSettingsContext *context, const char *key)
 deletes the all keys (subtree) below a given key as well as that key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_delete_tree_keeping_defaults (AlpGlobalSettingsContext *context, const char *key)
 deletes the all keys (subtree) below a given key as well as that key, except keeping default keys intact
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_get_type (AlpGlobalSettingsContext *context, const char *key, AlpGlobalSettingsValueType *type)
 get the type of the value of a key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_get_value_size (AlpGlobalSettingsContext *context, const char *key, size_t *size)
 get the type of the value of a key
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_set_notification_on_off (AlpGlobalSettingsContext *context, int on_off)
 set the key change notification to be on or off
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_findkeys_start (AlpGlobalSettingsContext *context, const char *dir_path, AlpGlobalSettingsEntryIterator **iterator)
 begin the traversal of the value of a key which is a list of subkeys
alp_status_t alp_global_settings_findkeys_next (AlpGlobalSettingsEntryIterator *iterator)
 advances the iterator to the next key in the list
alp_status_t alp_global_settings_findkeys_end (AlpGlobalSettingsEntryIterator *iterator)
 completes the traversal represented by the iterator; the associated resources are freed
alp_status_t alp_global_settings_findkeys_get_key (AlpGlobalSettingsEntryIterator *iterator, char *key, unsigned int key_size)
 returns the key of the key pointed by an iterator separately
alp_status_t alp_global_settings_entry_get_key_value (const AlpGlobalSettingsEntry *entry, char *key, unsigned int key_size, AlpGlobalSettingsValue *value)
 returns the key and the value of the key of an value entry
alp_status_t alp_global_settings_entry_set_key_value (AlpGlobalSettingsEntry *entry, const char *key, const AlpGlobalSettingsValue *value)
 sets the key and the value of the key of an value entry; old resources are freed, if exist
alp_status_t alp_global_settings_value_set_string (AlpGlobalSettingsValue *value, const char *string)
 set a string preference value; the old value, if any, is freed
alp_status_t alp_global_settings_value_set_int (AlpGlobalSettingsValue *value, int i)
 create an integer preference value; the old value, if any, is freed
alp_status_t alp_global_settings_value_set_float (AlpGlobalSettingsValue *value, double f)
 create a float preference value; the old value, if any, is freed
alp_status_t alp_global_settings_value_set_bool (AlpGlobalSettingsValue *value, gboolean b)
 create a bool preference value; the old value, if any, is freed
alp_status_t alp_global_settings_value_set_list (AlpGlobalSettingsValue *value, const GList *list)
 set a list (dir) preference value; the old value, if any, is freed
alp_status_t alp_global_settings_value_get_string (AlpGlobalSettingsValue *value, char *string, unsigned int string_size)
 get the string preference value contained in an value object
alp_status_t alp_global_settings_value_get_int (AlpGlobalSettingsValue *value, int *i)
 get the integer preference value contained in an value object
alp_status_t alp_global_settings_value_get_float (AlpGlobalSettingsValue *value, double *f)
 get the float preference value contained in an value object
alp_status_t alp_global_settings_value_get_bool (AlpGlobalSettingsValue *value, gboolean *b)
 get the boolean preference value contained in an value object
alp_status_t alp_global_settings_value_get_list (AlpGlobalSettingsValue *value, GList **list)
 get the dir (list) preference value contained in an value object
alp_status_t alp_global_settings_get_key_string_value (AlpGlobalSettingsContext *context, const char *key, char *value, unsigned int value_size)
 get a string key-value pair
alp_status_t alp_global_settings_set_key_string_value (AlpGlobalSettingsContext *context, const char *key, const char *value)
 set a string key-value pair
alp_status_t alp_global_settings_get_key_bool_value (AlpGlobalSettingsContext *context, const char *key, gboolean *value)
 get a boolean key-value pair
alp_status_t alp_global_settings_set_key_bool_value (AlpGlobalSettingsContext *context, const char *key, gboolean value)
 set a boolean key-value pair
alp_status_t alp_global_settings_get_key_int_value (AlpGlobalSettingsContext *context, const char *key, int *value)
 get an integer key-value pair
alp_status_t alp_global_settings_set_key_int_value (AlpGlobalSettingsContext *context, const char *key, int value)
 set an integer key-value pair
alp_status_t alp_global_settings_get_key_float_value (AlpGlobalSettingsContext *context, const char *key, double *value)
 get a float key-value pair
alp_status_t alp_global_settings_set_key_float_value (AlpGlobalSettingsContext *context, const char *key, double value)
 set a float
alp_status_t alp_global_settings_get_key_blob_value (AlpGlobalSettingsContext *context, const char *key, char *value, int buffer_size, int *value_size)
 get a Blob key-value pair
alp_status_t alp_global_settings_set_key_blob_value (AlpGlobalSettingsContext *context, const char *key, const char *value, int value_size)
 set a float
alp_status_t alp_global_settings_set_key_directory (AlpGlobalSettingsContext *context, const char *key)
 create a directory: this call fails if a key with the same name already exists
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_import_from_file (AlpGlobalSettingsContext *context, const char *file)
 to install a set of preferences from an XML file en masse
ALP_GLOBAL_SETTINGS_RPC alp_status_t alp_global_settings_list_keys (AlpGlobalSettingsContext *context, const gchar *pattern, AlpGlobalSettingsEntryIterator **iterator)
 get back a list of keys according to a glob pattern


Define Documentation

#define ALP_GLOBAL_SETTINGS_H_   1
 


Generated on Sat Dec 16 20:29:48 2006 for hiker-0.9 by  doxygen 1.4.4