## gs-plugin-job-install-apps gs-plugin-job-install-apps — A plugin job to install apps |

## Functions

GsPluginJob * | gs_plugin_job_install_apps_new ()
GsAppList * | gs_plugin_job_install_apps_get_apps ()
GsPluginInstallAppsFlags | gs_plugin_job_install_apps_get_flags ()

## Types and Values

#define | GS_TYPE_PLUGIN_JOB_INSTALL_APPS
| GsPluginJobInstallApps

## Description

GsPluginJobInstallApps is a GsPluginJob representing an operation to install apps.

This class is a wrapper around `GsPluginClass.install_apps_async()`, calling it for all loaded plugins.

Unless `GS_PLUGIN_INSTALL_APPS_FLAGS_NO_DOWNLOAD` is specified, the first step of this job downloads the app and any dependencies, ready to be installed or updated.

Plugins are expected to schedule downloads using the system download scheduler if appropriate (if the download is not guaranteed to be under a few hundred kilobytes, for example), so that the user’s metered data preferences are honoured.

Plugins are expected to send progress notifications to the UI by calling the provided GsPluginProgressCallback function. Plugins may also call `gs_app_set_progress()` on apps as they are updated, but this method will eventually be removed as it cannot represent progress in multiple ongoing operations.

Callbacks from this job will be executed in the GMainContext which was thread-default at the time when `GsPluginJob.run_async()` was called on the GsPluginJobInstallApps. For plugins, this means that callbacks must be executed in the same GMainContext which called `GsPluginClass.install_apps_async()`.

If the app is already downloaded, the first step of this job is a no-op.

Unless `GS_PLUGIN_INSTALL_APPS_FLAGS_NO_APPLY` is specified, the second step of this job applies the app and any dependencies (installing the app, and updating dependencies or installing missing dependencies).

Once that is completed, the apps will typically be set to the state `GS_APP_STATE_INSTALLED`, or `GS_APP_STATE_UNKNOWN`.

On failure the error message returned will usually only be shown on the console, but they can also be retrieved using `gs_plugin_loader_get_events()`.

See also: `GsPluginClass.install_apps_async()`

## Functions

### gs_plugin_job_install_apps_new ()

    GsPluginJob *
    gs_plugin_job_install_apps_new (GsAppList *apps,
                                    GsPluginInstallAppsFlags flags);

Create a new GsPluginJobInstallApps for updating apps, or pre-downloading apps for installation.

#### Parameters

apps | list of apps to install. | [transfer none][not nullable]
flags | flags to affect the install |

#### Returns

a new GsPluginJobInstallApps.

[transfer full]

Since: 47

### gs_plugin_job_install_apps_get_apps ()

    GsAppList *
    gs_plugin_job_install_apps_get_apps (GsPluginJobInstallApps *self);

Get the set of apps being installed by this GsPluginJobInstallApps.

#### Parameters

self | a GsPluginJobInstallApps |

#### Returns

apps being installed

Since: 47

### gs_plugin_job_install_apps_get_flags ()

    GsPluginInstallAppsFlags
    gs_plugin_job_install_apps_get_flags (GsPluginJobInstallApps *self);

Get the flags affecting the behaviour of this GsPluginJobInstallApps.

#### Parameters

self | a GsPluginJobInstallApps |

#### Returns

flags for the job

Since: 47

## Types and Values

### GS_TYPE_PLUGIN_JOB_INSTALL_APPS

    #define GS_TYPE_PLUGIN_JOB_INSTALL_APPS (gs_plugin_job_install_apps_get_type ())

### GsPluginJobInstallApps

    typedef struct _GsPluginJobInstallApps GsPluginJobInstallApps;