Initialization

Initialization — Library initialization functions.

Synopsis

gboolean            (*OssoABookBackendDiedFunc)         (EBook *book,
                                                         gpointer user_data);
gboolean            osso_abook_init                     (int *argc,
                                                         char ***argv,
                                                         osso_context_t *osso_context);
gboolean            osso_abook_init_with_args           (int *argc,
                                                         char ***argv,
                                                         osso_context_t *osso_context,
                                                         char *parameter_string,
                                                         GOptionEntry *entries,
                                                         char *translation_domain,
                                                         GError **error);
gboolean            osso_abook_init_with_name           (const char *name,
                                                         osso_context_t *osso_context);
osso_context_t*     osso_abook_get_osso_context         (void);
void                osso_abook_make_resident            (void);
void                osso_abook_set_backend_died_func    (OssoABookBackendDiedFunc func,
                                                         gpointer user_data);

Description

This module provides some entry hooks for the libosso-abook library.

Details

OssoABookBackendDiedFunc ()

gboolean            (*OssoABookBackendDiedFunc)         (EBook *book,
                                                         gpointer user_data);

Specifies the type of functions passed to osso_abook_set_backend_died_func().

book : the EBook for which the backend died
user_data : user data passed to osso_abook_set_backend_died_func()

osso_abook_init ()

gboolean            osso_abook_init                     (int *argc,
                                                         char ***argv,
                                                         osso_context_t *osso_context);

Initializes the OssoABook API.

argc : Address of the argc parameter of your main() function. Changed if any arguments were handled.
argv : Address of the argv parameter of main(). Any parameters understood by gtk_init() are stripped before return.
osso_context : The osso_context_t of this application.
Returns : TRUE on success, FALSE otherwise.

osso_abook_init_with_args ()

gboolean            osso_abook_init_with_args           (int *argc,
                                                         char ***argv,
                                                         osso_context_t *osso_context,
                                                         char *parameter_string,
                                                         GOptionEntry *entries,
                                                         char *translation_domain,
                                                         GError **error);

Initializes the OssoABook API.

argc : Address of the argc parameter of your main() function. Changed if any arguments were handled.
argv : Address of the argv parameter of main(). Any parameters understood by gtk_init() are stripped before return.
osso_context : The osso_context_t of this application.
parameter_string : a string which is displayed in the first line of --help output, after programname [OPTION...]
entries : a NULL-terminated array of GOptionEntrys describing the options of your program
translation_domain : a translation domain to use for translating the --help output for the options in entries with gettext(), or NULL
error : a return location for errors
Returns : TRUE on success, FALSE otherwise.

osso_abook_init_with_name ()

gboolean            osso_abook_init_with_name           (const char *name,
                                                         osso_context_t *osso_context);

Initializes the OssoABook API. This form is to be used by plugins or any other situation where argc and argv are either incorrect or unavailable.

name : The name of this application.
osso_context : The osso_context_t of this application.
Returns : TRUE on success, FALSE otherwise.

osso_abook_get_osso_context ()

osso_context_t*     osso_abook_get_osso_context         (void);

Obtains the osso_context_t for this instance.

Returns : An osso_context_t

osso_abook_make_resident ()

void                osso_abook_make_resident            (void);

This function is a workaround for problems with libosso-abook getting loaded twice into the same process, such as when the control panel loads a plugin which uses libosso-abook after it has already been loaded and unloaded. In order to prevent g_type_register_static being called twice, this function can be called to make libosso-abook be resident in memory for the lifetime of the process.


osso_abook_set_backend_died_func ()

void                osso_abook_set_backend_died_func    (OssoABookBackendDiedFunc func,
                                                         gpointer user_data);

Installs a function to handle crashes of the addressbook backend. Default action when no function is installed or func returns FALSE is to shutdown the application.

func : the function to call when an EBook's backend died
user_data : user data to pass to the function