![]() |
![]() |
![]() |
PackageKit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define PK_PACKAGE_SACK_TYPE_ERROR struct PkPackageSack; struct PkPackageSackClass;gboolean (*PkPackageSackFilterFunc) (PkPackage *package
,); PkPackageSackResults; enum PkPackageSackSortType;
gpointer user_datagboolean pk_package_sack_add_package (PkPackageSack *sack
,PkPackage *package
);gboolean pk_package_sack_add_package_by_id (PkPackageSack *sack
,const
,gchar *package_id);
GError **errorvoid pk_package_sack_clear (PkPackageSack *sack
); PkPackageSack * pk_package_sack_filter (PkPackageSack *sack
,PkPackageSackFilterFunc filter_cb
,); PkPackageSack * pk_package_sack_filter_by_info (
gpointer user_dataPkPackageSack *sack
,PkInfoEnum info
); PkPackage * pk_package_sack_find_by_id (PkPackageSack *sack
,const
);gchar *package_idGPtrArray * pk_package_sack_get_array (PkPackageSack *sack
);void pk_package_sack_get_details_async (PkPackageSack *sack
,,
GCancellable *cancellablePkProgressCallback progress_callback
,,
gpointer progress_user_data,
GAsyncReadyCallback callback);
gpointer user_datagchar ** pk_package_sack_get_ids (PkPackageSack *sack
);guint pk_package_sack_get_size (PkPackageSack *sack
);guint64 pk_package_sack_get_total_bytes (PkPackageSack *sack
);void pk_package_sack_get_update_detail_async (PkPackageSack *sack
,,
GCancellable *cancellablePkProgressCallback progress_callback
,,
gpointer progress_user_data,
GAsyncReadyCallback callback);
gpointer user_datagboolean pk_package_sack_merge_generic_finish (PkPackageSack *sack
,,
GAsyncResult *res); PkPackageSack * pk_package_sack_new (
GError **errorvoid
);gboolean pk_package_sack_remove_by_filter (PkPackageSack *sack
,PkPackageSackFilterFunc filter_cb
,);
gpointer user_datagboolean pk_package_sack_remove_package (PkPackageSack *sack
,PkPackage *package
);gboolean pk_package_sack_remove_package_by_id (PkPackageSack *sack
,const
);gchar *package_idvoid pk_package_sack_resolve_async (PkPackageSack *sack
,,
GCancellable *cancellablePkProgressCallback progress_callback
,,
gpointer progress_user_data,
GAsyncReadyCallback callback);
gpointer user_datavoid pk_package_sack_sort (PkPackageSack *sack
,PkPackageSackSortType type
);void pk_package_sack_test ();
gpointer user_data
A package sack is a set of packages that can have operations done on them in parallel. This might be adding summary text for bare package ID's, or to add package or update details.
struct PkPackageSackClass { GObjectClass parent_class; /* signals */ void (* changed) (PkPackageSack *sack); /* padding for future expansion */ void (*_pk_reserved1) (void); void (*_pk_reserved2) (void); void (*_pk_reserved3) (void); void (*_pk_reserved4) (void); void (*_pk_reserved5) (void); };
gboolean (*PkPackageSackFilterFunc) (PkPackage *package
,);
gpointer user_data
typedef enum { PK_PACKAGE_SACK_SORT_TYPE_NAME, PK_PACKAGE_SACK_SORT_TYPE_INFO, PK_PACKAGE_SACK_SORT_TYPE_PACKAGE_ID, PK_PACKAGE_SACK_SORT_TYPE_SUMMARY, PK_PACKAGE_SACK_SORT_TYPE_LAST } PkPackageSackSortType;
gboolean pk_package_sack_add_package (PkPackageSack *sack
,PkPackage *package
);
Adds a package to the sack.
|
a valid PkPackageSack instance |
|
a valid PkPackage instance |
Returns : |
TRUE |
Since 0.5.2
gboolean pk_package_sack_add_package_by_id (PkPackageSack *sack
,const
,gchar *package_id);
GError **error
Adds a package reference to the sack.
|
a valid PkPackageSack instance |
|
a package_id descriptor |
|
a GError NULL |
Returns : |
TRUE |
Since 0.5.2
void pk_package_sack_clear (PkPackageSack *sack
);
Empty all the packages from the sack
|
a valid PkPackageSack instance |
Since 0.5.2
PkPackageSack * pk_package_sack_filter (PkPackageSack *sack
,PkPackageSackFilterFunc filter_cb
,);
gpointer user_data
Returns a new package sack which only matches packages that return TRUE
|
a valid PkPackageSack instance |
|
a PkPackageSackFilterFunc, which returns TRUE |
|
user data to pass to filter_cb
|
Returns : |
a new PkPackageSack, free with g_object_unref() |
Since 0.6.3
PkPackageSack * pk_package_sack_filter_by_info (PkPackageSack *sack
,PkInfoEnum info
);
Returns a new package sack which only matches packages that match the specified info enum value.
|
a valid PkPackageSack instance |
|
a PkInfoEnum value to match |
Returns : |
a new PkPackageSack, free with g_object_unref() |
Since 0.6.2
PkPackage * pk_package_sack_find_by_id (PkPackageSack *sack
,const
);gchar *package_id
Finds a package in a sack from reference. As soon as one package is found the search is stopped.
|
a valid PkPackageSack instance |
|
a package_id descriptor |
Returns : |
the PkPackage object, or NULL g_object_unref() |
Since 0.5.2
GPtrArray * pk_package_sack_get_array (PkPackageSack *sack
);
Gets the package array from the sack
|
a valid PkPackageSack instance |
Returns : |
a g_ptr_array_unref() |
Since 0.6.1
void pk_package_sack_get_details_async (PkPackageSack *sack
,,
GCancellable *cancellablePkProgressCallback progress_callback
,,
gpointer progress_user_data,
GAsyncReadyCallback callback);
gpointer user_data
Merges in details about packages.
|
a valid PkPackageSack instance |
|
a NULL |
|
the function to run when the progress changes. [scope call] |
|
data to pass to progress_callback
|
|
the function to run on completion |
|
the data to pass to callback
|
gchar ** pk_package_sack_get_ids (PkPackageSack *sack
);
Returns all the Package IDs in the sack
|
a valid PkPackageSack instance |
Returns : |
the number of packages in the sack, free with g_strfreev() |
Since 0.5.3
guint pk_package_sack_get_size (PkPackageSack *sack
);
Gets the number of packages in the sack
|
a valid PkPackageSack instance |
Returns : |
the number of packages in the sack |
Since 0.5.2
guint64 pk_package_sack_get_total_bytes (PkPackageSack *sack
);
Gets the total size of the package sack in bytes.
|
a valid PkPackageSack instance |
Returns : |
the size in bytes |
Since 0.5.2
void pk_package_sack_get_update_detail_async (PkPackageSack *sack
,,
GCancellable *cancellablePkProgressCallback progress_callback
,,
gpointer progress_user_data,
GAsyncReadyCallback callback);
gpointer user_data
Merges in update details about packages.
|
a valid PkPackageSack instance |
|
a NULL |
|
the function to run when the progress changes. [scope call] |
|
data to pass to progress_callback
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 0.5.2
gboolean pk_package_sack_merge_generic_finish (PkPackageSack *sack
,,
GAsyncResult *res);
GError **error
Gets the result from the asynchronous function.
|
a valid PkPackageSack instance |
|
the |
|
A NULL |
Returns : |
TRUE |
Since 0.5.2
PkPackageSack * pk_package_sack_new (void
);
Returns : |
a new PkPackageSack object. |
Since 0.5.2
gboolean pk_package_sack_remove_by_filter (PkPackageSack *sack
,PkPackageSackFilterFunc filter_cb
,);
gpointer user_data
Removes from the package sack any packages that return FALSE
|
a valid PkPackageSack instance |
|
a PkPackageSackFilterFunc, which returns TRUE |
|
user data to pass to filter_cb
|
Returns : |
TRUE |
Since 0.6.3
gboolean pk_package_sack_remove_package (PkPackageSack *sack
,PkPackage *package
);
Removes a package reference from the sack. The pointers have to match exactly.
|
a valid PkPackageSack instance |
|
a valid PkPackage instance |
Returns : |
TRUE |
Since 0.5.2
gboolean pk_package_sack_remove_package_by_id (PkPackageSack *sack
,const
);gchar *package_id
Removes a package reference from the sack. As soon as one package is removed the search is stopped.
|
a valid PkPackageSack instance |
|
a package_id descriptor |
Returns : |
TRUE |
Since 0.5.2
void pk_package_sack_resolve_async (PkPackageSack *sack
,,
GCancellable *cancellablePkProgressCallback progress_callback
,,
gpointer progress_user_data,
GAsyncReadyCallback callback);
gpointer user_data
Merges in details about packages using resolve.
|
a valid PkPackageSack instance |
|
a NULL |
|
the function to run when the progress changes. [scope call] |
|
data to pass to progress_callback
|
|
the function to run on completion |
|
the data to pass to callback
|
Since 0.5.2
void pk_package_sack_sort (PkPackageSack *sack
,PkPackageSackSortType type
);