cd-client

## cd-client cd-client — Main client object for accessing the colord daemon |

## Synopsis

    #define             CD_CLIENT_ERROR
    #define             CD_CLIENT_TYPE_ERROR
    enum                CdClientError;
    void                (*_cd_client_reserved1)             (void);
    void                (*_cd_client_reserved2)             (void);
    void                (*_cd_client_reserved3)             (void);
    void                (*_cd_client_reserved4)             (void);
    void                (*_cd_client_reserved5)             (void);
    void                (*_cd_client_reserved6)             (void);
    void                (*_cd_client_reserved7)             (void);
    void                (*_cd_client_reserved8)             (void);
    void                cd_client_connect                   (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            cd_client_connect_finish            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_create_device             (CdClient *client,
                                                             const gchar *id,
                                                             CdObjectScope scope,
                                                             GHashTable *properties,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CdDevice *          cd_client_create_device_finish      (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_create_profile            (CdClient *client,
                                                             const gchar *id,
                                                             CdObjectScope scope,
                                                             GHashTable *properties,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CdProfile *         cd_client_create_profile_finish     (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_delete_device             (CdClient *client,
                                                             CdDevice *device,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            cd_client_delete_device_finish      (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_delete_profile            (CdClient *client,
                                                             CdProfile *profile,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    gboolean            cd_client_delete_profile_finish     (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    GQuark              cd_client_error_quark               (void);
    void                cd_client_find_device               (CdClient *client,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    void                cd_client_find_device_by_property   (CdClient *client,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CdDevice *          cd_client_find_device_by_property_finish
                                                            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    CdDevice *          cd_client_find_device_finish        (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_find_profile              (CdClient *client,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    void                cd_client_find_profile_by_filename  (CdClient *client,
                                                             const gchar *filename,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CdProfile *         cd_client_find_profile_by_filename_finish
                                                            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    CdProfile *         cd_client_find_profile_finish       (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    gboolean            cd_client_get_connected             (CdClient *client);
    const gchar *       cd_client_get_daemon_version        (CdClient *client);
    void                cd_client_get_devices               (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    void                cd_client_get_devices_by_kind       (CdClient *client,
                                                             CdDeviceKind kind,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GPtrArray *         cd_client_get_devices_by_kind_finish
                                                            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    GPtrArray *         cd_client_get_devices_finish        (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    gboolean            cd_client_get_has_server            (CdClient *client);
    void                cd_client_get_profiles              (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GPtrArray *         cd_client_get_profiles_finish       (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_get_sensors               (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    GPtrArray *         cd_client_get_sensors_finish        (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_get_standard_space        (CdClient *client,
                                                             CdStandardSpace standard_space,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CdProfile *         cd_client_get_standard_space_finish (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    void                cd_client_import_profile            (CdClient *client,
                                                             GFile *file,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CdProfile *         cd_client_import_profile_finish     (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);
    CdClient *          cd_client_new                       (void);
    void                (*changed)                          (CdProfile *profile);
    void                (*device_added)                     (CdClient *client,
                                                             CdDevice *device);
    void                (*device_changed)                   (CdClient *client,
                                                             CdDevice *device);
    void                (*device_removed)                   (CdClient *client,
                                                             CdDevice *device);
    void                (*profile_added)                    (CdClient *client,
                                                             CdProfile *profile);
    void                (*profile_changed)                  (CdClient *client,
                                                             CdProfile *profile);
    void                (*profile_removed)                  (CdClient *client,
                                                             CdProfile *profile);
    void                (*sensor_added)                     (CdClient *client,
                                                             CdSensor *sensor);
    void                (*sensor_changed)                   (CdClient *client,
                                                             CdSensor *sensor);
    void                (*sensor_removed)                   (CdClient *client,
                                                             CdSensor *sensor);

## Description

A helper GObject to use for accessing colord information, and to be notified when it is changed.

See also: CdDevice

## Details

### CD_CLIENT_ERROR

    #define CD_CLIENT_ERROR		(cd_client_error_quark ())

### CD_CLIENT_TYPE_ERROR

    #define CD_CLIENT_TYPE_ERROR (cd_client_error_get_type ())

### enum CdClientError

    typedef enum {
    	CD_CLIENT_ERROR_FAILED,
    	CD_CLIENT_ERROR_ALREADY_EXISTS,
    	CD_CLIENT_ERROR_FILE_INVALID,
    	CD_CLIENT_ERROR_LAST
    } CdClientError;

Errors that can be thrown

`CD_CLIENT_ERROR_FAILED` | the transaction failed for an unknown reason
`CD_CLIENT_ERROR_ALREADY_EXISTS` | the device or profile already exists
`CD_CLIENT_ERROR_FILE_INVALID` |
`CD_CLIENT_ERROR_LAST` |

### _cd_client_reserved1 ()

    void                (*_cd_client_reserved1)             (void);

### _cd_client_reserved2 ()

    void                (*_cd_client_reserved2)             (void);

### _cd_client_reserved3 ()

    void                (*_cd_client_reserved3)             (void);

### _cd_client_reserved4 ()

    void                (*_cd_client_reserved4)             (void);

### _cd_client_reserved5 ()

    void                (*_cd_client_reserved5)             (void);

### _cd_client_reserved6 ()

    void                (*_cd_client_reserved6)             (void);

### _cd_client_reserved7 ()

    void                (*_cd_client_reserved7)             (void);

### _cd_client_reserved8 ()

    void                (*_cd_client_reserved8)             (void);

### cd_client_connect ()

    void                cd_client_connect                   (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Connects to the colord daemon.

`client` : | a CdClient instance
`cancellable` : | a GCancellable or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.6

### cd_client_connect_finish ()

    gboolean            cd_client_connect_finish            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | success

Since 0.1.6

### cd_client_create_device ()

    void                cd_client_create_device             (CdClient *client,
                                                             const gchar *id,
                                                             CdObjectScope scope,
                                                             GHashTable *properties,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Creates a color device.

`client` : | a CdClient instance.
`id` : | identifier for the device
`scope` : | the scope of the device
`properties` : | properties to set on the device, or `NULL`. [element-type utf8 utf8][allow-none]
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_create_device_finish ()

    CdDevice *          cd_client_create_device_finish      (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdDevice or `NULL`. [transfer full]

Since 0.1.8

### cd_client_create_profile ()

    void                cd_client_create_profile            (CdClient *client,
                                                             const gchar *id,
                                                             CdObjectScope scope,
                                                             GHashTable *properties,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Creates a color profile.

`client` : | a CdClient instance.
`id` : | identifier for the profile
`scope` : | the scope of the profile
`properties` : | properties to set on the profile, or `NULL`. [element-type utf8 utf8][allow-none]
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_create_profile_finish ()

    CdProfile *         cd_client_create_profile_finish     (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdProfile or `NULL`. [transfer full]

Since 0.1.8

### cd_client_delete_device ()

    void                cd_client_delete_device             (CdClient *client,
                                                             CdDevice *device,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Deletes a device.

`client` : | a CdClient instance.
`device` : | a CdDevice
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_delete_device_finish ()

    gboolean            cd_client_delete_device_finish      (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | success

Since 0.1.8

### cd_client_delete_profile ()

    void                cd_client_delete_profile            (CdClient *client,
                                                             CdProfile *profile,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Deletes a profile.

`client` : | a CdClient instance.
`profile` : | a CdProfile
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_delete_profile_finish ()

    gboolean            cd_client_delete_profile_finish     (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | success

Since 0.1.8

### cd_client_error_quark ()

    GQuark              cd_client_error_quark               (void);

Returns : | An error quark.

Since 0.1.0

### cd_client_find_device ()

    void                cd_client_find_device               (CdClient *client,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Finds a device by an ID.

`client` : | a CdClient instance.
`id` : | a device id
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_find_device_by_property ()

    void                cd_client_find_device_by_property   (CdClient *client,
                                                             const gchar *key,
                                                             const gchar *value,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Finds a color device that has a property value.

`client` : | a CdClient instance.
`key` : | the device property key
`value` : | the device property value
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_find_device_by_property_finish ()

    CdDevice *          cd_client_find_device_by_property_finish
                                                            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdDevice or `NULL`. [transfer full]

Since 0.1.8

### cd_client_find_device_finish ()

    CdDevice *          cd_client_find_device_finish        (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdDevice or `NULL`. [transfer full]

Since 0.1.8

### cd_client_find_profile ()

    void                cd_client_find_profile              (CdClient *client,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Finds a profile by an ID.

`client` : | a CdClient instance.
`id` : | a profile id
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_find_profile_by_filename ()

    void                cd_client_find_profile_by_filename  (CdClient *client,
                                                             const gchar *filename,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Finds a profile by a filename.

`client` : | a CdClient instance.
`filename` : | a profile filename
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_find_profile_by_filename_finish ()

    CdProfile *         cd_client_find_profile_by_filename_finish
                                                            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdProfile or `NULL`. [transfer full]

Since 0.1.8

### cd_client_find_profile_finish ()

    CdProfile *         cd_client_find_profile_finish       (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdProfile or `NULL`. [transfer full]

Since 0.1.8

### cd_client_get_connected ()

    gboolean            cd_client_get_connected             (CdClient *client);

Gets if the client has been connected.

`client` : | a CdClient instance.
Returns : | `TRUE` if properties are valid

Since 0.1.9

### cd_client_get_daemon_version ()

    const gchar *       cd_client_get_daemon_version        (CdClient *client);

Get colord daemon version.

`client` : | a CdClient instance.
Returns : | string containing the daemon version, e.g. "0.1.0"

Since 0.1.0

### cd_client_get_devices ()

    void                cd_client_get_devices               (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Gets an array of color devices.

`client` : | a CdClient instance.
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_get_devices_by_kind ()

    void                cd_client_get_devices_by_kind       (CdClient *client,
                                                             CdDeviceKind kind,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Gets an array of color devices.

`client` : | a CdClient instance.
`kind` : | the type of device.
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_get_devices_by_kind_finish ()

    GPtrArray *         cd_client_get_devices_by_kind_finish
                                                            (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | the devices. [element-type CdDevice][transfer full]

Since 0.1.8

### cd_client_get_devices_finish ()

    GPtrArray *         cd_client_get_devices_finish        (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | the devices. [element-type CdDevice][transfer full]

Since 0.1.8

### cd_client_get_has_server ()

    gboolean            cd_client_get_has_server            (CdClient *client);

Gets if the colord server is currently running.

`client` : | a CdClient instance.
Returns : | `TRUE` if the colord process is running

Since 0.1.12

### cd_client_get_profiles ()

    void                cd_client_get_profiles              (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Gets an array of color profiles.

`client` : | a CdClient instance.
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_get_profiles_finish ()

    GPtrArray *         cd_client_get_profiles_finish       (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | the profiles. [element-type CdProfile][transfer full]

Since 0.1.8

### cd_client_get_sensors ()

    void                cd_client_get_sensors               (CdClient *client,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Gets an array of color sensors.

`client` : | a CdClient instance.
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_get_sensors_finish ()

    GPtrArray *         cd_client_get_sensors_finish        (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | the sensors. [element-type CdSensor][transfer full]

Since 0.1.8

### cd_client_get_standard_space ()

    void                cd_client_get_standard_space        (CdClient *client,
                                                             CdStandardSpace standard_space,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Finds a standard profile space.

`client` : | a CdStandardSpace instance.
`standard_space` : | a profile id
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.8

### cd_client_get_standard_space_finish ()

    CdProfile *         cd_client_get_standard_space_finish (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdProfile or `NULL`. [transfer full]

Since 0.1.8

### cd_client_import_profile ()

    void                cd_client_import_profile            (CdClient *client,
                                                             GFile *file,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

Imports a color profile into the users home directory.

If the profile should be accessable for all users, then call `cd_profile_install_system_wide()` on the result.

`client` : | a CdClient instance.
`file` : | a GFile
`cancellable` : | a GCancellable, or `NULL`
`callback` : | the function to run on completion
`user_data` : | the data to pass to `callback`

Since 0.1.12

### cd_client_import_profile_finish ()

    CdProfile *         cd_client_import_profile_finish     (CdClient *client,
                                                             GAsyncResult *res,
                                                             GError **error);

Gets the result from the asynchronous function.

`client` : | a CdClient instance.
`res` : | the GAsyncResult
`error` : | A GError or `NULL`
Returns : | a CdProfile or `NULL`. [transfer full]

Since 0.1.12

### cd_client_new ()

    CdClient *          cd_client_new                       (void);

Creates a new CdClient object.

Returns : | a new CdClient object.

Since 0.1.0

### changed ()

    void                (*changed)                          (CdProfile *profile);

### device_added ()

    void                (*device_added)                     (CdClient *client,
                                                             CdDevice *device);

### device_changed ()

    void                (*device_changed)                   (CdClient *client,
                                                             CdDevice *device);

### device_removed ()

    void                (*device_removed)                   (CdClient *client,
                                                             CdDevice *device);

### profile_added ()

    void                (*profile_added)                    (CdClient *client,
                                                             CdProfile *profile);

### profile_changed ()

    void                (*profile_changed)                  (CdClient *client,
                                                             CdProfile *profile);

### profile_removed ()

    void                (*profile_removed)                  (CdClient *client,
                                                             CdProfile *profile);

### sensor_added ()

    void                (*sensor_added)                     (CdClient *client,
                                                             CdSensor *sensor);

### sensor_changed ()

    void                (*sensor_changed)                   (CdClient *client,
                                                             CdSensor *sensor);

### sensor_removed ()

    void                (*sensor_removed)                   (CdClient *client,
                                                             CdSensor *sensor);