gs-plugin-helpers: GNOME Software Reference Manual

## gs-plugin-helpers gs-plugin-helpers — Helpers for storing call closures for GsPlugin vfuncs |

## Functions

GsPluginRefineData * | gs_plugin_refine_data_new ()
GTask * | gs_plugin_refine_data_new_task ()
void | gs_plugin_refine_data_free ()
GsPluginRefreshMetadataData * | gs_plugin_refresh_metadata_data_new ()
void | gs_plugin_refresh_metadata_data_free ()
GsPluginListAppsData * | gs_plugin_list_apps_data_new ()
GTask * | gs_plugin_list_apps_data_new_task ()
void | gs_plugin_list_apps_data_free ()
GsPluginManageRepositoryData * | gs_plugin_manage_repository_data_new ()
GTask * | gs_plugin_manage_repository_data_new_task ()
void | gs_plugin_manage_repository_data_free ()
GsPluginRefineCategoriesData * | gs_plugin_refine_categories_data_new ()
GTask * | gs_plugin_refine_categories_data_new_task ()
void | gs_plugin_refine_categories_data_free ()
GsPluginInstallAppsData * | gs_plugin_install_apps_data_new ()
GTask * | gs_plugin_install_apps_data_new_task ()
void | gs_plugin_install_apps_data_free ()
GsPluginUninstallAppsData * | gs_plugin_uninstall_apps_data_new ()
GTask * | gs_plugin_uninstall_apps_data_new_task ()
void | gs_plugin_uninstall_apps_data_free ()
GsPluginUpdateAppsData * | gs_plugin_update_apps_data_new ()
GTask * | gs_plugin_update_apps_data_new_task ()
void | gs_plugin_update_apps_data_free ()
GsPluginCancelOfflineUpdateData * | gs_plugin_cancel_offline_update_data_new ()
GTask * | gs_plugin_cancel_offline_update_data_new_task ()
void | gs_plugin_cancel_offline_update_data_free ()
GsPluginDownloadUpgradeData * | gs_plugin_download_upgrade_data_new ()
GTask * | gs_plugin_download_upgrade_data_new_task ()
void | gs_plugin_download_upgrade_data_free ()
GsPluginTriggerUpgradeData * | gs_plugin_trigger_upgrade_data_new ()
GTask * | gs_plugin_trigger_upgrade_data_new_task ()
void | gs_plugin_trigger_upgrade_data_free ()
GsPluginLaunchData * | gs_plugin_launch_data_new ()
GTask * | gs_plugin_launch_data_new_task ()
void | gs_plugin_launch_data_free ()
GsPluginFileToAppData * | gs_plugin_file_to_app_data_new ()
GTask * | gs_plugin_file_to_app_data_new_task ()
void | gs_plugin_file_to_app_data_free ()
GsPluginUrlToAppData * | gs_plugin_url_to_app_data_new ()
GTask * | gs_plugin_url_to_app_data_new_task ()
void | gs_plugin_url_to_app_data_free ()
GsPluginGetOfflineUpdateStateData * | gs_plugin_get_offline_update_state_data_new ()
GTask * | gs_plugin_get_offline_update_state_data_new_task ()
void | gs_plugin_get_offline_update_state_data_free ()
GsPluginSetOfflineUpdateActionData * | gs_plugin_set_offline_update_action_data_new ()
GTask * | gs_plugin_set_offline_update_action_data_new_task ()
void | gs_plugin_set_offline_update_action_data_free ()

## Types and Values

| GsPluginRefineData
| GsPluginRefreshMetadataData
| GsPluginListAppsData
| GsPluginManageRepositoryData
| GsPluginRefineCategoriesData
| GsPluginInstallAppsData
| GsPluginUninstallAppsData
| GsPluginUpdateAppsData
| GsPluginCancelOfflineUpdateData
| GsPluginDownloadUpgradeData
| GsPluginTriggerUpgradeData
| GsPluginLaunchData
| GsPluginFileToAppData
| GsPluginUrlToAppData
| GsPluginGetOfflineUpdateStateData
| GsPluginSetOfflineUpdateActionData

## Description

The helpers in this file each create a context structure to store the arguments passed to a standard GsPlugin vfunc.

These are intended to be used by plugin implementations to easily create GTasks for handling GsPlugin vfunc calls, without all having to write the same code to create a structure to wrap the vfunc arguments.

## Functions

### gs_plugin_refine_data_new ()

    GsPluginRefineData *
    gs_plugin_refine_data_new (GsAppList *list,
                               GsPluginRefineFlags job_flags,
                               GsPluginRefineRequireFlags require_flags,
                               GsPluginEventCallback event_callback,
                               void *event_user_data);

Context data for a call to GsPluginClass.refine_async.

#### Parameters

list | list of GsApps to refine |
job_flags | job flags |
require_flags | require flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_refine_data_new_task ()

    GTask *
    gs_plugin_refine_data_new_task (gpointer source_object,
                                    GsAppList *list,
                                    GsPluginRefineFlags job_flags,
                                    GsPluginRefineRequireFlags refine_flags,
                                    GsPluginEventCallback event_callback,
                                    void *event_user_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for a refine operation with the given arguments. The task data will be set to a GsPluginRefineData containing the given context.

This is essentially a combination of `gs_plugin_refine_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
list | list of GsApps to refine |
job_flags | job flags |
require_flags | require flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_refine_data_free ()

    void
    gs_plugin_refine_data_free (GsPluginRefineData *data);

Free the given `data` .

#### Parameters

data | a GsPluginRefineData. | [transfer full]

Since: 42

### gs_plugin_refresh_metadata_data_new ()

    GsPluginRefreshMetadataData *
    gs_plugin_refresh_metadata_data_new (guint64 cache_age_secs,
                                         GsPluginRefreshMetadataFlags flags,
                                         GsPluginEventCallback event_callback,
                                         void *event_user_data);

Context data for a call to GsPluginClass.refresh_metadata_async.

#### Parameters

cache_age_secs | maximum allowed age of the cache in order for it to remain valid, in seconds |
flags | refresh metadata flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_refresh_metadata_data_free ()

    void
    gs_plugin_refresh_metadata_data_free (GsPluginRefreshMetadataData *data);

Free the given `data` .

#### Parameters

data | a GsPluginRefreshMetadataData. | [transfer full]

Since: 42

### gs_plugin_list_apps_data_new ()

    GsPluginListAppsData *
    gs_plugin_list_apps_data_new (GsAppQuery *query,
                                  GsPluginListAppsFlags flags,
                                  GsPluginEventCallback event_callback,
                                  void *event_user_data);

Context data for a call to GsPluginClass.list_apps_async.

#### Parameters

query | a query to filter apps, or `NULL` for no filtering. | [nullable][transfer none]
flags | list apps flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_list_apps_data_new_task ()

    GTask *
    gs_plugin_list_apps_data_new_task (gpointer source_object,
                                       GsAppQuery *query,
                                       GsPluginListAppsFlags flags,
                                       GsPluginEventCallback event_callback,
                                       void *event_user_data,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Create a GTask for a list apps operation with the given arguments. The task data will be set to a GsPluginListAppsData containing the given context.

This is essentially a combination of `gs_plugin_list_apps_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
query | a query to filter apps, or `NULL` for no filtering. | [nullable][transfer none]
flags | list apps flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_list_apps_data_free ()

    void
    gs_plugin_list_apps_data_free (GsPluginListAppsData *data);

Free the given `data` .

#### Parameters

data | a GsPluginListAppsData. | [transfer full]

Since: 43

### gs_plugin_manage_repository_data_new ()

    GsPluginManageRepositoryData *
    gs_plugin_manage_repository_data_new (GsApp *repository,
                                          GsPluginManageRepositoryFlags flags,
                                          GsPluginEventCallback event_callback,
                                          void *event_user_data);

Common context data for a call to GsPluginClass.install_repository_async, GsPluginClass.remove_repository_async, GsPluginClass.enable_repository_async and GsPluginClass.disable_repository_async.

#### Parameters

repository | a repository to manage. | [not nullable][transfer none]
flags | manage repository flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_manage_repository_data_new_task ()

    GTask *
    gs_plugin_manage_repository_data_new_task
                                   (gpointer source_object,
                                    GsApp *repository,
                                    GsPluginManageRepositoryFlags flags,
                                    GsPluginEventCallback event_callback,
                                    void *event_user_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for a manage repository operation with the given arguments. The task data will be set to a GsPluginManageRepositoryData containing the given context.

This is essentially a combination of `gs_plugin_manage_repository_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
repository | a repository to manage. | [not nullable][transfer none]
flags | manage repository flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_manage_repository_data_free ()

    void
    gs_plugin_manage_repository_data_free (GsPluginManageRepositoryData *data);

Free the given `data` .

#### Parameters

data | a GsPluginManageRepositoryData. | [transfer full]

Since: 43

### gs_plugin_refine_categories_data_new ()

    GsPluginRefineCategoriesData *
    gs_plugin_refine_categories_data_new (GPtrArray *list,
                                          GsPluginRefineCategoriesFlags flags,
                                          GsPluginEventCallback event_callback,
                                          void *event_user_data);

Context data for a call to GsPluginClass.refine_categories_async.

#### Parameters

list | list of GsCategory objects to refine. | [element-type GsCategory]
flags | refine flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_refine_categories_data_new_task ()

    GTask *
    gs_plugin_refine_categories_data_new_task
                                   (gpointer source_object,
                                    GPtrArray *list,
                                    GsPluginRefineCategoriesFlags flags,
                                    GsPluginEventCallback event_callback,
                                    void *event_user_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for a refine categories operation with the given arguments. The task data will be set to a GsPluginRefineCategoriesData containing the given context.

This is essentially a combination of `gs_plugin_refine_categories_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
list | list of GsCategory objects to refine. | [element-type GsCategory]
flags | refine flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_refine_categories_data_free ()

    void
    gs_plugin_refine_categories_data_free (GsPluginRefineCategoriesData *data);

Free the given `data` .

#### Parameters

data | a GsPluginRefineCategoriesData. | [transfer full]

Since: 43

### gs_plugin_install_apps_data_new ()

    GsPluginInstallAppsData *
    gs_plugin_install_apps_data_new (GsAppList *apps,
                                     GsPluginInstallAppsFlags flags,
                                     GsPluginProgressCallback progress_callback,
                                     gpointer progress_user_data,
                                     GsPluginEventCallback event_callback,
                                     void *event_user_data,
                                     GsPluginAppNeedsUserActionCallback app_needs_user_action_callback,
                                     gpointer app_needs_user_action_data);

Context data for a call to GsPluginClass.install_apps_async.

#### Parameters

apps | list of apps to install |
flags | install flags |
progress_callback | function to call to notify of progress. | [nullable][closure progress_user_data]
progress_user_data | data to pass to `progress_callback` |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
app_needs_user_action_callback | function to call to ask the user for a decision. | [nullable][closure app_needs_user_action_data]
app_needs_user_action_data | data to pass to `app_needs_user_action_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_install_apps_data_new_task ()

    GTask *
    gs_plugin_install_apps_data_new_task (gpointer source_object,
                                          GsAppList *apps,
                                          GsPluginInstallAppsFlags flags,
                                          GsPluginProgressCallback progress_callback,
                                          gpointer progress_user_data,
                                          GsPluginEventCallback event_callback,
                                          void *event_user_data,
                                          GsPluginAppNeedsUserActionCallback app_needs_user_action_callback,
                                          gpointer app_needs_user_action_data,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Create a GTask for an install apps operation with the given arguments. The task data will be set to a GsPluginInstallAppsData containing the given context.

This is essentially a combination of `gs_plugin_install_apps_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
apps | list of apps to install |
flags | install flags |
progress_callback | function to call to notify of progress. | [nullable][closure progress_user_data]
progress_user_data | data to pass to `progress_callback` |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
app_needs_user_action_callback | (nullable) app_needs_user_action_data: function to call to ask the user for a decision |
app_needs_user_action_data | data to pass to `app_needs_user_action_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_install_apps_data_free ()

    void
    gs_plugin_install_apps_data_free (GsPluginInstallAppsData *data);

Free the given `data` .

#### Parameters

data | a GsPluginInstallAppsData. | [transfer full]

Since: 47

### gs_plugin_uninstall_apps_data_new ()

    GsPluginUninstallAppsData *
    gs_plugin_uninstall_apps_data_new (GsAppList *apps,
                                       GsPluginUninstallAppsFlags flags,
                                       GsPluginProgressCallback progress_callback,
                                       gpointer progress_user_data,
                                       GsPluginEventCallback event_callback,
                                       gpointer event_user_data,
                                       GsPluginAppNeedsUserActionCallback app_needs_user_action_callback,
                                       gpointer app_needs_user_action_data);

Context data for a call to GsPluginClass.uninstall_apps_async.

#### Parameters

apps | list of apps to uninstall |
flags | uninstall flags |
progress_callback | function to call to notify of progress. | [nullable][closure progress_user_data]
progress_user_data | data to pass to `progress_callback` |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
app_needs_user_action_callback | (nullable) app_needs_user_action_data: function to call to ask the user for a decision |
app_needs_user_action_data | data to pass to `app_needs_user_action_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_uninstall_apps_data_new_task ()

    GTask *
    gs_plugin_uninstall_apps_data_new_task
                                   (gpointer source_object,
                                    GsAppList *apps,
                                    GsPluginUninstallAppsFlags flags,
                                    GsPluginProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GsPluginEventCallback event_callback,
                                    gpointer event_user_data,
                                    GsPluginAppNeedsUserActionCallback app_needs_user_action_callback,
                                    gpointer app_needs_user_action_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for an uninstall apps operation with the given arguments. The task data will be set to a GsPluginUninstallAppsData containing the given context.

This is essentially a combination of `gs_plugin_uninstall_apps_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
apps | list of apps to uninstall |
flags | uninstall flags |
progress_callback | function to call to notify of progress. | [nullable][closure progress_user_data]
progress_user_data | data to pass to `progress_callback` |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
app_needs_user_action_callback | (nullable) app_needs_user_action_data: function to call to ask the user for a decision |
app_needs_user_action_data | data to pass to `app_needs_user_action_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_uninstall_apps_data_free ()

    void
    gs_plugin_uninstall_apps_data_free (GsPluginUninstallAppsData *data);

Free the given `data` .

#### Parameters

data | a GsPluginUninstallAppsData. | [transfer full]

Since: 47

### gs_plugin_update_apps_data_new ()

    GsPluginUpdateAppsData *
    gs_plugin_update_apps_data_new (GsAppList *apps,
                                    GsPluginUpdateAppsFlags flags,
                                    GsPluginProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GsPluginEventCallback event_callback,
                                    void *event_user_data,
                                    GsPluginAppNeedsUserActionCallback app_needs_user_action_callback,
                                    gpointer app_needs_user_action_data);

Context data for a call to GsPluginClass.update_apps_async.

#### Parameters

apps | list of apps to update |
flags | update flags |
progress_callback | function to call to notify of progress. | [nullable][closure progress_user_data]
progress_user_data | data to pass to `progress_callback` |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
app_needs_user_action_callback | (nullable) app_needs_user_action_data: function to call to ask the user for a decision |
app_needs_user_action_data | data to pass to `app_needs_user_action_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_update_apps_data_new_task ()

    GTask *
    gs_plugin_update_apps_data_new_task (gpointer source_object,
                                         GsAppList *apps,
                                         GsPluginUpdateAppsFlags flags,
                                         GsPluginProgressCallback progress_callback,
                                         gpointer progress_user_data,
                                         GsPluginEventCallback event_callback,
                                         void *event_user_data,
                                         GsPluginAppNeedsUserActionCallback app_needs_user_action_callback,
                                         gpointer app_needs_user_action_data,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data);

Create a GTask for an update apps operation with the given arguments. The task data will be set to a GsPluginUpdateAppsData containing the given context.

This is essentially a combination of `gs_plugin_update_apps_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
apps | list of apps to update |
flags | update flags |
progress_callback | function to call to notify of progress. | [nullable][closure progress_user_data]
progress_user_data | data to pass to `progress_callback` |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
app_needs_user_action_callback | (nullable) app_needs_user_action_data: function to call to ask the user for a decision |
app_needs_user_action_data | data to pass to `app_needs_user_action_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_update_apps_data_free ()

    void
    gs_plugin_update_apps_data_free (GsPluginUpdateAppsData *data);

Free the given `data` .

#### Parameters

data | a GsPluginUpdateAppsData. | [transfer full]

Since: 44

### gs_plugin_cancel_offline_update_data_new ()

    GsPluginCancelOfflineUpdateData *
    gs_plugin_cancel_offline_update_data_new
                                   (GsPluginCancelOfflineUpdateFlags flags);

Common context data for a call to GsPluginClass.cancel_offline_update_async.

#### Parameters

flags | operation flags |

#### Returns

context data structure.

[transfer full]

Since: 47

### gs_plugin_cancel_offline_update_data_new_task ()

    GTask *
    gs_plugin_cancel_offline_update_data_new_task
                                   (gpointer source_object,
                                    GsPluginCancelOfflineUpdateFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for an update-cancel operation with the given arguments. The task data will be set to a GsPluginCancelOfflineUpdateData containing the given context.

This is essentially a combination of `gs_plugin_cancel_offline_update_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
flags | operation flags |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 47

### gs_plugin_cancel_offline_update_data_free ()

    void
    gs_plugin_cancel_offline_update_data_free
                                   (GsPluginCancelOfflineUpdateData *data);

Free the given `data` .

#### Parameters

data | a GsPluginCancelOfflineUpdateData. | [transfer full]

Since: 47

### gs_plugin_download_upgrade_data_new ()

    GsPluginDownloadUpgradeData *
    gs_plugin_download_upgrade_data_new (GsApp *app,
                                         GsPluginDownloadUpgradeFlags flags,
                                         GsPluginEventCallback event_callback,
                                         void *event_user_data);

Common context data for a call to GsPluginClass.download_upgrade_async.

#### Parameters

app | a GsApp, with kind `AS_COMPONENT_KIND_OPERATING_SYSTEM`. | [not nullable][transfer none]
flags | operation flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_download_upgrade_data_new_task ()

    GTask *
    gs_plugin_download_upgrade_data_new_task
                                   (gpointer source_object,
                                    GsApp *app,
                                    GsPluginDownloadUpgradeFlags flags,
                                    GsPluginEventCallback event_callback,
                                    void *event_user_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for an upgrade-download operation with the given arguments. The task data will be set to a GsPluginDownloadUpgradeData containing the given context.

This is essentially a combination of `gs_plugin_download_upgrade_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
app | a GsApp, with kind `AS_COMPONENT_KIND_OPERATING_SYSTEM`. | [not nullable][transfer none]
flags | operation flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_download_upgrade_data_free ()

    void
    gs_plugin_download_upgrade_data_free (GsPluginDownloadUpgradeData *data);

Free the given `data` .

#### Parameters

data | a GsPluginDownloadUpgradeData. | [transfer full]

Since: 47

### gs_plugin_trigger_upgrade_data_new ()

    GsPluginTriggerUpgradeData *
    gs_plugin_trigger_upgrade_data_new (GsApp *app,
                                        GsPluginTriggerUpgradeFlags flags);

Common context data for a call to GsPluginClass.trigger_upgrade_async.

#### Parameters

app | a GsApp, with kind `AS_COMPONENT_KIND_OPERATING_SYSTEM`. | [not nullable][transfer none]
flags | operation flags |

#### Returns

context data structure.

[transfer full]

Since: 47

### gs_plugin_trigger_upgrade_data_new_task ()

    GTask *
    gs_plugin_trigger_upgrade_data_new_task
                                   (gpointer source_object,
                                    GsApp *app,
                                    GsPluginTriggerUpgradeFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for an upgrade-trigger operation with the given arguments. The task data will be set to a GsPluginTriggerUpgradeData containing the given context.

This is essentially a combination of `gs_plugin_trigger_upgrade_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
app | a GsApp, with kind `AS_COMPONENT_KIND_OPERATING_SYSTEM`. | [not nullable][transfer none]
flags | operation flags |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 47

### gs_plugin_trigger_upgrade_data_free ()

    void
    gs_plugin_trigger_upgrade_data_free (GsPluginTriggerUpgradeData *data);

Free the given `data` .

#### Parameters

data | a GsPluginTriggerUpgradeData. | [transfer full]

Since: 47

### gs_plugin_launch_data_new ()

    GsPluginLaunchData *
    gs_plugin_launch_data_new (GsApp *app,
                               GsPluginLaunchFlags flags);

Common context data for a call to GsPluginClass.launch_async.

#### Parameters

app | a GsApp. | [not nullable][transfer none]
flags | operation flags |

#### Returns

context data structure.

[transfer full]

Since: 47

### gs_plugin_launch_data_new_task ()

    GTask *
    gs_plugin_launch_data_new_task (gpointer source_object,
                                    GsApp *app,
                                    GsPluginLaunchFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for a launch operation with the given arguments. The task data will be set to a GsPluginLaunchData containing the given context.

This is essentially a combination of `gs_plugin_launch_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
app | a GsApp. | [not nullable][transfer none]
flags | operation flags |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 47

### gs_plugin_launch_data_free ()

    void
    gs_plugin_launch_data_free (GsPluginLaunchData *data);

Free the given `data` .

#### Parameters

data | a GsPluginLaunchData. | [transfer full]

Since: 47

### gs_plugin_file_to_app_data_new ()

    GsPluginFileToAppData *
    gs_plugin_file_to_app_data_new (GFile *file,
                                    GsPluginFileToAppFlags flags,
                                    GsPluginEventCallback event_callback,
                                    void *event_user_data);

Common context data for a call to GsPluginClass.file_to_app_async.

#### Parameters

file | a GFile. | [not nullable][transfer none]
flags | operation flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_file_to_app_data_new_task ()

    GTask *
    gs_plugin_file_to_app_data_new_task (gpointer source_object,
                                         GFile *file,
                                         GsPluginFileToAppFlags flags,
                                         GsPluginEventCallback event_callback,
                                         void *event_user_data,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data);

Create a GTask for a file-to-app operation with the given arguments. The task data will be set to a GsPluginFileToAppData containing the given context.

This is essentially a combination of `gs_plugin_file_to_app_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
file | a GFile. | [not nullable][transfer none]
flags | operation flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_file_to_app_data_free ()

    void
    gs_plugin_file_to_app_data_free (GsPluginFileToAppData *data);

Free the given `data` .

#### Parameters

data | a GsPluginFileToAppData. | [transfer full]

Since: 47

### gs_plugin_url_to_app_data_new ()

    GsPluginUrlToAppData *
    gs_plugin_url_to_app_data_new (const gchar *url,
                                   GsPluginUrlToAppFlags flags,
                                   GsPluginEventCallback event_callback,
                                   void *event_user_data);

Common context data for a call to GsPluginClass.url_to_app_async.

#### Parameters

url | a URL. | [not nullable]
flags | operation flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |

#### Returns

context data structure.

[transfer full]

Since: 49

### gs_plugin_url_to_app_data_new_task ()

    GTask *
    gs_plugin_url_to_app_data_new_task (gpointer source_object,
                                        const gchar *url,
                                        GsPluginUrlToAppFlags flags,
                                        GsPluginEventCallback event_callback,
                                        void *event_user_data,
                                        GCancellable *cancellable,
                                        GAsyncReadyCallback callback,
                                        gpointer user_data);

Create a GTask for a url-to-app operation with the given arguments. The task data will be set to a GsPluginUrlToAppData containing the given context.

This is essentially a combination of `gs_plugin_url_to_app_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
url | a URL. | [not nullable]
flags | operation flags |
event_callback | function to call to notify of events. | [nullable][closure event_user_data]
event_user_data | data to pass to `event_callback` |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 49

### gs_plugin_url_to_app_data_free ()

    void
    gs_plugin_url_to_app_data_free (GsPluginUrlToAppData *data);

Free the given `data` .

#### Parameters

data | a GsPluginUrlToAppData. | [transfer full]

Since: 47

### gs_plugin_get_offline_update_state_data_new ()

    GsPluginGetOfflineUpdateStateData *
    gs_plugin_get_offline_update_state_data_new
                                   (GsPluginGetOfflineUpdateStateFlags flags);

Common context data for a call to GsPluginClass.get_offline_update_state_async.

#### Parameters

flags | operation flags |

#### Returns

context data structure.

[transfer full]

Since: 50

### gs_plugin_get_offline_update_state_data_new_task ()

    GTask *
    gs_plugin_get_offline_update_state_data_new_task
                                   (gpointer source_object,
                                    GsPluginGetOfflineUpdateStateFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for an get-offline-update-state operation with the given arguments. The task data will be set to a GsPluginGetOfflineUpdateStateData containing the given context.

This is essentially a combination of `gs_plugin_get_offline_update_state_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
flags | operation flags |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 50

### gs_plugin_get_offline_update_state_data_free ()

    void
    gs_plugin_get_offline_update_state_data_free
                                   (GsPluginGetOfflineUpdateStateData *data);

Free the given `data` .

#### Parameters

data | a GsPluginGetOfflineUpdateStateData. | [transfer full]

Since: 50

### gs_plugin_set_offline_update_action_data_new ()

    GsPluginSetOfflineUpdateActionData *
    gs_plugin_set_offline_update_action_data_new
                                   (GsPluginSetOfflineUpdateActionFlags flags);

Common context data for a call to GsPluginClass.set_offline_update_action_async.

#### Parameters

flags | operation flags |

#### Returns

context data structure.

[transfer full]

Since: 50

### gs_plugin_set_offline_update_action_data_new_task ()

    GTask *
    gs_plugin_set_offline_update_action_data_new_task
                                   (gpointer source_object,
                                    GsPluginSetOfflineUpdateActionFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Create a GTask for an set-offline-update-action operation with the given arguments. The task data will be set to a GsPluginSetOfflineUpdateActionData containing the given context.

This is essentially a combination of `gs_plugin_set_offline_update_action_data_new()`, `g_task_new()` and `g_task_set_task_data()`.

#### Parameters

source_object | task source object |
flags | operation flags |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call once asynchronous operation is finished |
user_data | data to pass to `callback` |

#### Returns

new GTask with the given context data.

[transfer full]

Since: 50

### gs_plugin_set_offline_update_action_data_free ()

    void
    gs_plugin_set_offline_update_action_data_free
                                   (GsPluginSetOfflineUpdateActionData *data);

Free the given `data` .

#### Parameters

data | a GsPluginSetOfflineUpdateActionData. | [transfer full]

Since: 50

## Types and Values

### GsPluginRefineData

    typedef struct {
    	GsAppList *list;  /* (owned) (not nullable) */
    	GsPluginRefineFlags job_flags;
    	GsPluginRefineRequireFlags require_flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginRefineData;

### GsPluginRefreshMetadataData

    typedef struct {
    	guint64 cache_age_secs;
    	GsPluginRefreshMetadataFlags flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginRefreshMetadataData;

### GsPluginListAppsData

    typedef struct {
    	GsAppQuery *query;  /* (owned) (nullable) */
    	GsPluginListAppsFlags flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginListAppsData;

### GsPluginManageRepositoryData

    typedef struct {
    	GsApp *repository;  /* (owned) (nullable) */
    	GsPluginManageRepositoryFlags flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginManageRepositoryData;

### GsPluginRefineCategoriesData

    typedef struct {
    	GPtrArray *list;  /* (element-type GsCategory) (owned) (not nullable) */
    	GsPluginRefineCategoriesFlags flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginRefineCategoriesData;

### GsPluginInstallAppsData

    typedef struct {
    	GsAppList *apps;  /* (owned) (not nullable) */
    	GsPluginInstallAppsFlags flags;
    	GsPluginProgressCallback progress_callback;
    	gpointer progress_user_data;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    	GsPluginAppNeedsUserActionCallback app_needs_user_action_callback;
    	gpointer app_needs_user_action_data;
    } GsPluginInstallAppsData;

### GsPluginUninstallAppsData

    typedef struct {
    	GsAppList *apps;  /* (owned) (not nullable) */
    	GsPluginUninstallAppsFlags flags;
    	GsPluginProgressCallback progress_callback;
    	gpointer progress_user_data;
    	GsPluginEventCallback event_callback;
    	gpointer event_user_data;
    	GsPluginAppNeedsUserActionCallback app_needs_user_action_callback;
    	gpointer app_needs_user_action_data;
    } GsPluginUninstallAppsData;

### GsPluginUpdateAppsData

    typedef struct {
    	GsAppList *apps;  /* (owned) (not nullable) */
    	GsPluginUpdateAppsFlags flags;
    	GsPluginProgressCallback progress_callback;
    	gpointer progress_user_data;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    	GsPluginAppNeedsUserActionCallback app_needs_user_action_callback;
    	gpointer app_needs_user_action_data;
    } GsPluginUpdateAppsData;

### GsPluginCancelOfflineUpdateData

    typedef struct {
    	GsPluginCancelOfflineUpdateFlags flags;
    } GsPluginCancelOfflineUpdateData;

### GsPluginDownloadUpgradeData

    typedef struct {
    	GsApp *app;  /* (owned) (not nullable) */
    	GsPluginDownloadUpgradeFlags flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginDownloadUpgradeData;

### GsPluginTriggerUpgradeData

    typedef struct {
    	GsApp *app;  /* (owned) (not nullable) */
    	GsPluginTriggerUpgradeFlags flags;
    } GsPluginTriggerUpgradeData;

### GsPluginLaunchData

    typedef struct {
    	GsApp *app;  /* (owned) (not nullable) */
    	GsPluginLaunchFlags flags;
    } GsPluginLaunchData;

### GsPluginFileToAppData

    typedef struct {
    	GFile *file;  /* (owned) */
    	GsPluginFileToAppFlags flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginFileToAppData;

### GsPluginUrlToAppData

    typedef struct {
    	gchar *url;  /* (owned) */
    	GsPluginUrlToAppFlags flags;
    	GsPluginEventCallback event_callback;
    	void *event_user_data;
    } GsPluginUrlToAppData;

### GsPluginGetOfflineUpdateStateData

    typedef struct {
    	GsPluginGetOfflineUpdateStateFlags flags;
    } GsPluginGetOfflineUpdateStateData;

### GsPluginSetOfflineUpdateActionData

    typedef struct {
    	GsPluginSetOfflineUpdateActionFlags flags;
    } GsPluginSetOfflineUpdateActionData;