CdIccStore

## CdIccStore CdIccStore — An object to monitor a directory full of ICC profiles |

## Synopsis

    struct              CdIccStore;
    struct              CdIccStoreClass;
    enum                CdIccStoreSearchFlags;
    enum                CdIccStoreSearchKind;
    CdIccStore *        cd_icc_store_new                    (void);
    gboolean            cd_icc_store_search_location        (CdIccStore *store,
                                                             const gchar *location,
                                                             CdIccStoreSearchFlags search_flags,
                                                             GCancellable *cancellable,
                                                             GError **error);
    gboolean            cd_icc_store_search_kind            (CdIccStore *store,
                                                             CdIccStoreSearchKind search_kind,
                                                             CdIccStoreSearchFlags search_flags,
                                                             GCancellable *cancellable,
                                                             GError **error);
    void                cd_icc_store_set_load_flags         (CdIccStore *store,
                                                             CdIccLoadFlags load_flags);
    CdIccLoadFlags      cd_icc_store_get_load_flags         (CdIccStore *store);
    void                cd_icc_store_set_cache              (CdIccStore *store,
                                                             GResource *cache);
    GPtrArray *         cd_icc_store_get_all                (CdIccStore *store);
    CdIcc *             cd_icc_store_find_by_filename       (CdIccStore *store,
                                                             const gchar *filename);
    CdIcc *             cd_icc_store_find_by_checksum       (CdIccStore *store,
                                                             const gchar *checksum);

## Object Hierarchy

      GObject
       +----CdIccStore

## Signals

      "added"                                          : Run Last
      "removed"                                        : Run Last

## Description

## Details

### struct CdIccStore

    struct CdIccStore;

### struct CdIccStoreClass

    struct CdIccStoreClass {
    	GObjectClass parent_class;
    	void		(* added)		(CdIcc		*icc);
    	void		(* removed)		(CdIcc		*icc);
    };

### enum CdIccStoreSearchFlags

    typedef enum {
    	CD_ICC_STORE_SEARCH_FLAGS_NONE			= 0,
    	CD_ICC_STORE_SEARCH_FLAGS_CREATE_LOCATION = 1,
    } CdIccStoreSearchFlags;

Flags used when adding scan locations.

`CD_ICC_STORE_SEARCH_FLAGS_NONE` | No flags set.
`CD_ICC_STORE_SEARCH_FLAGS_CREATE_LOCATION` | Create the location if it does not exist

Since 1.1.1

### enum CdIccStoreSearchKind

    typedef enum {
    	CD_ICC_STORE_SEARCH_KIND_SYSTEM,
    	CD_ICC_STORE_SEARCH_KIND_MACHINE,
    	CD_ICC_STORE_SEARCH_KIND_USER,
    } CdIccStoreSearchKind;

The kind of profiles locations to search.

`CD_ICC_STORE_SEARCH_KIND_SYSTEM` | Per-system locations
`CD_ICC_STORE_SEARCH_KIND_MACHINE` | Per-machine locations
`CD_ICC_STORE_SEARCH_KIND_USER` | Per-user locations

Since 1.1.1

### cd_icc_store_new ()

    CdIccStore *        cd_icc_store_new                    (void);

Creates a new CdIccStore object.

Returns : | a new CdIccStore object.

Since 1.0.2

### cd_icc_store_search_location ()

    gboolean            cd_icc_store_search_location        (CdIccStore *store,
                                                             const gchar *location,
                                                             CdIccStoreSearchFlags search_flags,
                                                             GCancellable *cancellable,
                                                             GError **error);

Adds a location to be watched for ICC profiles

`store` : | a CdIccStore instance.
`location` : | a fully qualified path
`search_flags` : | CdIccStoreSearchFlags, e.g. `CD_ICC_STORE_SEARCH_FLAGS_CREATE_LOCATION`
`cancellable` : | A GCancellable or `NULL`
`error` : | A GError or `NULL`
Returns : | `TRUE` for success

Since 1.0.2

### cd_icc_store_search_kind ()

    gboolean            cd_icc_store_search_kind            (CdIccStore *store,
                                                             CdIccStoreSearchKind search_kind,
                                                             CdIccStoreSearchFlags search_flags,
                                                             GCancellable *cancellable,
                                                             GError **error);

Adds a location to be watched for ICC profiles

`store` : | a CdIccStore instance.
`search_kind` : | a CdIccStoreSearchKind, e.g. `CD_ICC_STORE_SEARCH_KIND_USER`
`search_flags` : | a CdIccStoreSearchFlags, e.g. `CD_ICC_STORE_SEARCH_FLAGS_CREATE_LOCATION`
`cancellable` : | A GCancellable or `NULL`
`error` : | A GError or `NULL`
Returns : | `TRUE` for success

Since 1.0.2

### cd_icc_store_set_load_flags ()

    void                cd_icc_store_set_load_flags         (CdIccStore *store,
                                                             CdIccLoadFlags load_flags);

Sets the load flags to use when loading newly added profiles

`store` : | a CdIccStore instance.
`load_flags` : | CdIccLoadFlags, e.g. `CD_ICC_LOAD_FLAGS_TRANSLATIONS`

Since 1.0.2

### cd_icc_store_get_load_flags ()

    CdIccLoadFlags      cd_icc_store_get_load_flags         (CdIccStore *store);

Gets the load flags to use when loading newly added profiles

`store` : | a CdIccStore instance.
Returns : | the load flags to use

Since 1.0.2

### cd_icc_store_set_cache ()

    void                cd_icc_store_set_cache              (CdIccStore *store,
                                                             GResource *cache);

Sets an optional cache to use when reading profiles. This is probably only useful to the colord daemon. This function can only be called once.

`store` : | a CdIccStore instance.
`cache` : | a GResource

Since 1.0.2

### cd_icc_store_get_all ()

    GPtrArray *         cd_icc_store_get_all                (CdIccStore *store);

Gets the list of CdIcc objects in the store

`store` : | a CdIccStore instance.
Returns : | ICC profile objects. [transfer container][element-type CdIcc]

Since 1.0.2

### cd_icc_store_find_by_filename ()

    CdIcc *             cd_icc_store_find_by_filename       (CdIccStore *store,
                                                             const gchar *filename);

Finds a ICC object in the store by filename.

`filename` : | a fully qualified filename
Returns : | an ICC profile object or `NULL`. [transfer full][element-type CdIcc]

Since 1.0.2

### cd_icc_store_find_by_checksum ()

    CdIcc *             cd_icc_store_find_by_checksum       (CdIccStore *store,
                                                             const gchar *checksum);

Finds a ICC object in the store by checksum.

`checksum` : | a checksum value
Returns : | an ICC profile object or `NULL`. [transfer full][element-type CdIcc]

Since 1.0.2

## Signal Details

### The `"added"` signal

    void                user_function                      (CdIccStore *profile,
                                                            CdIcc      *icc,
                                                            gpointer    user_data)      : Run Last

The ::added signal is emitted when an ICC profile has been added.

`profile` : | the CdIccStore instance that emitted the signal
`icc` : | the CdIcc that was added
`user_data` : | user data set when the signal handler was connected.

Since 1.0.2

### The `"removed"` signal

    void                user_function                      (CdIccStore *profile,
                                                            CdIcc      *icc,
                                                            gpointer    user_data)      : Run Last

The ::removed signal is emitted when an ICC profile has been removed.

`profile` : | the CdIccStore instance that emitted the signal
`icc` : | the CdIcc that was removed
`user_data` : | user data set when the signal handler was connected.

Since 1.0.2