## EClient Utilities EClient Utilities |

## Synopsis

    enum                EClientSourceType;
    EClient *           e_client_utils_new                  (ESource *source,
                                                             EClientSourceType source_type,
                                                             GError **error);
    void                e_client_utils_open_new             (ESource *source,
                                                             EClientSourceType source_type,
                                                             gboolean only_if_exists,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback async_cb,
                                                             gpointer async_cb_user_data);
    gboolean            e_client_utils_open_new_finish      (ESource *source,
                                                             GAsyncResult *result,
                                                             EClient **client,
                                                             GError **error);

## Description

## Details

### enum EClientSourceType

    typedef enum {
    	E_CLIENT_SOURCE_TYPE_CONTACTS,
    	E_CLIENT_SOURCE_TYPE_EVENTS,
    	E_CLIENT_SOURCE_TYPE_MEMOS,
    	E_CLIENT_SOURCE_TYPE_TASKS,
    	E_CLIENT_SOURCE_TYPE_LAST
    } EClientSourceType;

Since 3.2

### e_client_utils_new ()

    EClient *           e_client_utils_new                  (ESource *source,
                                                             EClientSourceType source_type,
                                                             GError **error);

Proxy function for `e_book_client_utils_new()` and `e_cal_client_utils_new()`.

Since 3.2

### e_client_utils_open_new ()

    void                e_client_utils_open_new             (ESource *source,
                                                             EClientSourceType source_type,
                                                             gboolean only_if_exists,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback async_cb,
                                                             gpointer async_cb_user_data);

Begins asynchronous opening of a new EClient corresponding to the `source` of type `source_type`. The resulting EClient is fully opened and authenticated client, ready to be used. The opened client has also fetched capabilities. This call is finished by `e_client_utils_open_new_finish()` from the `async_cb`.

`source` : | an ESource to be opened
`source_type` : | an EClientSourceType of the `source`
`only_if_exists` : | if `TRUE`, fail if this client doesn't already exist, otherwise create it first
`cancellable` : | a GCancellable; can be `NULL`
`async_cb` : | callback to call when a result is ready
`async_cb_user_data` : | user data for the `async_cb`

Since 3.2

### e_client_utils_open_new_finish ()

    gboolean            e_client_utils_open_new_finish      (ESource *source,
                                                             GAsyncResult *result,
                                                             EClient **client,
                                                             GError **error);

Finishes previous call of `e_client_utils_open_new()` and sets `client` to a fully opened and authenticated EClient. This `client`, if not NULL, should be freed with `g_object_unref()`.

`source` : | an ESource on which the `e_client_utils_open_new()` was invoked
`result` : | a GAsyncResult
`client` : | Return value for an EClient. [out]
`error` : | a GError to set an error, if any. [out]
Returns : | `TRUE` if successful, `FALSE` otherwise.

Since 3.2