PackageKit Reference Manual: PkClient

## PkClient PkClient — For creating new transactions |

## Functions

GQuark | pk_client_error_quark ()
PkClient * | pk_client_new ()
void | pk_client_test ()
PkResults * | pk_client_generic_finish ()
void | pk_client_resolve_async ()
void | pk_client_search_names_async ()
void | pk_client_search_details_async ()
void | pk_client_search_groups_async ()
void | pk_client_search_files_async ()
void | pk_client_get_details_async ()
void | pk_client_get_update_detail_async ()
void | pk_client_download_packages_async ()
void | pk_client_get_updates_async ()
void | pk_client_get_old_transactions_async ()
void | pk_client_get_depends_async ()
void | pk_client_get_packages_async ()
void | pk_client_get_requires_async ()
void | pk_client_what_provides_async ()
void | pk_client_get_distro_upgrades_async ()
void | pk_client_get_files_async ()
void | pk_client_get_categories_async ()
void | pk_client_remove_packages_async ()
void | pk_client_refresh_cache_async ()
void | pk_client_install_packages_async ()
void | pk_client_install_signature_async ()
void | pk_client_update_packages_async ()
void | pk_client_install_files_async ()
void | pk_client_accept_eula_async ()
void | pk_client_get_repo_list_async ()
void | pk_client_repo_enable_async ()
void | pk_client_repo_set_data_async ()
void | pk_client_upgrade_system_async ()
void | pk_client_repair_system_async ()
void | pk_client_adopt_async ()
PkProgress * | pk_client_get_progress_finish ()
void | pk_client_get_progress_async ()
void | pk_client_set_locale ()
const gchar * | pk_client_get_locale ()
void | pk_client_set_background ()
gboolean | pk_client_get_background ()
void | pk_client_set_interactive ()
gboolean | pk_client_get_interactive ()
gboolean | pk_client_get_idle ()
void | pk_client_set_cache_age ()
guint | pk_client_get_cache_age ()

## Properties

gboolean | background | Read / Write
guint | cache-age | Read / Write
gboolean | idle | Read
gboolean | interactive | Read / Write
gchar * | locale | Read / Write

## Types and Values

#define | PK_CLIENT_ERROR
#define | PK_CLIENT_TYPE_ERROR
enum | PkClientError
struct | PkClient
struct | PkClientClass

## Object Hierarchy

        GEnum
        ╰── PkClientError
        GObject
        ╰── PkClient
            ╰── PkTask

## Description

A GObject to use for accessing PackageKit asynchronously. If you're using PkClient to install, remove, or update packages, be prepared that the eula, gpg and trusted callbacks need to be rescheduled manually, as in http://www.packagekit.org/gtk-doc/introduction-ideas-transactions.html

## Functions

### pk_client_error_quark ()

    GQuark
    pk_client_error_quark (void);

#### Returns

Our personal error quark.

Since 0.5.2

### pk_client_new ()

    PkClient *
    pk_client_new (void);

PkClient is a nice GObject wrapper for PackageKit and makes writing frontends easy.

#### Returns

A new `PkClient` instance

Since 0.5.2

### pk_client_test ()

    void
    pk_client_test (gpointer user_data);

### pk_client_generic_finish ()

    PkResults *
    pk_client_generic_finish (PkClient *client,
                              GAsyncResult *res,
                              GError **error);

Gets the result from the asynchronous function.

#### Parameters

client | a valid PkClient instance |
res | the GAsyncResult |
error | A GError or `NULL` |

#### Returns

the PkResults, or `NULL`. Free with `g_object_unref()`.

[transfer full]

Since 0.5.2

### pk_client_resolve_async ()

    void
    pk_client_resolve_async (PkClient *client,
                             PkBitfield filters,
                             gchar **packages,
                             GCancellable *cancellable,
                             PkProgressCallback progress_callback,
                             gpointer progress_user_data,
                             GAsyncReadyCallback callback_ready,
                             gpointer user_data);

Resolve a package name into a `package_id`. This can return installed and available packages and allows you find out if a package is installed locally or is available in a repository.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
packages | an array of package names to resolve, e.g. "gnome-system-tools". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_search_names_async ()

    void
    pk_client_search_names_async (PkClient *client,
                                  PkBitfield filters,
                                  gchar **values,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

Search all the locally installed files and remote repositories for a package that matches a specific name.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
values | free text to search for, for instance, "power". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.5

### pk_client_search_details_async ()

    void
    pk_client_search_details_async (PkClient *client,
                                    PkBitfield filters,
                                    gchar **values,
                                    GCancellable *cancellable,
                                    PkProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GAsyncReadyCallback callback_ready,
                                    gpointer user_data);

Search all detailed summary information to try and find a keyword. Think of this as `pk_client_search_names()`, but trying much harder and taking longer.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
values | free text to search for, for instance, "power". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.5

### pk_client_search_groups_async ()

    void
    pk_client_search_groups_async (PkClient *client,
                                   PkBitfield filters,
                                   gchar **values,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

Return all packages in a specific group.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
values | a group enum to search for, for instance, "system-tools". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.5

### pk_client_search_files_async ()

    void
    pk_client_search_files_async (PkClient *client,
                                  PkBitfield filters,
                                  gchar **values,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

Search for packages that provide a specific file.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
values | file to search for, for instance, "/sbin/service". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.5

### pk_client_get_details_async ()

    void
    pk_client_get_details_async (PkClient *client,
                                 gchar **package_ids,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Get details of a package, so more information can be obtained for GUI or command line tools.

#### Parameters

client | a valid PkClient instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_update_detail_async ()

    void
    pk_client_get_update_detail_async (PkClient *client,
                                       gchar **package_ids,
                                       GCancellable *cancellable,
                                       PkProgressCallback progress_callback,
                                       gpointer progress_user_data,
                                       GAsyncReadyCallback callback_ready,
                                       gpointer user_data);

Get details about the specific update, for instance any CVE urls and severity information.

#### Parameters

client | a valid PkClient instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_download_packages_async ()

    void
    pk_client_download_packages_async (PkClient *client,
                                       gchar **package_ids,
                                       const gchar *directory,
                                       GCancellable *cancellable,
                                       PkProgressCallback progress_callback,
                                       gpointer progress_user_data,
                                       GAsyncReadyCallback callback_ready,
                                       gpointer user_data);

Downloads package files to a specified location.

#### Parameters

client | a valid PkClient instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
directory | the location where packages are to be downloaded |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_updates_async ()

    void
    pk_client_get_updates_async (PkClient *client,
                                 PkBitfield filters,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Get a list of all the packages that can be updated for all repositories.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_DEVEL` or `PK_FILTER_ENUM_NONE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_old_transactions_async ()

    void
    pk_client_get_old_transactions_async (PkClient *client,
                                          guint number,
                                          GCancellable *cancellable,
                                          PkProgressCallback progress_callback,
                                          gpointer progress_user_data,
                                          GAsyncReadyCallback callback_ready,
                                          gpointer user_data);

Get the old transaction list, mainly used for the transaction viewer.

#### Parameters

client | a valid PkClient instance |
number | the number of past transactions to return, or 0 for all |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_depends_async ()

    void
    pk_client_get_depends_async (PkClient *client,
                                 PkBitfield filters,
                                 gchar **package_ids,
                                 gboolean recursive,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Get the packages that depend this one, i.e. child->parent.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
recursive | If we should search recursively for depends |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_packages_async ()

    void
    pk_client_get_packages_async (PkClient *client,
                                  PkBitfield filters,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

Get the list of packages from the backend

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_requires_async ()

    void
    pk_client_get_requires_async (PkClient *client,
                                  PkBitfield filters,
                                  gchar **package_ids,
                                  gboolean recursive,
                                  GCancellable *cancellable,
                                  PkProgressCallback progress_callback,
                                  gpointer progress_user_data,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

Get the packages that require this one, i.e. parent->child.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
recursive | If we should search recursively for requires |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_what_provides_async ()

    void
    pk_client_what_provides_async (PkClient *client,
                                   PkBitfield filters,
                                   PkProvidesEnum provides,
                                   gchar **values,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

This should return packages that provide the supplied attributes. This method is useful for finding out what package(s) provide a modalias or GStreamer codec string.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_GUI` | `PK_FILTER_ENUM_FREE` or `PK_FILTER_ENUM_NONE` |
provides | a PkProvidesEnum value such as PK_PROVIDES_ENUM_CODEC |
values | a search term such as "sound/mp3". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_distro_upgrades_async ()

    void
    pk_client_get_distro_upgrades_async (PkClient *client,
                                         GCancellable *cancellable,
                                         PkProgressCallback progress_callback,
                                         gpointer progress_user_data,
                                         GAsyncReadyCallback callback_ready,
                                         gpointer user_data);

This method should return a list of distribution upgrades that are available. It should not return updates, only major upgrades.

#### Parameters

client | a valid PkClient instance |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_files_async ()

    void
    pk_client_get_files_async (PkClient *client,
                               gchar **package_ids,
                               GCancellable *cancellable,
                               PkProgressCallback progress_callback,
                               gpointer progress_user_data,
                               GAsyncReadyCallback callback_ready,
                               gpointer user_data);

Get the file list (i.e. a list of files installed) for the specified package.

#### Parameters

client | a valid PkClient instance |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_categories_async ()

    void
    pk_client_get_categories_async (PkClient *client,
                                    GCancellable *cancellable,
                                    PkProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GAsyncReadyCallback callback_ready,
                                    gpointer user_data);

Get a list of all categories supported.

#### Parameters

client | a valid PkClient instance |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_remove_packages_async ()

    void
    pk_client_remove_packages_async (PkClient *client,
                                     PkBitfield transaction_flags,
                                     gchar **package_ids,
                                     gboolean allow_deps,
                                     gboolean autoremove,
                                     GCancellable *cancellable,
                                     PkProgressCallback progress_callback,
                                     gpointer progress_user_data,
                                     GAsyncReadyCallback callback_ready,
                                     gpointer user_data);

Remove a package (optionally with dependancies) from the system. If `allow_deps` is set to `FALSE`, and other packages would have to be removed, then the transaction would fail.

#### Parameters

client | a valid PkClient instance |
transaction_flags | a transaction type bitfield |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
allow_deps | if other dependent packages are allowed to be removed from the computer |
autoremove | if other packages installed at the same time should be tried to remove |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.8.1

### pk_client_refresh_cache_async ()

    void
    pk_client_refresh_cache_async (PkClient *client,
                                   gboolean force,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

Refresh the cache, i.e. download new metadata from a remote URL so that package lists are up to date. This action may take a few minutes and should be done when the session and system are idle.

#### Parameters

client | a valid PkClient instance |
force | if we should aggressively drop caches |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_install_packages_async ()

    void
    pk_client_install_packages_async (PkClient *client,
                                      PkBitfield transaction_flags,
                                      gchar **package_ids,
                                      GCancellable *cancellable,
                                      PkProgressCallback progress_callback,
                                      gpointer progress_user_data,
                                      GAsyncReadyCallback callback_ready,
                                      gpointer user_data);

Install a package of the newest and most correct version.

#### Parameters

client | a valid PkClient instance |
transaction_flags | a transaction type bitfield |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.8.1

### pk_client_install_signature_async ()

    void
    pk_client_install_signature_async (PkClient *client,
                                       PkSigTypeEnum type,
                                       const gchar *key_id,
                                       const gchar *package_id,
                                       GCancellable *cancellable,
                                       PkProgressCallback progress_callback,
                                       gpointer progress_user_data,
                                       GAsyncReadyCallback callback_ready,
                                       gpointer user_data);

Install a software source signature of the newest and most correct version.

#### Parameters

client | a valid PkClient instance |
type | the signature type, e.g. `PK_SIGTYPE_ENUM_GPG` |
key_id | a key ID such as "0df23df" |
package_id | a signature_id structure such as "hal;0.0.1;i386;fedora" |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_update_packages_async ()

    void
    pk_client_update_packages_async (PkClient *client,
                                     PkBitfield transaction_flags,
                                     gchar **package_ids,
                                     GCancellable *cancellable,
                                     PkProgressCallback progress_callback,
                                     gpointer progress_user_data,
                                     GAsyncReadyCallback callback_ready,
                                     gpointer user_data);

Update specific packages to the newest available versions.

#### Parameters

client | a valid PkClient instance |
transaction_flags | a transaction type bitfield |
package_ids | a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.8.1

### pk_client_install_files_async ()

    void
    pk_client_install_files_async (PkClient *client,
                                   PkBitfield transaction_flags,
                                   gchar **files,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

Install a file locally, and get the deps from the repositories. This is useful for double clicking on a .rpm or .deb file.

#### Parameters

client | a valid PkClient instance |
transaction_flags | a transaction type bitfield |
files | a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm". | [array zero-terminated=1]
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.8.1

### pk_client_accept_eula_async ()

    void
    pk_client_accept_eula_async (PkClient *client,
                                 const gchar *eula_id,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

We may want to agree to a EULA dialog if one is presented.

#### Parameters

client | a valid PkClient instance |
eula_id | the `eula_id` we are agreeing to |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_repo_list_async ()

    void
    pk_client_get_repo_list_async (PkClient *client,
                                   PkBitfield filters,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

Get the list of repositories installed on the system.

#### Parameters

client | a valid PkClient instance |
filters | a `PkBitfield` such as `PK_FILTER_ENUM_DEVEL` or `PK_FILTER_ENUM_NONE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_repo_enable_async ()

    void
    pk_client_repo_enable_async (PkClient *client,
                                 const gchar *repo_id,
                                 gboolean enabled,
                                 GCancellable *cancellable,
                                 PkProgressCallback progress_callback,
                                 gpointer progress_user_data,
                                 GAsyncReadyCallback callback_ready,
                                 gpointer user_data);

Enable or disable the repository.

#### Parameters

client | a valid PkClient instance |
repo_id | a repo_id structure such as "livna-devel" |
enabled | if we should enable the repository |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_repo_set_data_async ()

    void
    pk_client_repo_set_data_async (PkClient *client,
                                   const gchar *repo_id,
                                   const gchar *parameter,
                                   const gchar *value,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

We may want to set a repository parameter. NOTE: this is free text, and is left to the backend to define a format.

#### Parameters

client | a valid PkClient instance |
repo_id | a repo_id structure such as "livna-devel" |
parameter | the parameter to change |
value | what we should change it to |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_upgrade_system_async ()

    void
    pk_client_upgrade_system_async (PkClient *client,
                                    const gchar *distro_id,
                                    PkUpgradeKindEnum upgrade_kind,
                                    GCancellable *cancellable,
                                    PkProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GAsyncReadyCallback callback_ready,
                                    gpointer user_data);

This transaction will update the distro to the next version, which may involve just downloading the installer and setting up the boot device, or may involve doing an on-line upgrade.

The backend will decide what is best to do.

#### Parameters

client | a valid PkClient instance |
distro_id | a distro ID such as "fedora-14" |
upgrade_kind | a PkUpgradeKindEnum such as `PK_UPGRADE_KIND_ENUM_COMPLETE` |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.6.11

### pk_client_repair_system_async ()

    void
    pk_client_repair_system_async (PkClient *client,
                                   PkBitfield transaction_flags,
                                   GCancellable *cancellable,
                                   PkProgressCallback progress_callback,
                                   gpointer progress_user_data,
                                   GAsyncReadyCallback callback_ready,
                                   gpointer user_data);

This transaction will try to recover from a broken package management system: e.g. the installation of a package with unsatisfied dependencies has been forced by the user using a low level tool (rpm or dpkg) or the system was shutdown during processing an installation.

The backend will decide what is best to do.

#### Parameters

client | a valid PkClient instance |
transaction_flags | a transaction type bitfield |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.8.1

### pk_client_adopt_async ()

    void
    pk_client_adopt_async (PkClient *client,
                           const gchar *transaction_id,
                           GCancellable *cancellable,
                           PkProgressCallback progress_callback,
                           gpointer progress_user_data,
                           GAsyncReadyCallback callback_ready,
                           gpointer user_data);

Adopt a transaction which allows the caller to monitor the state or cancel it.

#### Parameters

client | a valid PkClient instance |
transaction_id | a transaction ID such as "/21_ebcbdaae_data" |
cancellable | a GCancellable or `NULL` |
progress_callback | the function to run when the progress changes. | [scope call]
progress_user_data | data to pass to `progress_callback` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_get_progress_finish ()

    PkProgress *
    pk_client_get_progress_finish (PkClient *client,
                                   GAsyncResult *res,
                                   GError **error);

Gets the result from the asynchronous function.

#### Parameters

client | a valid PkClient instance |
res | the GAsyncResult |
error | A GError or `NULL` |

#### Returns

the PkProgress, or `NULL`. Free with `g_object_unref()`.

[transfer full]

Since 0.5.2

### pk_client_get_progress_async ()

    void
    pk_client_get_progress_async (PkClient *client,
                                  const gchar *transaction_id,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback_ready,
                                  gpointer user_data);

Find the current state of a transaction.

#### Parameters

client | a valid PkClient instance |
transaction_id | a transaction ID such as "/21_ebcbdaae_data" |
cancellable | a GCancellable or `NULL` |
callback_ready | the function to run on completion |
user_data | the data to pass to `callback_ready` |

Since 0.5.2

### pk_client_set_locale ()

    void
    pk_client_set_locale (PkClient *client,
                          const gchar *locale);

Sets the locale to be used for the client. This may affect returned results.

#### Parameters

client | a valid PkClient instance |
locale | the locale to set, e.g. "en_GB.UTF-8" |

Since 0.6.10

### pk_client_get_locale ()

    const gchar *
    pk_client_get_locale (PkClient *client);

Gets the locale used for this transaction.

#### Parameters

client | a valid PkClient instance |

#### Returns

The locale.

Since 0.6.10

### pk_client_set_background ()

    void
    pk_client_set_background (PkClient *client,
                              gboolean background);

Sets the background value for the client. A background transaction is usually scheduled at a lower priority and is usually given less network and disk performance.

#### Parameters

client | a valid PkClient instance |
background | if the transaction is a background transaction |

Since 0.6.10

### pk_client_get_background ()

    gboolean
    pk_client_get_background (PkClient *client);

Gets the background value.

#### Parameters

client | a valid PkClient instance |

#### Returns

The background status.

Since 0.6.10

### pk_client_set_interactive ()

    void
    pk_client_set_interactive (PkClient *client,
                               gboolean interactive);

Sets the interactive value for the client. Interactive transactions are usally allowed to ask the user questions.

#### Parameters

client | a valid PkClient instance |
interactive | the value to set |

Since 0.6.10

### pk_client_get_interactive ()

    gboolean
    pk_client_get_interactive (PkClient *client);

Gets the client interactive value.

#### Parameters

client | a valid PkClient instance |

#### Returns

if the transaction is due to run interactivly.

Since 0.6.10

### pk_client_get_idle ()

    gboolean
    pk_client_get_idle (PkClient *client);

Gets if the transaction client idle value.

#### Parameters

client | a valid PkClient instance |

#### Returns

if this client is idle.

Since 0.6.10

### pk_client_set_cache_age ()

    void
    pk_client_set_cache_age (PkClient *client,
                             guint cache_age);

Sets the maximum cache age value for the client.

#### Parameters

client | a valid PkClient instance |
cache_age | the cache age to set |

Since 0.6.10

### pk_client_get_cache_age ()

    guint
    pk_client_get_cache_age (PkClient *client);

Gets the maximum cache age value.

#### Parameters

client | a valid PkClient instance |

#### Returns

The cache age in seconds

Since 0.6.10

## Types and Values

### PK_CLIENT_ERROR

    #define PK_CLIENT_ERROR		(pk_client_error_quark ())

### PK_CLIENT_TYPE_ERROR

    #define PK_CLIENT_TYPE_ERROR (pk_client_error_get_type ())

### enum PkClientError

Errors that can be thrown

#### Members

PK_CLIENT_ERROR_FAILED | the transaction failed for an unknown reason |
PK_CLIENT_ERROR_FAILED_AUTH |  |
PK_CLIENT_ERROR_NO_TID | the transaction id was not pre-allocated (internal error) |
PK_CLIENT_ERROR_ALREADY_TID | the transaction id has already been used (internal error) |
PK_CLIENT_ERROR_ROLE_UNKNOWN | the role was not set (internal error) |
PK_CLIENT_ERROR_CANNOT_START_DAEMON |  |
PK_CLIENT_ERROR_INVALID_INPUT | the package_id is invalid |
PK_CLIENT_ERROR_INVALID_FILE | the file is invalid |
PK_CLIENT_ERROR_NOT_SUPPORTED | the action is not supported |
PK_CLIENT_ERROR_DECLINED_SIMULATION | the simulation was declined by the user |
PK_CLIENT_ERROR_LAST |  |

### struct PkClient

    struct PkClient;

### struct PkClientClass

    struct PkClientClass {
    	GObjectClass parent_class;

    	/* signals */
    	void		(* changed)			(PkClient *client);
    	/* padding for future expansion */
    	void (*_pk_reserved1) (void);
    	void (*_pk_reserved2) (void);
    	void (*_pk_reserved3) (void);
    	void (*_pk_reserved4) (void);
    	void (*_pk_reserved5) (void);
    };

## Property Details

### The `“background”` property

      “background”               gboolean

Flags: Read / Write

Default value: FALSE

Since 0.5.3

### The `“cache-age”` property

      “cache-age”                guint

Flags: Read / Write

Default value: 0

Since 0.6.10

### The `“idle”` property

      “idle”                     gboolean

if there are no transactions in progress on this client.

Flags: Read

Default value: TRUE

Since 0.5.4

### The `“interactive”` property

      “interactive”              gboolean

Flags: Read / Write

Default value: TRUE

Since 0.5.4

### The `“locale”` property

      “locale”                   gchar *

Flags: Read / Write

Default value: NULL

Since 0.5.3