![]() |
![]() |
![]() |
[Insert name here] Reference Manual | ![]() |
---|---|---|---|---|
#define PK_CLIENT_PERCENTAGE_INVALID typedef PkClientPrivate; PkClient* pk_client_new (void); gboolean pk_client_set_tid (PkClient *client, const gchar *tid); gboolean pk_client_set_promiscuous (PkClient *client, gboolean enabled); gchar* pk_client_get_tid (PkClient *client); gboolean pk_client_set_use_buffer (PkClient *client, gboolean use_buffer); gboolean pk_client_get_use_buffer (PkClient *client); gboolean pk_client_get_status (PkClient *client, PkStatusEnum *status); gboolean pk_client_get_role (PkClient *client, PkRoleEnum *role, gchar **package_id); gboolean pk_client_get_progress (PkClient *client, guint *percentage, guint *subpercentage, guint *elapsed, guint *remaining); gboolean pk_client_get_package (PkClient *client, gchar **package_id); gboolean pk_client_cancel (PkClient *client); gboolean pk_client_get_updates (PkClient *client); gboolean pk_client_update_system (PkClient *client); gboolean pk_client_search_name (PkClient *client, const gchar *filter, const gchar *search); gboolean pk_client_search_details (PkClient *client, const gchar *filter, const gchar *search); gboolean pk_client_search_group (PkClient *client, const gchar *filter, const gchar *search); gboolean pk_client_search_file (PkClient *client, const gchar *filter, const gchar *search); gboolean pk_client_get_depends (PkClient *client, const gchar *package_id, gboolean recursive); gboolean pk_client_get_update_detail (PkClient *client, const gchar *package_id); gboolean pk_client_get_requires (PkClient *client, const gchar *package_id, gboolean recursive); gboolean pk_client_get_description (PkClient *client, const gchar *package_id); gboolean pk_client_get_files (PkClient *client, const gchar *package_id); gboolean pk_client_remove_package (PkClient *client, const gchar *package, gboolean allow_deps); gboolean pk_client_refresh_cache (PkClient *client, gboolean force); gboolean pk_client_install_package (PkClient *client, const gchar *package_id); gboolean pk_client_update_package (PkClient *client, const gchar *package_id); gboolean pk_client_install_file (PkClient *client, const gchar *full_path); gboolean pk_client_resolve (PkClient *client, const gchar *filter, const gchar *package); gboolean pk_client_rollback (PkClient *client, const gchar *transaction_id); gboolean pk_client_requeue (PkClient *client); gboolean pk_client_get_repo_list (PkClient *client); gboolean pk_client_repo_enable (PkClient *client, const gchar *repo_id, gboolean enabled); gboolean pk_client_repo_set_data (PkClient *client, const gchar *repo_id, const gchar *parameter, const gchar *value); guint pk_client_package_buffer_get_size (PkClient *client); PkPackageItem* pk_client_package_buffer_get_item (PkClient *client, guint item); PkRestartEnum pk_client_get_require_restart (PkClient *client); PkEnumList* pk_client_get_actions (PkClient *client); PkEnumList* pk_client_get_filters (PkClient *client); PkEnumList* pk_client_get_groups (PkClient *client); gboolean pk_client_reset (PkClient *client); gboolean pk_client_get_old_transactions (PkClient *client, guint number); gboolean pk_client_get_backend_detail (PkClient *client, gchar **name, gchar **author); gboolean pk_client_get_time_since_action (PkClient *client, PkRoleEnum role, guint *seconds); gboolean pk_client_is_caller_active (PkClient *client, gboolean *is_active);
gboolean pk_client_set_tid (PkClient *client, const gchar *tid);
This method sets the transaction ID that should be used for the DBUS method and then watched for any callback signals. You cannot call pk_client_set_tid multiple times for one instance.
|
a valid PkClient instance |
|
a transaction id |
Returns : |
TRUE if set correctly
|
gboolean pk_client_set_promiscuous (PkClient *client, gboolean enabled);
If we set the client promiscuous then it listens to all signals from all transactions. You can't set promiscuous mode on an already set tid instance.
|
a valid PkClient instance |
|
if we should set promiscuous mode on |
Returns : |
TRUE if we set the mode okay.
|
gchar* pk_client_get_tid (PkClient *client);
|
a valid PkClient instance |
Returns : |
The transaction_id we are using for this client, or NULL
|
gboolean pk_client_set_use_buffer (PkClient *client, gboolean use_buffer);
If the package buffer is enabled then after the transaction has completed then the package list can be retrieved in one go, rather than processing each package request async. If this is not set true explicitly, then pk_client_package_buffer_get_size will always return zero items.
This is not forced on as there may be significant overhead if the list contains many hundreds of items.
|
a valid PkClient instance |
|
if we should use the package buffer |
Returns : |
TRUE if the package buffer was enabled
|
gboolean pk_client_get_use_buffer (PkClient *client);
|
a valid PkClient instance |
Returns : |
TRUE if the package buffer is enabled
|
gboolean pk_client_get_status (PkClient *client, PkStatusEnum *status);
|
|
|
|
Returns : |
gboolean pk_client_get_role (PkClient *client, PkRoleEnum *role, gchar **package_id);
|
|
|
|
|
|
Returns : |
gboolean pk_client_get_progress (PkClient *client, guint *percentage, guint *subpercentage, guint *elapsed, guint *remaining);
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean pk_client_get_package (PkClient *client, gchar **package_id);
|
|
|
|
Returns : |
gboolean pk_client_search_name (PkClient *client, const gchar *filter, const gchar *search);
|
|
|
|
|
|
Returns : |
gboolean pk_client_search_details (PkClient *client, const gchar *filter, const gchar *search);
|
|
|
|
|
|
Returns : |
gboolean pk_client_search_group (PkClient *client, const gchar *filter, const gchar *search);
|
|
|
|
|
|
Returns : |
gboolean pk_client_search_file (PkClient *client, const gchar *filter, const gchar *search);
|
|
|
|
|
|
Returns : |
gboolean pk_client_get_depends (PkClient *client, const gchar *package_id, gboolean recursive);
|
|
|
|
|
|
Returns : |
gboolean pk_client_get_update_detail (PkClient *client, const gchar *package_id);
|
|
|
|
Returns : |
gboolean pk_client_get_requires (PkClient *client, const gchar *package_id, gboolean recursive);
|
|
|
|
|
|
Returns : |
gboolean pk_client_get_description (PkClient *client, const gchar *package_id);
|
|
|
|
Returns : |
gboolean pk_client_get_files (PkClient *client, const gchar *package_id);
|
|
|
|
Returns : |
gboolean pk_client_remove_package (PkClient *client, const gchar *package, gboolean allow_deps);
|
|
|
|
|
|
Returns : |
gboolean pk_client_refresh_cache (PkClient *client, gboolean force);
|
|
|
|
Returns : |
gboolean pk_client_install_package (PkClient *client, const gchar *package_id);
|
|
|
|
Returns : |
gboolean pk_client_update_package (PkClient *client, const gchar *package_id);
|
|
|
|
Returns : |
gboolean pk_client_install_file (PkClient *client, const gchar *full_path);
|
|
|
|
Returns : |
gboolean pk_client_resolve (PkClient *client, const gchar *filter, const gchar *package);
|
|
|
|
|
|
Returns : |
gboolean pk_client_rollback (PkClient *client, const gchar *transaction_id);
|
|
|
|
Returns : |
gboolean pk_client_requeue (PkClient *client);
We might need to requeue if we want to take an existing PkClient instance and re-run it after completion. Doing this allows us to do things like re-searching when the output list may have changed state.
|
a valid PkClient instance |
Returns : |
TRUE if we could requeue the client
|
gboolean pk_client_repo_enable (PkClient *client, const gchar *repo_id, gboolean enabled);
|
|
|
|
|
|
Returns : |
gboolean pk_client_repo_set_data (PkClient *client, const gchar *repo_id, const gchar *parameter, const gchar *value);
|
|
|
|
|
|
|
|
Returns : |
guint pk_client_package_buffer_get_size (PkClient *client);
|
a valid PkClient instance |
Returns : |
The size of the package buffer. |
PkPackageItem* pk_client_package_buffer_get_item (PkClient *client, guint item);
|
a valid PkClient instance |
|
the item in the package buffer |
Returns : |
The PkPackageItem or NULL if not found or invalid
|
PkRestartEnum pk_client_get_require_restart (PkClient *client);
This method returns the 'worst' restart of all the transactions. It is needed as multiple sub-transactions may emit require-restart with different values, and we always want to get the most invasive of all.
For instance, if a transaction emits RequireRestart(system) and then RequireRestart(session) then pk_client_get_require_restart will return system as a session restart is implied with a system restart.
|
a valid PkClient instance |
Returns : |
a PkRestartEnum value, e.g. PK_RESTART_ENUM_SYSTEM |
gboolean pk_client_reset (PkClient *client);
Resetting the client way be needed if we canceled the request without waiting for ::finished, or if we want to reuse the PkClient without unreffing and creating it again.
|
a valid PkClient instance |
Returns : |
TRUE if we reset the client
|
gboolean pk_client_get_old_transactions (PkClient *client, guint number);
|
|
|
|
Returns : |
gboolean pk_client_get_backend_detail (PkClient *client, gchar **name, gchar **author);
|
|
|
|
|
|
Returns : |
gboolean pk_client_get_time_since_action (PkClient *client, PkRoleEnum role, guint *seconds);
|
|
|
|
|
|
Returns : |