GsPlugin Exports

GsPlugin Exports — Vfuncs that plugins can implement

Stability Level

Unstable, unless otherwise indicated

Functions

void gs_plugin_initialize ()
void gs_plugin_destroy ()
void gs_plugin_adopt_app ()
gboolean gs_plugin_add_search ()
gboolean gs_plugin_add_search_files ()
gboolean gs_plugin_add_search_what_provides ()
gboolean gs_plugin_setup ()
gboolean gs_plugin_add_installed ()
gboolean gs_plugin_add_updates ()
gboolean gs_plugin_add_distro_upgrades ()
gboolean gs_plugin_add_sources ()
gboolean gs_plugin_add_updates_historical ()
gboolean gs_plugin_add_categories ()
gboolean gs_plugin_add_category_apps ()
gboolean gs_plugin_add_popular ()
gboolean gs_plugin_add_featured ()
gboolean gs_plugin_add_unvoted_reviews ()
gboolean gs_plugin_refine ()
gboolean gs_plugin_refine_app ()
gboolean gs_plugin_launch ()
gboolean gs_plugin_add_shortcut ()
gboolean gs_plugin_remove_shortcut ()
gboolean gs_plugin_update_cancel ()
gboolean gs_plugin_app_install ()
gboolean gs_plugin_app_remove ()
gboolean gs_plugin_app_set_rating ()
gboolean gs_plugin_update_app ()
gboolean gs_plugin_app_upgrade_download ()
gboolean gs_plugin_app_upgrade_trigger ()
gboolean gs_plugin_review_submit ()
gboolean gs_plugin_review_upvote ()
gboolean gs_plugin_review_downvote ()
gboolean gs_plugin_review_report ()
gboolean gs_plugin_review_remove ()
gboolean gs_plugin_review_dismiss ()
gboolean gs_plugin_refresh ()
gboolean gs_plugin_file_to_app ()
gboolean gs_plugin_update ()
gboolean gs_plugin_auth_login ()
gboolean gs_plugin_auth_logout ()
gboolean gs_plugin_auth_lost_password ()
gboolean gs_plugin_auth_register ()

Includes

#include <gnome-software.h>

Description

Functions

gs_plugin_initialize ()

void
gs_plugin_initialize (GsPlugin *plugin);

gs_plugin_destroy ()

void
gs_plugin_destroy (GsPlugin *plugin);

gs_plugin_adopt_app ()

void
gs_plugin_adopt_app (GsPlugin *plugin,
                     GsApp *app);

Called when an GsApp has not been claimed (i.e. a management plugin has not been set).

A claimed application means other plugins will not try to perform actions such as install, remove or update. Most applications are claimed when they are created.

If a plugin can adopt this application then it should call gs_app_set_management_plugin() on app .

Parameters

plugin

a GsPlugin

 

app

a GsApp

 

gs_plugin_add_search ()

gboolean
gs_plugin_add_search (GsPlugin *plugin,
                      gchar **values,
                      GsAppList *list,
                      GCancellable *cancellable,
                      GError **error);

gs_plugin_add_search_files ()

gboolean
gs_plugin_add_search_files (GsPlugin *plugin,
                            gchar **values,
                            GsAppList *list,
                            GCancellable *cancellable,
                            GError **error);

gs_plugin_add_search_what_provides ()

gboolean
gs_plugin_add_search_what_provides (GsPlugin *plugin,
                                    gchar **values,
                                    GsAppList *list,
                                    GCancellable *cancellable,
                                    GError **error);

gs_plugin_setup ()

gboolean
gs_plugin_setup (GsPlugin *plugin,
                 GCancellable *cancellable,
                 GError **error);

Called when the plugin should set up the initial state, and with the write lock held.

All functions can block, but should sent progress notifications, e.g. using gs_app_set_progress() if they will take more than tens of milliseconds to complete.

This function will also not be called if gs_plugin_initialize() self-disabled.

Parameters

plugin

a GsPlugin

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success


gs_plugin_add_installed ()

gboolean
gs_plugin_add_installed (GsPlugin *plugin,
                         GsAppList *list,
                         GCancellable *cancellable,
                         GError **error);

gs_plugin_add_updates ()

gboolean
gs_plugin_add_updates (GsPlugin *plugin,
                       GsAppList *list,
                       GCancellable *cancellable,
                       GError **error);

gs_plugin_add_distro_upgrades ()

gboolean
gs_plugin_add_distro_upgrades (GsPlugin *plugin,
                               GsAppList *list,
                               GCancellable *cancellable,
                               GError **error);

gs_plugin_add_sources ()

gboolean
gs_plugin_add_sources (GsPlugin *plugin,
                       GsAppList *list,
                       GCancellable *cancellable,
                       GError **error);

gs_plugin_add_updates_historical ()

gboolean
gs_plugin_add_updates_historical (GsPlugin *plugin,
                                  GsAppList *list,
                                  GCancellable *cancellable,
                                  GError **error);

gs_plugin_add_categories ()

gboolean
gs_plugin_add_categories (GsPlugin *plugin,
                          GPtrArray *list,
                          GCancellable *cancellable,
                          GError **error);

gs_plugin_add_category_apps ()

gboolean
gs_plugin_add_category_apps (GsPlugin *plugin,
                             GsCategory *category,
                             GsAppList *list,
                             GCancellable *cancellable,
                             GError **error);

gs_plugin_add_popular ()

gboolean
gs_plugin_add_popular (GsPlugin *plugin,
                       GsAppList *list,
                       GCancellable *cancellable,
                       GError **error);

gs_plugin_add_featured ()

gboolean
gs_plugin_add_featured (GsPlugin *plugin,
                        GsAppList *list,
                        GCancellable *cancellable,
                        GError **error);

gs_plugin_add_unvoted_reviews ()

gboolean
gs_plugin_add_unvoted_reviews (GsPlugin *plugin,
                               GsAppList *list,
                               GCancellable *cancellable,
                               GError **error);

gs_plugin_refine ()

gboolean
gs_plugin_refine (GsPlugin *plugin,
                  GsAppList *list,
                  GsPluginRefineFlags flags,
                  GCancellable *cancellable,
                  GError **error);

gs_plugin_refine_app ()

gboolean
gs_plugin_refine_app (GsPlugin *plugin,
                      GsApp *app,
                      GsPluginRefineFlags flags,
                      GCancellable *cancellable,
                      GError **error);

gs_plugin_launch ()

gboolean
gs_plugin_launch (GsPlugin *plugin,
                  GsApp *app,
                  GCancellable *cancellable,
                  GError **error);

gs_plugin_add_shortcut ()

gboolean
gs_plugin_add_shortcut (GsPlugin *plugin,
                        GsApp *app,
                        GCancellable *cancellable,
                        GError **error);

Adds a shortcut for the application in a desktop-defined location.

Parameters

plugin

a GsPlugin

 

app

a GsApp

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success or if not relevant


gs_plugin_remove_shortcut ()

gboolean
gs_plugin_remove_shortcut (GsPlugin *plugin,
                           GsApp *app,
                           GCancellable *cancellable,
                           GError **error);

Removes a shortcut for the application in a desktop-defined location.

Parameters

plugin

a GsPlugin

 

app

a GsApp

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success or if not relevant


gs_plugin_update_cancel ()

gboolean
gs_plugin_update_cancel (GsPlugin *plugin,
                         GsApp *app,
                         GCancellable *cancellable,
                         GError **error);

gs_plugin_app_install ()

gboolean
gs_plugin_app_install (GsPlugin *plugin,
                       GsApp *app,
                       GCancellable *cancellable,
                       GError **error);

Called when a user double clicks on a .cab file


gs_plugin_app_remove ()

gboolean
gs_plugin_app_remove (GsPlugin *plugin,
                      GsApp *app,
                      GCancellable *cancellable,
                      GError **error);

gs_plugin_app_set_rating ()

gboolean
gs_plugin_app_set_rating (GsPlugin *plugin,
                          GsApp *app,
                          GCancellable *cancellable,
                          GError **error);

Gets any ratings for the applications.

Plugins are expected to call gs_app_set_rating() on app .

Parameters

plugin

a GsPlugin

 

app

a GsApp

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success or if not relevant


gs_plugin_update_app ()

gboolean
gs_plugin_update_app (GsPlugin *plugin,
                      GsApp *app,
                      GCancellable *cancellable,
                      GError **error);

Called when a user clicks [Update] in the updates panel


gs_plugin_app_upgrade_download ()

gboolean
gs_plugin_app_upgrade_download (GsPlugin *plugin,
                                GsApp *app,
                                GCancellable *cancellable,
                                GError **error);

gs_plugin_app_upgrade_trigger ()

gboolean
gs_plugin_app_upgrade_trigger (GsPlugin *plugin,
                               GsApp *app,
                               GCancellable *cancellable,
                               GError **error);

gs_plugin_review_submit ()

gboolean
gs_plugin_review_submit (GsPlugin *plugin,
                         GsApp *app,
                         AsReview *review,
                         GCancellable *cancellable,
                         GError **error);

gs_plugin_review_upvote ()

gboolean
gs_plugin_review_upvote (GsPlugin *plugin,
                         GsApp *app,
                         AsReview *review,
                         GCancellable *cancellable,
                         GError **error);

gs_plugin_review_downvote ()

gboolean
gs_plugin_review_downvote (GsPlugin *plugin,
                           GsApp *app,
                           AsReview *review,
                           GCancellable *cancellable,
                           GError **error);

gs_plugin_review_report ()

gboolean
gs_plugin_review_report (GsPlugin *plugin,
                         GsApp *app,
                         AsReview *review,
                         GCancellable *cancellable,
                         GError **error);

gs_plugin_review_remove ()

gboolean
gs_plugin_review_remove (GsPlugin *plugin,
                         GsApp *app,
                         AsReview *review,
                         GCancellable *cancellable,
                         GError **error);

gs_plugin_review_dismiss ()

gboolean
gs_plugin_review_dismiss (GsPlugin *plugin,
                          GsApp *app,
                          AsReview *review,
                          GCancellable *cancellable,
                          GError **error);

gs_plugin_refresh ()

gboolean
gs_plugin_refresh (GsPlugin *plugin,
                   guint cache_age,
                   GsPluginRefreshFlags flags,
                   GCancellable *cancellable,
                   GError **error);

gs_plugin_file_to_app ()

gboolean
gs_plugin_file_to_app (GsPlugin *plugin,
                       GsAppList *list,
                       GFile *file,
                       GCancellable *cancellable,
                       GError **error);

gs_plugin_update ()

gboolean
gs_plugin_update (GsPlugin *plugin,
                  GsAppList *apps,
                  GCancellable *cancellable,
                  GError **error);

gs_plugin_auth_login ()

gboolean
gs_plugin_auth_login (GsPlugin *plugin,
                      GsAuth *auth,
                      GCancellable *cancellable,
                      GError **error);

Performs a login using the given authentication details.

Parameters

plugin

a GsPlugin

 

auth

a GsAuth

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success or if not relevant


gs_plugin_auth_logout ()

gboolean
gs_plugin_auth_logout (GsPlugin *plugin,
                       GsAuth *auth,
                       GCancellable *cancellable,
                       GError **error);

Performs a logout using the given authentication details.

Parameters

plugin

a GsPlugin

 

auth

a GsAuth

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success or if not relevant


gs_plugin_auth_lost_password ()

gboolean
gs_plugin_auth_lost_password (GsPlugin *plugin,
                              GsAuth *auth,
                              GCancellable *cancellable,
                              GError **error);

Performs the lost password action using the given authentication details.

Parameters

plugin

a GsPlugin

 

auth

a GsAuth

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success or if not relevant


gs_plugin_auth_register ()

gboolean
gs_plugin_auth_register (GsPlugin *plugin,
                         GsAuth *auth,
                         GCancellable *cancellable,
                         GError **error);

Performs the registration action using the given authentication details.

Parameters

plugin

a GsPlugin

 

auth

a GsAuth

 

cancellable

a GCancellable, or NULL

 

error

a GError, or NULL

 

Returns

TRUE for success or if not relevant

Types and Values