CdClient: colord Reference Manual

## CdClient CdClient — Main client object for accessing the colord daemon |

## Functions

GQuark | cd_client_error_quark ()
CdClient * | cd_client_new ()
void | cd_client_connect ()
gboolean | cd_client_connect_finish ()
void | cd_client_create_device ()
CdDevice * | cd_client_create_device_finish ()
void | cd_client_create_profile ()
CdProfile * | cd_client_create_profile_finish ()
void | cd_client_create_profile_for_icc ()
CdProfile * | cd_client_create_profile_for_icc_finish ()
void | cd_client_import_profile ()
CdProfile * | cd_client_import_profile_finish ()
void | cd_client_delete_device ()
gboolean | cd_client_delete_device_finish ()
void | cd_client_delete_profile ()
gboolean | cd_client_delete_profile_finish ()
void | cd_client_find_device ()
CdDevice * | cd_client_find_device_finish ()
void | cd_client_find_device_by_property ()
CdDevice * | cd_client_find_device_by_property_finish ()
void | cd_client_find_profile ()
CdProfile * | cd_client_find_profile_finish ()
void | cd_client_find_profile_by_filename ()
CdProfile * | cd_client_find_profile_by_filename_finish ()
void | cd_client_get_standard_space ()
CdProfile * | cd_client_get_standard_space_finish ()
void | cd_client_get_devices ()
GPtrArray * | cd_client_get_devices_finish ()
void | cd_client_get_devices_by_kind ()
GPtrArray * | cd_client_get_devices_by_kind_finish ()
void | cd_client_get_profiles ()
GPtrArray * | cd_client_get_profiles_finish ()
void | cd_client_get_sensors ()
GPtrArray * | cd_client_get_sensors_finish ()
void | cd_client_find_profile_by_property ()
CdProfile * | cd_client_find_profile_by_property_finish ()
void | cd_client_find_sensor ()
CdSensor * | cd_client_find_sensor_finish ()
gboolean | cd_client_get_connected ()
gboolean | cd_client_get_has_server ()
const gchar * | cd_client_get_daemon_version ()
const gchar * | cd_client_get_system_vendor ()
const gchar * | cd_client_get_system_model ()

## Types and Values

#define | CD_CLIENT_ERROR
#define | CD_CLIENT_TYPE_ERROR
#define | CD_TYPE_CLIENT
struct | CdClientClass
| CdClient

## Description

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

See also: CdDevice

## Functions

### cd_client_error_quark ()

    GQuark
    cd_client_error_quark (void);

#### Returns

An error quark.

Since: 0.1.0

### cd_client_new ()

    CdClient *
    cd_client_new (void);

Creates a new CdClient object.

#### Returns

a new CdClient object.

Since: 0.1.0

### cd_client_connect ()

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

Connects to the colord daemon.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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_create_profile_for_icc ()

    void
    cd_client_create_profile_for_icc (CdClient *client,
                                      CdIcc *icc,
                                      CdObjectScope scope,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Creates a color profile for an CdIcc Object.

#### Parameters

client | a CdClient instance. |
icc | CdIcc object |
scope | the scope of the profile |
cancellable | a GCancellable, or `NULL` |
callback | the function to run on completion |
user_data | the data to pass to `callback` |

Since: 1.1.1

### cd_client_create_profile_for_icc_finish ()

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

Gets the result from the asynchronous function.

#### Parameters

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

#### Returns

a CdProfile or `NULL`.

[transfer full]

Since: 1.1.1

### 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 accessible for all users, then call `cd_profile_install_system_wide()` on the result.

#### Parameters

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.

#### Parameters

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_delete_device ()

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

Deletes a device.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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

#### Returns

success

Since: 0.1.8

### 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.

#### Parameters

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_finish ()

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

Gets the result from the asynchronous function.

#### Parameters

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_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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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_finish ()

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

Gets the result from the asynchronous function.

#### Parameters

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_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.

#### Parameters

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.

#### Parameters

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_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.

#### Parameters

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.

#### Parameters

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_devices ()

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

Gets an array of color devices.

#### Parameters

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_finish ()

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

Gets the result from the asynchronous function.

#### Parameters

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_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.

#### Parameters

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.

#### Parameters

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_profiles ()

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

Gets an array of color profiles.

#### Parameters

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.

#### Parameters

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

#### Returns

the profiles.

[element-type CdProfile][transfer container]

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.

#### Parameters

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.

#### Parameters

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_find_profile_by_property ()

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

Finds a color profile that has a property value.

#### Parameters

client | a CdClient instance. |
key | the profile property key |
value | the profile 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.24

### cd_client_find_profile_by_property_finish ()

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

Gets the result from the asynchronous function.

#### Parameters

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

#### Returns

a CdProfile or `NULL`.

[transfer full]

Since: 0.1.24

### cd_client_find_sensor ()

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

Finds a sensor by an ID.

#### Parameters

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

Since: 0.1.26

### cd_client_find_sensor_finish ()

    CdSensor *
    cd_client_find_sensor_finish (CdClient *client,
                                  GAsyncResult *res,
                                  GError **error);

Gets the result from the asynchronous function.

#### Parameters

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

#### Returns

a CdSensor or `NULL`.

[transfer full]

Since: 0.1.26

### cd_client_get_connected ()

    gboolean
    cd_client_get_connected (CdClient *client);

Gets if the client has been connected.

#### Parameters

client | a CdClient instance. |

#### Returns

`TRUE` if properties are valid

Since: 0.1.9

### cd_client_get_has_server ()

    gboolean
    cd_client_get_has_server (CdClient *client);

Gets if the colord server is currently running. WARNING: This function may block for up to 5 seconds waiting for the daemon to start if it is not already running.

#### Parameters

client | a CdClient instance. |

#### Returns

`TRUE` if the colord process is running

Since: 0.1.12

### cd_client_get_daemon_version ()

    const gchar *
    cd_client_get_daemon_version (CdClient *client);

Get colord daemon version.

#### Parameters

client | a CdClient instance. |

#### Returns

string containing the daemon version, e.g. "0.1.0"

Since: 0.1.0

### cd_client_get_system_vendor ()

    const gchar *
    cd_client_get_system_vendor (CdClient *client);

Get system vendor.

#### Parameters

client | a CdClient instance. |

#### Returns

string containing the system vendor, e.g. "Lenovo"

Since: 1.0.2

### cd_client_get_system_model ()

    const gchar *
    cd_client_get_system_model (CdClient *client);

Get system model.

#### Parameters

client | a CdClient instance. |

#### Returns

string containing the system model, e.g. "T61"

Since: 1.0.2

## Types and Values

### 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 ())

### CD_TYPE_CLIENT

    #define CD_TYPE_CLIENT (cd_client_get_type ())

### struct CdClientClass

    struct CdClientClass {
    	GObjectClass		 parent_class;
    	void			(*device_added)		(CdClient		*client,
    							 CdDevice		*device);
    	void			(*device_removed) (CdClient		*client,
    							 CdDevice		*device);
    	void			(*device_changed) (CdClient		*client,
    							 CdDevice		*device);
    	void			(*profile_added) (CdClient		*client,
    							 CdProfile		*profile);
    	void			(*profile_removed) (CdClient		*client,
    							 CdProfile		*profile);
    	void			(*profile_changed) (CdClient		*client,
    							 CdProfile		*profile);
    	void			(*sensor_added)		(CdClient		*client,
    							 CdSensor		*sensor);
    	void			(*sensor_removed) (CdClient		*client,
    							 CdSensor		*sensor);
    	void			(*sensor_changed) (CdClient		*client,
    							 CdSensor		*sensor);
    	void			(*changed)              (CdClient		*client);
    };

### CdClient

    typedef struct _CdClient CdClient;