## GsPlugin Exports GsPlugin Exports — Vfuncs that plugins can implement |

## Stability Level

Unstable, unless otherwise indicated

## Functions

GType | gs_plugin_query_type ()
void | gs_plugin_adopt_app ()
gboolean | gs_plugin_add_langpacks ()

## Includes

    #include <gnome-software.h>

## Description

## Functions

### gs_plugin_query_type ()

    GType
    gs_plugin_query_type (void);

Returns the GType for a subclass of GsPlugin provided by this plugin module. It should not do any other computation.

The init function for that type should initialize the plugin. If the plugin should not be run then `gs_plugin_set_enabled()` should be called from the init function.

NOTE: Do not do any failable actions in the plugin class’ init function; use GsPluginClass.setup_async instead.

Since: 42

### 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 app means other plugins will not try to perform actions such as install, remove or update. Most apps are claimed when they are created.

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

#### Parameters

plugin | a GsPlugin |
app | a GsApp |

### gs_plugin_add_langpacks ()

    gboolean
    gs_plugin_add_langpacks (GsPlugin *plugin,
                             GsAppList *list,
                             const gchar *locale,
                             GCancellable *cancellable,
                             GError **error);

Returns a list of language packs, as per input language code or locale.

#### Parameters

plugin | a GsPlugin |
list | a GsAppList |
locale | a LANGUAGE_CODE or LOCALE, e.g. "ja" or "ja_JP" |
cancellable | a GCancellable, or `NULL` |
error | a GError, or `NULL` |

#### Returns

`TRUE` for success or if not relevant