![]() |
![]() |
![]() |
PackageKit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#define PK_CONTROL_ERROR #define PK_CONTROL_TYPE_ERROR PkControlPrivate; enum PkControlError; PkControl; GQuark pk_control_error_quark (void); PkControl * pk_control_new (void); gboolean pk_control_allocate_transaction_id (PkControl *control, gchar **tid, GError **error); gboolean pk_control_set_proxy (PkControl *control, const gchar *proxy_http, const gchar *proxy_ftp, GError **error); PkBitfield pk_control_get_actions (PkControl *control, GError **error); PkBitfield pk_control_get_filters (PkControl *control, GError **error); PkBitfield pk_control_get_groups (PkControl *control, GError **error); gchar ** pk_control_get_mime_types (PkControl *control, GError **error); gchar * pk_control_get_daemon_state (PkControl *control, GError **error); PkNetworkEnum pk_control_get_network_state (PkControl *control, GError **error); gboolean pk_control_get_backend_detail (PkControl *control, gchar **name, gchar **author, GError **error); gboolean pk_control_get_time_since_action (PkControl *control, PkRoleEnum role, guint *seconds, GError **error); gboolean pk_control_transaction_list_print (PkControl *control); const gchar ** pk_control_transaction_list_get (PkControl *control);
"version-major" guint : Read / Write "version-micro" guint : Read / Write "version-minor" guint : Read / Write
"locked" : Run Last "network-state-changed" : Run Last "repo-list-changed" : Run Last "restart-schedule" : Run Last "transaction-list-changed" : Run Last "updates-changed" : Run Last
typedef enum { PK_CONTROL_ERROR_FAILED, PK_CONTROL_ERROR_CANNOT_START_DAEMON } PkControlError;
Errors that can be thrown
GQuark pk_control_error_quark (void);
We are a clever GObject that sets errors
Returns : |
Our personal error quark. |
gboolean pk_control_allocate_transaction_id (PkControl *control, gchar **tid, GError **error);
We have to create a transaction ID then use it, as a one-step constructor is inherently racey.
|
a valid PkControl instance |
|
|
|
a GError to put the error code and message in, or NULL
|
Returns : |
TRUE if we allocated a TID.
|
gboolean pk_control_set_proxy (PkControl *control, const gchar *proxy_http, const gchar *proxy_ftp, GError **error);
Set a proxy on the PK daemon
|
a valid PkControl instance |
|
a HTTP proxy string such as "username:passwordserver.lan :8080"
|
|
a FTP proxy string such as "server.lan:8080" |
|
a GError to put the error code and message in, or NULL
|
Returns : |
if we set the proxy successfully |
PkBitfield pk_control_get_actions (PkControl *control, GError **error);
Actions are roles that the daemon can do with the current backend
|
a valid PkControl instance |
|
a GError to put the error code and message in, or NULL
|
Returns : |
an enumerated list of the actions the backend supports |
PkBitfield pk_control_get_filters (PkControl *control, GError **error);
Filters are how the backend can specify what type of package is returned.
|
a valid PkControl instance |
|
a GError to put the error code and message in, or NULL
|
Returns : |
an enumerated list of the filters the backend supports |
PkBitfield pk_control_get_groups (PkControl *control, GError **error);
The group list is enumerated so it can be localised and have deep integration with desktops. This method allows a frontend to only display the groups that are supported.
|
a valid PkControl instance |
|
a GError to put the error code and message in, or NULL
|
Returns : |
an enumerated list of the groups the backend supports |
gchar ** pk_control_get_mime_types (PkControl *control, GError **error);
The MIME list is the supported package formats.
|
a valid PkControl instance |
|
a GError to put the error code and message in, or NULL
|
Returns : |
an strv list of the formats the backend supports,
or NULL if unknown
|
gchar * pk_control_get_daemon_state (PkControl *control, GError **error);
The engine state debugging output
|
a valid PkControl instance |
|
a GError to put the error code and message in, or NULL
|
Returns : |
a string of debugging data of unspecified format |
PkNetworkEnum pk_control_get_network_state (PkControl *control, GError **error);
|
a valid PkControl instance |
|
a GError to put the error code and message in, or NULL
|
Returns : |
an enumerated network state |
gboolean pk_control_get_backend_detail (PkControl *control, gchar **name, gchar **author, GError **error);
The backend detail is useful for the pk-backend-status program, or for automatic bugreports.
|
a valid PkControl instance |
|
the name of the backend |
|
the author of the backend |
|
a GError to put the error code and message in, or NULL
|
Returns : |
TRUE if the daemon serviced the request
|
gboolean pk_control_get_time_since_action (PkControl *control, PkRoleEnum role, guint *seconds, GError **error);
We may want to know how long it has been since we refreshed the cache or retrieved the update list.
|
a valid PkControl instance |
|
the role we are querying |
|
the number of seconds since the request was completed |
|
a GError to put the error code and message in, or NULL
|
Returns : |
TRUE if the daemon serviced the request
|
gboolean pk_control_transaction_list_print (PkControl *control);
|
|
Returns : |
const gchar ** pk_control_transaction_list_get (PkControl *control);
|
|
Returns : |
"locked"
signalvoid user_function (PkControl *control, gboolean arg1, gpointer user_data) : Run Last
The ::locked signal is emitted when the backend instance has been locked by PackageKit. This may mean that other native package tools will not work.
|
the PkControl instance that emitted the signal |
|
user data set when the signal handler was connected. |
"network-state-changed"
signalvoid user_function (PkControl *control, guint arg1, gpointer user_data) : Run Last
The ::network-state-changed signal is emitted when the network has changed speed or connections state.
|
the PkControl instance that emitted the signal |
|
user data set when the signal handler was connected. |
"repo-list-changed"
signalvoid user_function (PkControl *control, gpointer user_data) : Run Last
The ::repo-list-changed signal is emitted when the repo list may have changed and the control program may have to update some UI.
|
the PkControl instance that emitted the signal |
|
user data set when the signal handler was connected. |
"restart-schedule"
signalvoid user_function (PkControl *control, gpointer user_data) : Run Last
The ::restart_schedule signal is emitted when the packagekitd service has been restarted because it has been upgraded. Client programs should reload themselves when it is convenient to do so, as old client tools may not be compatable with the new daemon.
|
the PkControl instance that emitted the signal |
|
user data set when the signal handler was connected. |
"transaction-list-changed"
signalvoid user_function (PkControl *control, gpointer user_data) : Run Last
The ::transaction-list-changed signal is emitted when the list of transactions handled by the daemon is changed.
|
the PkControl instance that emitted the signal |
|
user data set when the signal handler was connected. |
"updates-changed"
signalvoid user_function (PkControl *control, gpointer user_data) : Run Last
The ::updates-changed signal is emitted when the update list may have changed and the control program may have to update some UI.
|
the PkControl instance that emitted the signal |
|
user data set when the signal handler was connected. |