GoaClient

GoaClient — Object for accessing account information

Synopsis

                    GoaClient;
void                goa_client_new                      (GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
GoaClient *         goa_client_new_finish               (GAsyncResult *res,
                                                         GError **error);
GoaClient *         goa_client_new_sync                 (GCancellable *cancellable,
                                                         GError **error);
GoaManager *        goa_client_get_manager              (GoaClient *client);
GList *             goa_client_get_accounts             (GoaClient *client);
GDBusObjectManager * goa_client_get_object_manager      (GoaClient *client);

Object Hierarchy

  GObject
   +----GoaClient

Implemented Interfaces

GoaClient implements GInitable and GAsyncInitable.

Properties

  "object-manager"           GDBusObjectManager*   : Read

Signals

  "account-added"                                  : Run Last
  "account-changed"                                : Run Last
  "account-removed"                                : Run Last

Description

GoaClient is used for accessing the GNOME Online Accounts service from a client program.

Details

GoaClient

typedef struct _GoaClient GoaClient;

The GoaClient structure contains only private data and should only be accessed using the provided API.


goa_client_new ()

void                goa_client_new                      (GCancellable *cancellable,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Asynchronously gets a GoaClient. When the operation is finished, callback will be invoked in the thread-default main loop of the thread you are calling this method from.

cancellable :

A GCancellable or NULL.

callback :

Function that will be called when the result is ready.

user_data :

Data to pass to callback.

goa_client_new_finish ()

GoaClient *         goa_client_new_finish               (GAsyncResult *res,
                                                         GError **error);

Finishes an operation started with goa_client_new().

res :

A GAsyncResult.

error :

Return location for error or NULL.

Returns :

A GoaClient or NULL if error is set. Free with g_object_unref() when done with it.

goa_client_new_sync ()

GoaClient *         goa_client_new_sync                 (GCancellable *cancellable,
                                                         GError **error);

Synchronously gets a GoaClient for the local system.

cancellable :

A GCancellable or NULL. [allow-none]

error :

Return location for error or NULL. [allow-none]

Returns :

A GoaClient or NULL if error is set. Free with g_object_unref() when done with it.

goa_client_get_manager ()

GoaManager *        goa_client_get_manager              (GoaClient *client);

Gets the GoaManager for client.

client :

A GoaClient.

Returns :

A GoaManager. Do not free, the returned object belongs to client. [transfer none]

goa_client_get_accounts ()

GList *             goa_client_get_accounts             (GoaClient *client);

Gets all accounts that client knows about. The result is a list of GoaObject instances where each object at least has an GoaAccount interface (that can be obtained via the goa_object_get_account() method) but may also implement other interfaces such as GoaGoogleAccount.

client :

A GoaClient.

Returns :

A list of GoaObject instances that must be freed with g_list_free() after each element has been freed with g_object_unref(). [transfer full][element-type GoaObject]

goa_client_get_object_manager ()

GDBusObjectManager * goa_client_get_object_manager      (GoaClient *client);

Gets the GDBusObjectManager used by client.

client :

A GoaClient.

Returns :

A GDBusObjectManager. Do not free, the instance is owned by client. [transfer none]

Property Details

The "object-manager" property

  "object-manager"           GDBusObjectManager*   : Read

The GDBusObjectManager used by the GoaClient instance.

Signal Details

The "account-added" signal

void                user_function                      (GoaClient *client,
                                                        GoaObject *object,
                                                        gpointer   user_data)      : Run Last

Emitted when object has been added. See goa_client_get_accounts() for information about how to use this object.

client :

The GoaClient object emitting the signal.

object :

The GoaObject for the added account.

user_data :

user data set when the signal handler was connected.

The "account-changed" signal

void                user_function                      (GoaClient *client,
                                                        GoaObject *object,
                                                        gpointer   user_data)      : Run Last

Emitted when something on object changes.

client :

The GoaClient object emitting the signal.

object :

The GoaObject for the account with changes.

user_data :

user data set when the signal handler was connected.

The "account-removed" signal

void                user_function                      (GoaClient *client,
                                                        GoaObject *object,
                                                        gpointer   user_data)      : Run Last

Emitted when object has been removed.

client :

The GoaClient object emitting the signal.

object :

The GoaObject for the removed account.

user_data :

user data set when the signal handler was connected.