## CryptUIKeyStore

CryptUIKeyStore

## Synopsis

                        CryptUIKeyStorePriv;
    struct              CryptUIKeyStore;
    enum                CryptUIKeyStoreMode;
    gboolean            (*CryptUIKeyStoreFilterFunc)        (CryptUIKeyset *ckset,
                                                             const gchar *key,
                                                             gpointer user_data);
    CryptUIKeyStore *   cryptui_key_store_new               (CryptUIKeyset *keyset,
                                                             gboolean use_checks,
                                                             const gchar *none_option);
    CryptUIKeyset *     cryptui_key_store_get_keyset        (CryptUIKeyStore *ckstore);
    void                cryptui_key_store_set_sortable      (CryptUIKeyStore *ckstore,
                                                             gboolean sortable);
    gboolean            cryptui_key_store_get_sortable      (CryptUIKeyStore *ckstore);
    void                cryptui_key_store_check_toggled     (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view,
                                                             GtkTreeIter *iter);
    gboolean            cryptui_key_store_get_iter_from_key (CryptUIKeyStore *ckstore,
                                                             const gchar *key,
                                                             GtkTreeIter *iter);
    const gchar *       cryptui_key_store_get_key_from_iter (CryptUIKeyStore *ckstore,
                                                             GtkTreeIter *iter);
    const gchar *       cryptui_key_store_get_key_from_path (CryptUIKeyStore *ckstore,
                                                             GtkTreePath *path);
    GList *             cryptui_key_store_get_all_keys      (CryptUIKeyStore *ckstore);
    guint               cryptui_key_store_get_count         (CryptUIKeyStore *ckstore);
    gboolean            cryptui_key_store_have_selected_keys
                                                            (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view);
    GList *             cryptui_key_store_get_selected_keys (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view);
    void                cryptui_key_store_set_selected_keys (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view,
                                                             GList *keys);
    const gchar *       cryptui_key_store_get_selected_key  (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view);
    void                cryptui_key_store_set_selected_key  (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view,
                                                             const gchar *selkey);
    void                cryptui_key_store_set_search_mode   (CryptUIKeyStore *ckstore,
                                                             CryptUIKeyStoreMode mode);
    void                cryptui_key_store_set_search_text   (CryptUIKeyStore *ckstore,
                                                             const gchar *search_text);
    void                cryptui_key_store_set_filter        (CryptUIKeyStore *ckstore,
                                                             CryptUIKeyStoreFilterFunc func,
                                                             gpointer user_data);

## Description

## Details

### CryptUIKeyStorePriv

    typedef struct _CryptUIKeyStorePriv CryptUIKeyStorePriv;

### struct CryptUIKeyStore

    struct CryptUIKeyStore {
        GtkTreeModelSort       parent;

        CryptUIKeyset          *ckset;
    };

### enum CryptUIKeyStoreMode

    typedef enum {
        CRYPTUI_KEY_STORE_MODE_ALL,
        CRYPTUI_KEY_STORE_MODE_SELECTED,
        CRYPTUI_KEY_STORE_MODE_RESULTS
    } CryptUIKeyStoreMode;

### CryptUIKeyStoreFilterFunc ()

    gboolean            (*CryptUIKeyStoreFilterFunc)        (CryptUIKeyset *ckset,
                                                             const gchar *key,
                                                             gpointer user_data);

### cryptui_key_store_new ()

    CryptUIKeyStore *   cryptui_key_store_new               (CryptUIKeyset *keyset,
                                                             gboolean use_checks,
                                                             const gchar *none_option);

Creates a new libcryptui key store setting the keystore, use-checks and none-option properties

`keyset` : | a libcryptui keyset
`use_checks` : | a gboolean
`none_option` : | a const gchar string
Returns : | the new libcryptui key store

### cryptui_key_store_get_keyset ()

    CryptUIKeyset *     cryptui_key_store_get_keyset        (CryptUIKeyStore *ckstore);

Gets ckstore's internal keyset

`ckstore` : | a libcryptui key store
Returns : | the internal libcryptui keyset

### cryptui_key_store_set_sortable ()

    void                cryptui_key_store_set_sortable      (CryptUIKeyStore *ckstore,
                                                             gboolean sortable);

Sets whether ckstore is sortable or not

`ckstore` : | a libcryptui key store
`sortable` : | a gboolean

### cryptui_key_store_get_sortable ()

    gboolean            cryptui_key_store_get_sortable      (CryptUIKeyStore *ckstore);

Gets whether ckstore is sortable or not

`ckstore` : | a libcryptui key store
Returns : | TRUE if ckstore is sortable, FALSE otherwise

### cryptui_key_store_check_toggled ()

    void                cryptui_key_store_check_toggled     (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view,
                                                             GtkTreeIter *iter);

Gets whether the check at iter is toggled

`ckstore` : | a libcryptui key store
`view` : | a GtkTreeView
`iter` : | a GtkTreeIter

### cryptui_key_store_get_iter_from_key ()

    gboolean            cryptui_key_store_get_iter_from_key (CryptUIKeyStore *ckstore,
                                                             const gchar *key,
                                                             GtkTreeIter *iter);

Get the iter that the key is stored at in ckstore

`ckstore` : | a libcryptui key store
`key` : | a libcryptui key
`iter` : | a GtkTreeIter
Returns : | TRUE if the key is present in the ckstore and the value of iter has been modified to point to it, FALSE otherwise

### cryptui_key_store_get_key_from_iter ()

    const gchar *       cryptui_key_store_get_key_from_iter (CryptUIKeyStore *ckstore,
                                                             GtkTreeIter *iter);

Gets the key stored at iter in ckstore

`ckstore` : | a libcryptui key store
`iter` : | a GtkTreeIter
Returns : | a libcryptui key

### cryptui_key_store_get_key_from_path ()

    const gchar *       cryptui_key_store_get_key_from_path (CryptUIKeyStore *ckstore,
                                                             GtkTreePath *path);

Get the key at path in ckstore

`ckstore` : | a libcryptui key store
`path` : | a GtkTreePath
Returns : | a libcryptui key

### cryptui_key_store_get_all_keys ()

    GList *             cryptui_key_store_get_all_keys      (CryptUIKeyStore *ckstore);

Get a list of all keys in ckstore

`ckstore` : | a libcryptui key store
Returns : | a list of libcryptui keys

### cryptui_key_store_get_count ()

    guint               cryptui_key_store_get_count         (CryptUIKeyStore *ckstore);

Get the number of keys stored in ckstore

`ckstore` : | a libcryptui key store
Returns : | the number of keys

### cryptui_key_store_have_selected_keys ()

    gboolean            cryptui_key_store_have_selected_keys
                                                            (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view);

Determines whether keys are selected or not.

`ckstore` : | a libcryptui key store
`view` : | a GtkTreeView
Returns : | TRUE if keys have been selected, FALSE otherwise

### cryptui_key_store_get_selected_keys ()

    GList *             cryptui_key_store_get_selected_keys (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view);

Get the currently selected keys

`ckstore` : | a libcryptui key store
`view` : | a GtkTreeView
Returns : | a list of libcryptui keys

### cryptui_key_store_set_selected_keys ()

    void                cryptui_key_store_set_selected_keys (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view,
                                                             GList *keys);

Set the current selection to be the list of keys

`ckstore` : | a libcryptui key store
`view` : | a GtkTreeView
`keys` : | a list of libcryptui keys

### cryptui_key_store_get_selected_key ()

    const gchar *       cryptui_key_store_get_selected_key  (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view);

Get the currently selected key

`ckstore` : | a libcryptui key store
`view` : | a GtkTreeView
Returns : | a libcryptui key

### cryptui_key_store_set_selected_key ()

    void                cryptui_key_store_set_selected_key  (CryptUIKeyStore *ckstore,
                                                             GtkTreeView *view,
                                                             const gchar *selkey);

Marks the given key as selected

`ckstore` : | a libcryptui key store
`view` : | a GtkTreeView
`selkey` : | a libcryptui key

### cryptui_key_store_set_search_mode ()

    void                cryptui_key_store_set_search_mode   (CryptUIKeyStore *ckstore,
                                                             CryptUIKeyStoreMode mode);

Sets whether the keys returned will be all, just those searched for, or those selected.

`ckstore` : | a libcryptui key store
`mode` : | search mode

### cryptui_key_store_set_search_text ()

    void                cryptui_key_store_set_search_text   (CryptUIKeyStore *ckstore,
                                                             const gchar *search_text);

Filters the keys in the store by the text in search_text.

`ckstore` : | a libcryptui key store
`search_text` : | a string

### cryptui_key_store_set_filter ()

    void                cryptui_key_store_set_filter        (CryptUIKeyStore *ckstore,
                                                             CryptUIKeyStoreFilterFunc func,
                                                             gpointer user_data);

Filters the key store's keys with the given filter function.

`ckstore` : | a libcryptui key store
`func` : | a filter function
`user_data` : | a generic pointer