GsApp

GsApp — An application that is either installed or that can be installed

Stability Level

Unstable, unless otherwise indicated

Functions

const gchar * gs_app_state_to_string ()
GsApp * gs_app_new ()
GsApp * gs_app_new_from_unique_id ()
void gs_app_set_from_unique_id ()
gchar * gs_app_to_string ()
void gs_app_to_string_append ()
const gchar * gs_app_get_id ()
void gs_app_set_id ()
AsComponentKind gs_app_get_kind ()
void gs_app_set_kind ()
GsAppState gs_app_get_state ()
void gs_app_set_state ()
AsComponentScope gs_app_get_scope ()
void gs_app_set_scope ()
AsBundleKind gs_app_get_bundle_kind ()
void gs_app_set_bundle_kind ()
GsAppSpecialKind gs_app_get_special_kind ()
void gs_app_set_special_kind ()
void gs_app_set_state_recover ()
guint gs_app_get_progress ()
void gs_app_set_progress ()
gboolean gs_app_get_allow_cancel ()
void gs_app_set_allow_cancel ()
const gchar * gs_app_get_unique_id ()
const gchar * gs_app_get_branch ()
void gs_app_set_branch ()
const gchar * gs_app_get_name ()
void gs_app_set_name ()
const gchar * gs_app_get_renamed_from ()
void gs_app_set_renamed_from ()
const gchar * gs_app_get_source_default ()
void gs_app_add_source ()
GPtrArray * gs_app_get_sources ()
void gs_app_set_sources ()
const gchar * gs_app_get_source_id_default ()
void gs_app_add_source_id ()
GPtrArray * gs_app_get_source_ids ()
void gs_app_set_source_ids ()
void gs_app_clear_source_ids ()
const gchar * gs_app_get_project_group ()
void gs_app_set_project_group ()
const gchar * gs_app_get_developer_name ()
void gs_app_set_developer_name ()
const gchar * gs_app_get_agreement ()
void gs_app_set_agreement ()
const gchar * gs_app_get_version ()
const gchar * gs_app_get_version_ui ()
void gs_app_set_version ()
const gchar * gs_app_get_summary ()
void gs_app_set_summary ()
const gchar * gs_app_get_summary_missing ()
void gs_app_set_summary_missing ()
const gchar * gs_app_get_description ()
void gs_app_set_description ()
const gchar * gs_app_get_url ()
void gs_app_set_url ()
const gchar * gs_app_get_url_missing ()
void gs_app_set_url_missing ()
const gchar * gs_app_get_launchable ()
void gs_app_set_launchable ()
const gchar * gs_app_get_license ()
gboolean gs_app_get_license_is_free ()
void gs_app_set_license ()
gchar ** gs_app_get_menu_path ()
void gs_app_set_menu_path ()
const gchar * gs_app_get_origin ()
void gs_app_set_origin ()
const gchar * gs_app_get_origin_appstream ()
void gs_app_set_origin_appstream ()
const gchar * gs_app_get_origin_hostname ()
void gs_app_set_origin_hostname ()
GPtrArray * gs_app_get_screenshots ()
void gs_app_add_screenshot ()
AsScreenshot * gs_app_get_action_screenshot ()
void gs_app_set_action_screenshot ()
const gchar * gs_app_get_update_version ()
const gchar * gs_app_get_update_version_ui ()
void gs_app_set_update_version ()
const gchar * gs_app_get_update_details_markup ()
void gs_app_set_update_details_markup ()
void gs_app_set_update_details_text ()
gboolean gs_app_get_update_details_set ()
AsUrgencyKind gs_app_get_update_urgency ()
void gs_app_set_update_urgency ()
GsPlugin * gs_app_dup_management_plugin ()
gboolean gs_app_has_management_plugin ()
void gs_app_set_management_plugin ()
GIcon * gs_app_get_icon_for_size ()
GPtrArray * gs_app_get_icons ()
GPtrArray * gs_app_dup_icons ()
gboolean gs_app_has_icons ()
void gs_app_add_icon ()
void gs_app_remove_all_icons ()
GFile * gs_app_get_local_file ()
void gs_app_set_local_file ()
AsContentRating * gs_app_dup_content_rating ()
void gs_app_set_content_rating ()
GsApp * gs_app_get_runtime ()
void gs_app_set_runtime ()
const gchar * gs_app_get_metadata_item ()
GVariant * gs_app_get_metadata_variant ()
void gs_app_set_metadata ()
void gs_app_set_metadata_variant ()
gint gs_app_get_rating ()
void gs_app_set_rating ()
GArray * gs_app_get_review_ratings ()
void gs_app_set_review_ratings ()
GPtrArray * gs_app_get_reviews ()
void gs_app_add_review ()
void gs_app_remove_review ()
GPtrArray * gs_app_get_provided ()
AsProvided * gs_app_get_provided_for_kind ()
void gs_app_add_provided_item ()
GsSizeType gs_app_get_size_installed ()
void gs_app_set_size_installed ()
GsSizeType gs_app_get_size_installed_dependencies ()
GsSizeType gs_app_get_size_user_data ()
void gs_app_set_size_user_data ()
GsSizeType gs_app_get_size_cache_data ()
void gs_app_set_size_cache_data ()
GsSizeType gs_app_get_size_download ()
void gs_app_set_size_download ()
GsSizeType gs_app_get_size_download_dependencies ()
void gs_app_add_related ()
void gs_app_add_addons ()
void gs_app_add_history ()
guint64 gs_app_get_install_date ()
void gs_app_set_install_date ()
guint64 gs_app_get_release_date ()
void gs_app_set_release_date ()
GPtrArray * gs_app_get_categories ()
void gs_app_set_categories ()
GArray * gs_app_get_key_colors ()
void gs_app_set_key_colors ()
void gs_app_add_key_color ()
gboolean gs_app_get_user_key_colors ()
void gs_app_set_is_update_downloaded ()
gboolean gs_app_get_is_update_downloaded ()
gboolean gs_app_has_category ()
void gs_app_add_category ()
gboolean gs_app_remove_category ()
void gs_app_add_kudo ()
void gs_app_remove_kudo ()
gboolean gs_app_has_kudo ()
guint64 gs_app_get_kudos ()
guint gs_app_get_kudos_percentage ()
gboolean gs_app_get_to_be_installed ()
void gs_app_set_to_be_installed ()
void gs_app_set_match_value ()
guint gs_app_get_match_value ()
gboolean gs_app_has_quirk ()
void gs_app_add_quirk ()
void gs_app_remove_quirk ()
gboolean gs_app_is_installed ()
gboolean gs_app_is_updatable ()
gchar * gs_app_dup_origin_ui ()
void gs_app_set_origin_ui ()
gchar * gs_app_get_packaging_format ()
const gchar * gs_app_get_packaging_format_raw ()
void gs_app_subsume_metadata ()
GsAppPermissions * gs_app_dup_permissions ()
void gs_app_set_permissions ()
GsAppPermissions * gs_app_dup_update_permissions ()
void gs_app_set_update_permissions ()
GPtrArray * gs_app_get_version_history ()
void gs_app_set_version_history ()
void gs_app_ensure_icons_downloaded ()
GPtrArray * gs_app_get_relations ()
void gs_app_add_relation ()
void gs_app_set_relations ()
gboolean gs_app_get_has_translations ()
void gs_app_set_has_translations ()
gboolean gs_app_is_downloaded ()
GsAppIconsState gs_app_get_icons_state ()
gboolean gs_app_is_application ()

Types and Values

Includes

#include <gnome-software.h>

Description

For GsApps of kind AS_COMPONENT_KIND_DESKTOP_APP, this object represents a 1:1 mapping to a .desktop file. The design is such so you can't have different GsApp's for different versions or architectures of a package. For other AppStream component types, GsApp maps their properties and AS_COMPONENT_KIND_GENERIC is used if their type is a generic software component. For GNOME Software specific app-like entries, which don't correspond to desktop files or distinct software components, but e.g. represent a system update and its individual components, use the separate GsAppSpecialKind enum and gs_app_set_special_kind while setting the AppStream component-kind to generic.

The GsPluginLoader de-duplicates the GsApp instances that are produced by plugins to ensure that there is a single instance of GsApp for each id, making the id the primary key for this object. This ensures that actions triggered on a GsApp in different parts of gnome-software can be observed by connecting to signals on the GsApp.

Information about other GsApp objects can be stored in this object, for instance in the gs_app_add_related() method or gs_app_get_history().

Functions

gs_app_state_to_string ()

const gchar *
gs_app_state_to_string (GsAppState state);

Converts the enumerated value to an text representation.

Parameters

state

the GsAppState.

 

Returns

string version of state , or NULL for unknown


gs_app_new ()

GsApp *
gs_app_new (const gchar *id);

Creates a new application object.

The ID should only be set when the application ID (with optional prefix) is known; it is perfectly valid to use gs_app_new() with an id of NULL, and then relying on another plugin to set the id using gs_app_set_id() based on some other information.

For instance, a GsApp is created with no ID when returning results from the packagekit plugin, but with the default source name set as the package name. The source name is read by the appstream plugin, and if matched in the AppStream XML the correct ID is set, along with other higher quality data like the application icon and long description.

Parameters

id

an application ID, or NULL, e.g. "org.gnome.Software.desktop"

 

Returns

a new GsApp

Since: 3.22


gs_app_new_from_unique_id ()

GsApp *
gs_app_new_from_unique_id (const gchar *unique_id);

gs_app_new_from_unique_id is deprecated and should not be used in newly-written code.

Creates a new application object.

The unique ID will be parsed to set some information in the application such as the scope, bundle kind, id, etc. Unlike gs_app_new(), it cannot take a NULL argument.

Parameters

unique_id

an application unique ID, e.g. system/flatpak/gnome/desktop/org.gnome.Software.desktop/master

 

Returns

a new GsApp

Since: 3.22


gs_app_set_from_unique_id ()

void
gs_app_set_from_unique_id (GsApp *app,
                           const gchar *unique_id,
                           AsComponentKind kind);

Sets details on an application object.

The unique ID will be parsed to set some information in the application such as the scope, bundle kind, id, etc.

Parameters

app

a GsApp

 

unique_id

an application unique ID, e.g. system/flatpak/gnome/desktop/org.gnome.Software.desktop/master

 

Since: 3.26


gs_app_to_string ()

gchar *
gs_app_to_string (GsApp *app);

Converts the application to a string. This is not designed to serialize the object but to produce a string suitable for debugging.

Parameters

app

a GsApp

 

Returns

A multi-line string

Since: 3.22


gs_app_to_string_append ()

void
gs_app_to_string_append (GsApp *app,
                         GString *str);

Appends the application to an existing string.

Parameters

app

a GsApp

 

str

a GString

 

Since: 3.26


gs_app_get_id ()

const gchar *
gs_app_get_id (GsApp *app);

Gets the application ID.

Parameters

app

a GsApp

 

Returns

The whole ID, e.g. "gimp.desktop"

Since: 3.22


gs_app_set_id ()

void
gs_app_set_id (GsApp *app,
               const gchar *id);

Sets the application ID.

Parameters

app

a GsApp

 

id

a application ID, e.g. "gimp.desktop"

 

gs_app_get_kind ()

AsComponentKind
gs_app_get_kind (GsApp *app);

Gets the kind of the application.

Parameters

app

a GsApp

 

Returns

the AsComponentKind, e.g. AS_COMPONENT_KIND_UNKNOWN

Since: 40


gs_app_set_kind ()

void
gs_app_set_kind (GsApp *app,
                 AsComponentKind kind);

This sets the kind of the application. The following state diagram explains the typical states. All applications start with kind AS_COMPONENT_KIND_UNKNOWN.

1
2
3
PACKAGE --> NORMAL
PACKAGE --> SYSTEM
NORMAL  --> SYSTEM

Parameters

app

a GsApp

 

kind

a AsComponentKind, e.g. AS_COMPONENT_KIND_DESKTOP_APP

 

Since: 40


gs_app_get_state ()

GsAppState
gs_app_get_state (GsApp *app);

Gets the state of the application.

Parameters

app

a GsApp

 

Since: 40


gs_app_set_state ()

void
gs_app_set_state (GsApp *app,
                  GsAppState state);

This sets the state of the application. The following state diagram explains the typical states. All applications start in state GS_APP_STATE_UNKNOWN, but the frontend is not supposed to see GsApps with this state.

Plugins are responsible for changing the state to one of the other states before the GsApp is passed to the frontend.

1
2
3
4
5
6
UPDATABLE --> INSTALLING --> INSTALLED
UPDATABLE --> REMOVING   --> AVAILABLE
INSTALLED --> REMOVING   --> AVAILABLE
AVAILABLE --> INSTALLING --> INSTALLED
AVAILABLE <--> QUEUED --> INSTALLING --> INSTALLED
UNKNOWN   --> UNAVAILABLE

Parameters

app

a GsApp

 

state

a GsAppState, e.g. GS_APP_STATE_UPDATABLE_LIVE

 

Since: 3.22


gs_app_get_scope ()

AsComponentScope
gs_app_get_scope (GsApp *app);

Gets the scope of the application.

Parameters

app

a GsApp

 

Returns

the AsComponentScope, e.g. AS_COMPONENT_SCOPE_USER

Since: 40


gs_app_set_scope ()

void
gs_app_set_scope (GsApp *app,
                  AsComponentScope scope);

This sets the scope of the application.

Parameters

app

a GsApp

 

scope

a AsComponentScope, e.g. AS_COMPONENT_SCOPE_SYSTEM

 

Since: 40


gs_app_get_bundle_kind ()

AsBundleKind
gs_app_get_bundle_kind (GsApp *app);

Gets the bundle kind of the application.

Parameters

app

a GsApp

 

Returns

the AsComponentScope, e.g. AS_BUNDLE_KIND_FLATPAK

Since: 40


gs_app_set_bundle_kind ()

void
gs_app_set_bundle_kind (GsApp *app,
                        AsBundleKind bundle_kind);

This sets the bundle kind of the application.

Parameters

app

a GsApp

 

bundle_kind

a AsComponentScope, e.g. AS_BUNDLE_KIND_FLATPAK

 

Since: 40


gs_app_get_special_kind ()

GsAppSpecialKind
gs_app_get_special_kind (GsApp *app);

Gets the special occupation of the application.

Parameters

app

a GsApp

 

Since: 40


gs_app_set_special_kind ()

void
gs_app_set_special_kind (GsApp *app,
                         GsAppSpecialKind kind);

This sets the special occupation of the application (making the AsComponentKind of this application AS_COMPONENT_KIND_GENERIC per definition).

Parameters

Since: 40


gs_app_set_state_recover ()

void
gs_app_set_state_recover (GsApp *app);

Sets the application state to the last status value that was not transient.

Parameters

app

a GsApp

 

Since: 3.22


gs_app_get_progress ()

guint
gs_app_get_progress (GsApp *app);

Gets the percentage completion.

Parameters

app

a GsApp

 

Returns

the percentage completion (0–100 inclusive), or GS_APP_PROGRESS_UNKNOWN for unknown

Since: 3.22


gs_app_set_progress ()

void
gs_app_set_progress (GsApp *app,
                     guint percentage);

This sets the progress completion of the application. Use GS_APP_PROGRESS_UNKNOWN if the progress is unknown or has a wide confidence interval.

If called more than once with the same value then subsequent calls will be ignored.

Parameters

app

a GsApp

 

percentage

a percentage progress (0–100 inclusive), or GS_APP_PROGRESS_UNKNOWN

 

Since: 3.22


gs_app_get_allow_cancel ()

gboolean
gs_app_get_allow_cancel (GsApp *app);

Gets whether the app's installation or upgrade can be cancelled.

Parameters

app

a GsApp

 

Returns

TRUE if cancellation is possible, FALSE otherwise.

Since: 3.26


gs_app_set_allow_cancel ()

void
gs_app_set_allow_cancel (GsApp *app,
                         gboolean allow_cancel);

This sets a flag indicating whether the operation can be cancelled or not. This is used by the UI to set the "Cancel" button insensitive as appropriate.

Parameters

app

a GsApp

 

allow_cancel

if the installation or upgrade can be cancelled or not

 

Since: 3.26


gs_app_get_unique_id ()

const gchar *
gs_app_get_unique_id (GsApp *app);

Gets the unique application ID used for de-duplication.

The format is "<scope>/<kind>/<origin>/<id>/<branch>". Any unset fields will appear as "*". This string can be used with libappstream's functions for handling data IDs, e.g. https://www.freedesktop.org/software/appstream/docs/api/appstream-as-utils.htmlas-utils-data-id-valid

Parameters

app

a GsApp

 

Returns

The unique ID, e.g. system/flatpak/flathub/org.gnome.Notes/stable, or NULL

Since: 3.22


gs_app_get_branch ()

const gchar *
gs_app_get_branch (GsApp *app);

Gets the application branch.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_branch ()

void
gs_app_set_branch (GsApp *app,
                   const gchar *branch);

Sets the application branch.

Parameters

app

a GsApp

 

branch

The branch, e.g. "master"

 

Since: 3.22


gs_app_get_name ()

const gchar *
gs_app_get_name (GsApp *app);

Gets the application name.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_name ()

void
gs_app_set_name (GsApp *app,
                 GsAppQuality quality,
                 const gchar *name);

Sets the application name.

Parameters

app

a GsApp

 

quality

A GsAppQuality, e.g. GS_APP_QUALITY_LOWEST

 

name

The short localized name, e.g. "Calculator"

 

Since: 3.22


gs_app_get_renamed_from ()

const gchar *
gs_app_get_renamed_from (GsApp *app);

Gets the old human-readable name of an application that's being renamed, the same name that was returned by gs_app_get_name() before the rename.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset.

[nullable]

Since: 40


gs_app_set_renamed_from ()

void
gs_app_set_renamed_from (GsApp *app,
                         const gchar *renamed_from);

Sets the old name of an application that's being renamed

Parameters

app

a GsApp

 

renamed_from

The old name, e.g. "Iagno".

[nullable]

Since: 40


gs_app_get_source_default ()

const gchar *
gs_app_get_source_default (GsApp *app);

Gets the default source.

Parameters

app

a GsApp

 

Returns

a string, or NULL

Since: 3.22


gs_app_add_source ()

void
gs_app_add_source (GsApp *app,
                   const gchar *source);

Adds a source name for the application.

Parameters

app

a GsApp

 

source

a source name

 

Since: 3.22


gs_app_get_sources ()

GPtrArray *
gs_app_get_sources (GsApp *app);

Gets the list of sources for the application.

Parameters

app

a GsApp

 

Returns

a list.

[element-type utf8][transfer none]

Since: 3.22


gs_app_set_sources ()

void
gs_app_set_sources (GsApp *app,
                    GPtrArray *sources);

This name is used for the update page if the application is collected into the 'OS Updates' group. It is typically the package names, although this should not be relied upon.

Parameters

app

a GsApp

 

sources

The non-localized short names, e.g. ["gnome-calculator"]

 

Since: 3.22


gs_app_get_source_id_default ()

const gchar *
gs_app_get_source_id_default (GsApp *app);

Gets the default source ID.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_add_source_id ()

void
gs_app_add_source_id (GsApp *app,
                      const gchar *source_id);

Adds a source ID to the application.

Parameters

app

a GsApp

 

source_id

a source ID, e.g. "gnome-calculator;0.134;fedora"

 

Since: 3.22


gs_app_get_source_ids ()

GPtrArray *
gs_app_get_source_ids (GsApp *app);

Gets the list of source IDs.

Parameters

app

a GsApp

 

Returns

a list.

[element-type utf8][transfer none]

Since: 3.22


gs_app_set_source_ids ()

void
gs_app_set_source_ids (GsApp *app,
                       GPtrArray *source_ids);

This ID is used internally to the controlling plugin.

Parameters

app

a GsApp

 

source_ids

The source-id, e.g. ["gnome-calculator;0.134;fedora"] or ["/home/hughsie/.local/share/applications/0ad.desktop"]

 

Since: 3.22


gs_app_clear_source_ids ()

void
gs_app_clear_source_ids (GsApp *app);

Clear the list of source IDs.

Parameters

app

a GsApp

 

Since: 3.22


gs_app_get_project_group ()

const gchar *
gs_app_get_project_group (GsApp *app);

Gets a project group for the application. Applications belonging to other project groups may not be shown in this software center.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_project_group ()

void
gs_app_set_project_group (GsApp *app,
                          const gchar *project_group);

Sets a project group for the application.

Parameters

app

a GsApp

 

project_group

The non-localized project group, e.g. "GNOME" or "KDE"

 

Since: 3.22


gs_app_get_developer_name ()

const gchar *
gs_app_get_developer_name (GsApp *app);

Gets the developer name for the application.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_developer_name ()

void
gs_app_set_developer_name (GsApp *app,
                           const gchar *developer_name);

Sets a developer name for the application.

Parameters

app

a GsApp

 

developer_name

The developer name, e.g. "Richard Hughes"

 

Since: 3.22


gs_app_get_agreement ()

const gchar *
gs_app_get_agreement (GsApp *app);

Gets the agreement text for the application.

Parameters

app

a GsApp

 

Returns

a string in AppStream description format, or NULL for unset

Since: 3.28


gs_app_set_agreement ()

void
gs_app_set_agreement (GsApp *app,
                      const gchar *agreement);

Sets the application end-user agreement (e.g. a EULA) in AppStream description format.

Parameters

app

a GsApp

 

agreement

The agreement text, e.g. "<p>Foobar</p>"

 

Since: 3.28


gs_app_get_version ()

const gchar *
gs_app_get_version (GsApp *app);

Gets the exact version for the application.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_get_version_ui ()

const gchar *
gs_app_get_version_ui (GsApp *app);

Gets a version string that can be displayed in a UI.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_version ()

void
gs_app_set_version (GsApp *app,
                    const gchar *version);

This saves the version after stripping out any non-friendly parts, such as distro tags, git revisions and that kind of thing.

Parameters

app

a GsApp

 

version

The version, e.g. "2:1.2.3.fc19"

 

Since: 3.22


gs_app_get_summary ()

const gchar *
gs_app_get_summary (GsApp *app);

Gets the single-line description of the application.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_summary ()

void
gs_app_set_summary (GsApp *app,
                    GsAppQuality quality,
                    const gchar *summary);

The medium length one-line localized name.

Parameters

app

a GsApp

 

quality

a GsAppQuality, e.g. GS_APP_QUALITY_LOWEST

 

summary

a string, e.g. "A graphical calculator for GNOME"

 

Since: 3.22


gs_app_get_summary_missing ()

const gchar *
gs_app_get_summary_missing (GsApp *app);

Gets the one-line summary to use when this application is missing.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_summary_missing ()

void
gs_app_set_summary_missing (GsApp *app,
                            const gchar *summary_missing);

Sets the one-line summary to use when this application is missing.

Parameters

app

a GsApp

 

summary_missing

a string, or NULL

 

Since: 3.22


gs_app_get_description ()

const gchar *
gs_app_get_description (GsApp *app);

Gets the long multi-line description of the application.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_description ()

void
gs_app_set_description (GsApp *app,
                        GsAppQuality quality,
                        const gchar *description);

Sets the long multi-line description of the application.

Parameters

app

a GsApp

 

quality

a GsAppQuality, e.g. GS_APP_QUALITY_LOWEST

 

description

a string, e.g. "GNOME Calculator is a graphical calculator for GNOME..."

 

Since: 3.22


gs_app_get_url ()

const gchar *
gs_app_get_url (GsApp *app,
                AsUrlKind kind);

Gets a web address of a specific type.

Parameters

app

a GsApp

 

kind

a AsUrlKind, e.g. AS_URL_KIND_HOMEPAGE

 

Returns

a string, or NULL for unset.

[nullable]

Since: 40


gs_app_set_url ()

void
gs_app_set_url (GsApp *app,
                AsUrlKind kind,
                const gchar *url);

Sets a web address of a specific type.

Parameters

app

a GsApp

 

kind

a AsUrlKind, e.g. AS_URL_KIND_HOMEPAGE

 

url

a web URL, e.g. "http://www.hughsie.com/", or NULL to unset the URL of this kind .

[nullable]

Since: 40


gs_app_get_url_missing ()

const gchar *
gs_app_get_url_missing (GsApp *app);

Gets a web address for the application with explanations why it does not have an installation candidate.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset.

[nullable]

Since: 40


gs_app_set_url_missing ()

void
gs_app_set_url_missing (GsApp *app,
                        const gchar *url);

Sets a web address containing explanations why this app does not have an installation candidate.

Parameters

app

a GsApp

 

url

a web URL, e.g. http://www.packagekit.org/pk-package-not-found.html, or NULL.

[nullable]

Since: 40


gs_app_get_launchable ()

const gchar *
gs_app_get_launchable (GsApp *app,
                       AsLaunchableKind kind);

Gets a launchable of a specific type.

Parameters

app

a GsApp

 

kind

a AsLaunchableKind, e.g. AS_LAUNCHABLE_KIND_DESKTOP_ID

 

Returns

a string, or NULL for unset

Since: 40


gs_app_set_launchable ()

void
gs_app_set_launchable (GsApp *app,
                       AsLaunchableKind kind,
                       const gchar *launchable);

Sets a launchable of a specific type.

Parameters

app

a GsApp

 

kind

a AsLaunchableKind, e.g. AS_LAUNCHABLE_KIND_DESKTOP_ID

 

launchable

a way to launch, e.g. "org.gnome.Sysprof2.desktop"

 

Since: 40


gs_app_get_license ()

const gchar *
gs_app_get_license (GsApp *app);

Gets the project license of the application.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_get_license_is_free ()

gboolean
gs_app_get_license_is_free (GsApp *app);

Returns if the application is free software.

Parameters

app

a GsApp

 

Returns

TRUE if the application is free software

Since: 3.22


gs_app_set_license ()

void
gs_app_set_license (GsApp *app,
                    GsAppQuality quality,
                    const gchar *license);

Sets the project licenses used in the application.

Parameters

app

a GsApp

 

quality

a GsAppQuality, e.g. GS_APP_QUALITY_NORMAL

 

license

a SPDX license string, e.g. "GPL-3.0 AND LGPL-2.0-or-later"

 

Since: 3.22


gs_app_get_menu_path ()

gchar **
gs_app_get_menu_path (GsApp *app);

Returns the menu path which is an array of path elements. The resulting array is an internal structure and must not be modified or freed.

Parameters

app

a GsApp

 

Returns

a NULL-terminated array of strings

Since: 3.22


gs_app_set_menu_path ()

void
gs_app_set_menu_path (GsApp *app,
                      gchar **menu_path);

Sets the new menu path. The menu path is an array of path elements. This function creates a deep copy of the path.

Parameters

app

a GsApp

 

menu_path

a NULL-terminated array of strings

 

Since: 3.22


gs_app_get_origin ()

const gchar *
gs_app_get_origin (GsApp *app);

Gets the origin for the application, e.g. "fedora".

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_origin ()

void
gs_app_set_origin (GsApp *app,
                   const gchar *origin);

The origin is the original source of the application e.g. "fedora-updates"

Parameters

app

a GsApp

 

origin

a string, or NULL

 

Since: 3.22


gs_app_get_origin_appstream ()

const gchar *
gs_app_get_origin_appstream (GsApp *app);

Gets the appstream origin for the application, e.g. "fedora".

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.28


gs_app_set_origin_appstream ()

void
gs_app_set_origin_appstream (GsApp *app,
                             const gchar *origin_appstream);

The appstream origin is the appstream source of the application e.g. "fedora"

Parameters

app

a GsApp

 

origin_appstream

a string, or NULL

 

Since: 3.28


gs_app_get_origin_hostname ()

const gchar *
gs_app_get_origin_hostname (GsApp *app);

Gets the hostname of the origin used to install the application, e.g. "fedoraproject.org" or "sdk.gnome.org".

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_origin_hostname ()

void
gs_app_set_origin_hostname (GsApp *app,
                            const gchar *origin_hostname);

The origin is the hostname of the source used to install the application e.g. "fedoraproject.org"

You can also use a full URL as origin_hostname and this will be parsed and the hostname extracted. This process will also remove any unnecessary DNS prefixes like "download" or "mirrors".

Parameters

app

a GsApp

 

origin_hostname

a string, or NULL

 

Since: 3.22


gs_app_get_screenshots ()

GPtrArray *
gs_app_get_screenshots (GsApp *app);

Gets the list of screenshots.

Parameters

app

a GsApp

 

Returns

a list.

[element-type AsScreenshot][transfer none]

Since: 3.22


gs_app_add_screenshot ()

void
gs_app_add_screenshot (GsApp *app,
                       AsScreenshot *screenshot);

Adds a screenshot to the application.

Parameters

app

a GsApp

 

screenshot

a AsScreenshot

 

Since: 40


gs_app_get_action_screenshot ()

AsScreenshot *
gs_app_get_action_screenshot (GsApp *app);

Gets a screenshot for the pending user action.

Parameters

app

a GsApp

 

Returns

a AsScreenshot, or NULL.

[transfer none][nullable]

Since: 40


gs_app_set_action_screenshot ()

void
gs_app_set_action_screenshot (GsApp *app,
                              AsScreenshot *screenshot);

Sets a screenshot used to represent the action.

Parameters

app

a GsApp

 

action_screenshot

a AsScreenshot, or NULL.

[transfer none][nullable]

Since: 40


gs_app_get_update_version ()

const gchar *
gs_app_get_update_version (GsApp *app);

Gets the newest update version.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_get_update_version_ui ()

const gchar *
gs_app_get_update_version_ui (GsApp *app);

Gets the update version for the UI.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_set_update_version ()

void
gs_app_set_update_version (GsApp *app,
                           const gchar *update_version);

Sets the new version number of the update.

Parameters

app

a GsApp

 

update_version

a string, e.g. "0.1.2.3"

 

Since: 3.22


gs_app_get_update_details_markup ()

const gchar *
gs_app_get_update_details_markup (GsApp *app);

Gets the multi-line description for the update as a Pango markup.

Parameters

app

a GsApp

 

Returns

a string, or NULL for unset

Since: 42.0


gs_app_set_update_details_markup ()

void
gs_app_set_update_details_markup (GsApp *app,
                                  const gchar *markup);

Sets the multi-line description for the update as markup.

See: gs_app_set_update_details_text()

Parameters

app

a GsApp

 

markup

a Pango markup

 

Since: 42.0


gs_app_set_update_details_text ()

void
gs_app_set_update_details_text (GsApp *app,
                                const gchar *text);

Sets the multi-line description for the update as text, escaping the text to be safe for a Pango markup.

See: gs_app_set_update_details_markup()

Parameters

app

a GsApp

 

text

a text without Pango markup

 

Since: 42.0


gs_app_get_update_details_set ()

gboolean
gs_app_get_update_details_set (GsApp *app);

Returns whether update details for the app had been set. It does not matter whether it was set to NULL or an actual text.

Parameters

app

a GsApp

 

Returns

whether update details for the app had been set

Since: 45


gs_app_get_update_urgency ()

AsUrgencyKind
gs_app_get_update_urgency (GsApp *app);

Gets the update urgency.

Parameters

app

a GsApp

 

Returns

a AsUrgencyKind, or AS_URGENCY_KIND_UNKNOWN for unset

Since: 40


gs_app_set_update_urgency ()

void
gs_app_set_update_urgency (GsApp *app,
                           AsUrgencyKind update_urgency);

Sets the update urgency.

Parameters

app

a GsApp

 

update_urgency

a AsUrgencyKind

 

Since: 40


gs_app_dup_management_plugin ()

GsPlugin *
gs_app_dup_management_plugin (GsApp *app);

Gets the management plugin.

This is some metadata about the application which gives which plugin should handle the install, remove or upgrade actions.

Parameters

app

a GsApp

 

Returns

the management plugin, or NULL for unset.

[nullable][transfer full]

Since: 42


gs_app_has_management_plugin ()

gboolean
gs_app_has_management_plugin (GsApp *app,
                              GsPlugin *plugin);

Check whether the management plugin for app is set to plugin .

If plugin is NULL, TRUE is returned only if the app has no management plugin set.

Parameters

app

a GsApp

 

plugin

a GsPlugin to check against, or NULL.

[nullable][transfer none]

Returns

TRUE if plugin is the management plugin for app , FALSE otherwise

Since: 42


gs_app_set_management_plugin ()

void
gs_app_set_management_plugin (GsApp *app,
                              GsPlugin *management_plugin);

The management plugin is the plugin that can handle doing install and remove operations on the GsApp.

It is an error to attempt to change the management plugin once it has been previously set or to try to use this function on a wildcard application.

Parameters

app

a GsApp

 

management_plugin

a plugin, or NULL.

[nullable][transfer none]

Since: 42


gs_app_get_icon_for_size ()

GIcon *
gs_app_get_icon_for_size (GsApp *app,
                          guint size,
                          guint scale,
                          const gchar *fallback_icon_name);

Finds the most appropriate icon in the app ’s set of icons to be loaded at the given size ×scale to represent the application. This might be provided by the backend at the given size , or downsized from a larger icon provided by the backend. The return value is guaranteed to be suitable for loading as a pixbuf at size , if it’s not NULL.

If an image at least size pixels in width isn’t available, and fallback_icon_name has not been provided, NULL will be returned. If fallback_icon_name has been provided, a GIcon representing that will be returned, and NULL is guaranteed not to be returned.

Icons which come from a remote server (over HTTP or HTTPS) will be returned as a pointer into a local cache, which may not have been populated. You must call gs_remote_icon_ensure_cached() on icons of type GsRemoteIcon to download them; this function will not do that for you.

This function may do disk I/O or image resizing, but it will not do network I/O to load a pixbuf. It should be acceptable to call this from a UI thread.

Parameters

app

a GsApp

 

size

size (width or height, square) of the icon to fetch, in device pixels

 

scale

scale of the icon to fetch, typically from gtk_widget_get_scale_factor()

 

fallback_icon_name

name of an icon to load as a fallback if no other suitable one is found, or NULL for no fallback.

[nullable]

Returns

a GIcon, or NULL.

[transfer full][nullable]

Since: 40


gs_app_get_icons ()

GPtrArray *
gs_app_get_icons (GsApp *app);

gs_app_get_icons has been deprecated since version 45 and should not be used in newly-written code.

Use gs_app_dup_icons() or gs_app_has_icons() instead.

Gets the icons for the application.

This will never return an empty array; it will always return either NULL or a non-empty array.

Parameters

app

a GsApp

 

Returns

an array of icons, or NULL if there are no icons.

[transfer none][element-type GIcon][nullable]

Since: 3.22


gs_app_dup_icons ()

GPtrArray *
gs_app_dup_icons (GsApp *app);

Gets the icons for the application in a thread safe way.

This will never return an empty array; it will always return either NULL or a non-empty array.

Parameters

app

a GsApp

 

Returns

an array of icons, or NULL if there are no icons.

[transfer container][element-type GIcon][nullable]

Since: 45


gs_app_has_icons ()

gboolean
gs_app_has_icons (GsApp *app);

Checks whether there are any icons set.

Parameters

app

a GsApp

 

Returns

TRUE, when the app has set any icons, FALSE otherwise

Since: 45


gs_app_add_icon ()

void
gs_app_add_icon (GsApp *app,
                 GIcon *icon);

Adds an icon to use for the application. If the first icon added cannot be loaded then the next one is tried.

Parameters

app

a GsApp

 

icon

a GIcon

 

Since: 40


gs_app_remove_all_icons ()

void
gs_app_remove_all_icons (GsApp *app);

Remove all icons from app .

Parameters

app

a GsApp

 

Since: 40


gs_app_get_local_file ()

GFile *
gs_app_get_local_file (GsApp *app);

Gets the file that backs this application, for instance this might be a local file in ~/Downloads that we are installing.

Parameters

app

a GsApp

 

Returns

a GFile, or NULL.

[transfer none]

Since: 3.22


gs_app_set_local_file ()

void
gs_app_set_local_file (GsApp *app,
                       GFile *local_file);

Sets the file that backs this application, for instance this might be a local file in ~/Downloads that we are installing.

Parameters

app

a GsApp

 

local_file

a GFile, or NULL

 

Since: 3.22


gs_app_dup_content_rating ()

AsContentRating *
gs_app_dup_content_rating (GsApp *app);

Gets the content rating for this application.

Parameters

app

a GsApp

 

Returns

a AsContentRating, or NULL.

[transfer full][nullable]

Since: 41


gs_app_set_content_rating ()

void
gs_app_set_content_rating (GsApp *app,
                           AsContentRating *content_rating);

Sets the content rating for this application.

Parameters

app

a GsApp

 

content_rating

a AsContentRating, or NULL

 

Since: 40


gs_app_get_runtime ()

GsApp *
gs_app_get_runtime (GsApp *app);

Gets the runtime for the installed application.

Parameters

app

a GsApp

 

Returns

a GsApp, or NULL for unset.

[transfer none]

Since: 3.22


gs_app_set_runtime ()

void
gs_app_set_runtime (GsApp *app,
                    GsApp *runtime);

Sets the runtime that the installed application requires.

Parameters

app

a GsApp

 

runtime

a GsApp

 

Since: 3.22


gs_app_get_metadata_item ()

const gchar *
gs_app_get_metadata_item (GsApp *app,
                          const gchar *key);

Gets some metadata for the application. Is is expected that plugins namespace any plugin-specific metadata, for example fwupd::device-id.

Parameters

app

a GsApp

 

key

a string, e.g. "fwupd::device-id"

 

Returns

a string, or NULL for unset

Since: 3.22


gs_app_get_metadata_variant ()

GVariant *
gs_app_get_metadata_variant (GsApp *app,
                             const gchar *key);

Gets some metadata for the application. Is is expected that plugins namespace any plugin-specific metadata.

Parameters

app

a GsApp

 

key

a string, e.g. "fwupd::device-id"

 

Returns

a variant, or NULL for unset.

[transfer none][nullable]

Since: 3.26


gs_app_set_metadata ()

void
gs_app_set_metadata (GsApp *app,
                     const gchar *key,
                     const gchar *value);

Sets some metadata for the application. Is is expected that plugins namespace any plugin-specific metadata.

Parameters

app

a GsApp

 

key

a string, e.g. "fwupd::DeviceID"

 

value

a string, e.g. "fubar"

 

Since: 3.22


gs_app_set_metadata_variant ()

void
gs_app_set_metadata_variant (GsApp *app,
                             const gchar *key,
                             GVariant *value);

Sets some metadata for the application. Is is expected that plugins namespace any plugin-specific metadata, for example fwupd::device-id.

Parameters

app

a GsApp

 

key

a string, e.g. "fwupd::DeviceID"

 

value

a GVariant

 

Since: 3.26


gs_app_get_rating ()

gint
gs_app_get_rating (GsApp *app);

Gets the percentage rating of the application, where 100 is 5 stars.

Parameters

app

a GsApp

 

Returns

a percentage, or -1 for unset

Since: 3.22


gs_app_set_rating ()

void
gs_app_set_rating (GsApp *app,
                   gint rating);

Gets the percentage rating of the application.

Parameters

app

a GsApp

 

rating

a percentage, or -1 for invalid

 

Since: 3.22


gs_app_get_review_ratings ()

GArray *
gs_app_get_review_ratings (GsApp *app);

Gets the review ratings.

Parameters

app

a GsApp

 

Returns

a list.

[element-type guint32][transfer none]

Since: 3.22


gs_app_set_review_ratings ()

void
gs_app_set_review_ratings (GsApp *app,
                           GArray *review_ratings);

Sets the review ratings.

Parameters

app

a GsApp

 

review_ratings

a list.

[element-type guint32]

Since: 3.22


gs_app_get_reviews ()

GPtrArray *
gs_app_get_reviews (GsApp *app);

Gets all the user-submitted reviews for the application.

Parameters

app

a GsApp

 

Returns

the list of reviews.

[element-type AsReview][transfer none]

Since: 3.22


gs_app_add_review ()

void
gs_app_add_review (GsApp *app,
                   AsReview *review);

Adds a user-submitted review to the application.

Parameters

app

a GsApp

 

review

a AsReview

 

Since: 40


gs_app_remove_review ()

void
gs_app_remove_review (GsApp *app,
                      AsReview *review);

Removes a user-submitted review to the application.

Parameters

app

a GsApp

 

review

a AsReview

 

Since: 40


gs_app_get_provided ()

GPtrArray *
gs_app_get_provided (GsApp *app);

Gets all the provided item sets for the application.

Parameters

app

a GsApp

 

Returns

the list of provided items.

[element-type AsProvided][transfer none]

Since: 40


gs_app_get_provided_for_kind ()

AsProvided *
gs_app_get_provided_for_kind (GsApp *app,
                              AsProvidedKind kind);

Get an AsProvided object for the given interface type, or NULL if none was found.

Parameters

cpt

a AsComponent instance.

 

kind

kind of the provided item, e.g. AS_PROVIDED_KIND_MIMETYPE

 

Returns

the AsProvided.

[nullable][transfer none]

Since: 40


gs_app_add_provided_item ()

void
gs_app_add_provided_item (GsApp *app,
                          AsProvidedKind kind,
                          const gchar *item);

gs_app_get_size_installed ()

GsSizeType
gs_app_get_size_installed (GsApp *app,
                           guint64 *size_bytes_out);

Get the values of “size-installed-type” and “size-installed”.

If this returns GS_SIZE_TYPE_VALID, size_bytes_out (if non-NULL) will be set to the installed size. Otherwise, its value will be undefined.

Parameters

app

a GsApp

 

size_bytes_out

return location for the installed size, in bytes, or NULL to ignore.

[optional][out caller-allocates]

Returns

type of the installed size

Since: 43


gs_app_set_size_installed ()

void
gs_app_set_size_installed (GsApp *app,
                           GsSizeType size_type,
                           guint64 size_bytes);

Sets the installed size of the application.

size_bytes will be ignored unless size_type is GS_SIZE_TYPE_VALID.

Parameters

app

a GsApp

 

size_type

type of the installed size

 

size_bytes

size in bytes

 

Since: 43


gs_app_get_size_installed_dependencies ()

GsSizeType
gs_app_get_size_installed_dependencies
                               (GsApp *app,
                                guint64 *size_bytes_out);

Get the values of “size-installed-dependencies-type” and “size-installed-dependencies”.

If this returns GS_SIZE_TYPE_VALID, size_bytes_out (if non-NULL) will be set to the installed size of dependencies. Otherwise, its value will be undefined.

Parameters

app

a GsApp

 

size_bytes_out

return location for the installed size of dependencies, in bytes, or NULL to ignore.

[optional][out caller-allocates]

Returns

type of the installed size of dependencies

Since: 43


gs_app_get_size_user_data ()

GsSizeType
gs_app_get_size_user_data (GsApp *app,
                           guint64 *size_bytes_out);

Get the values of “size-user-data-type” and “size-user-data”.

If this returns GS_SIZE_TYPE_VALID, size_bytes_out (if non-NULL) will be set to the user data size. Otherwise, its value will be undefined.

Parameters

app

A GsApp

 

size_bytes_out

return location for the user data size, in bytes, or NULL to ignore.

[optional][out caller-allocates]

Returns

type of the user data size

Since: 43


gs_app_set_size_user_data ()

void
gs_app_set_size_user_data (GsApp *app,
                           GsSizeType size_type,
                           guint64 size_bytes);

Sets the user data size of the app .

size_bytes will be ignored unless size_type is GS_SIZE_TYPE_VALID.

Parameters

app

a GsApp

 

size_type

type of the user data size

 

size_bytes

size in bytes

 

Since: 43


gs_app_get_size_cache_data ()

GsSizeType
gs_app_get_size_cache_data (GsApp *app,
                            guint64 *size_bytes_out);

Get the values of “size-cache-data-type” and “size-cache-data”.

If this returns GS_SIZE_TYPE_VALID, size_bytes_out (if non-NULL) will be set to the cache data size. Otherwise, its value will be undefined.

Parameters

app

A GsApp

 

size_bytes_out

return location for the cache data size, in bytes, or NULL to ignore.

[optional][out caller-allocates]

Returns

type of the cache data size

Since: 43


gs_app_set_size_cache_data ()

void
gs_app_set_size_cache_data (GsApp *app,
                            GsSizeType size_type,
                            guint64 size_bytes);

Sets the cache data size of the app .

size_bytes will be ignored unless size_type is GS_SIZE_TYPE_VALID.

Parameters

app

a GsApp

 

size_type

type of the cache data size

 

size_bytes

size in bytes

 

Since: 43


gs_app_get_size_download ()

GsSizeType
gs_app_get_size_download (GsApp *app,
                          guint64 *size_bytes_out);

Get the values of “size-download-type” and “size-download”.

If this returns GS_SIZE_TYPE_VALID, size_bytes_out (if non-NULL) will be set to the download size. Otherwise, its value will be undefined.

Parameters

app

A GsApp

 

size_bytes_out

return location for the download size, in bytes, or NULL to ignore.

[optional][out caller-allocates]

Returns

type of the download size

Since: 43


gs_app_set_size_download ()

void
gs_app_set_size_download (GsApp *app,
                          GsSizeType size_type,
                          guint64 size_bytes);

Sets the download size of the application, not including any required runtime.

size_bytes will be ignored unless size_type is GS_SIZE_TYPE_VALID.

Parameters

app

a GsApp

 

size_type

type of the download size

 

size_bytes

size in bytes

 

Since: 43


gs_app_get_size_download_dependencies ()

GsSizeType
gs_app_get_size_download_dependencies (GsApp *app,
                                       guint64 *size_bytes_out);

Get the value of “size-download-dependencies-type” and “size-download-dependencies”.

If this returns GS_SIZE_TYPE_VALID, size_bytes_out (if non-NULL) will be set to the download size of dependencies. Otherwise, its value will be undefined.

Parameters

app

A GsApp

 

size_bytes_out

return location for the download size of dependencies, in bytes, or NULL to ignore.

[optional][out caller-allocates]

Returns

type of the download size of dependencies

Since: 43


gs_app_add_related ()

void
gs_app_add_related (GsApp *app,
                    GsApp *app2);

Adds a related application.

Parameters

app

a GsApp

 

app2

a GsApp

 

Since: 3.22


gs_app_add_addons ()

void
gs_app_add_addons (GsApp *app,
                   GsAppList *addons);

Adds zero or more addons to the list of application addons.

Parameters

app

a GsApp

 

addons

a list of GsApps.

[transfer none][not nullable]

Since: 43


gs_app_add_history ()

void
gs_app_add_history (GsApp *app,
                    GsApp *app2);

Adds a history item for this package.

Parameters

app

a GsApp

 

app2

a GsApp

 

Since: 3.22


gs_app_get_install_date ()

guint64
gs_app_get_install_date (GsApp *app);

Gets the date that an application was installed.

Parameters

app

a GsApp

 

Returns

A UNIX epoch, or 0 for unset

Since: 3.22


gs_app_set_install_date ()

void
gs_app_set_install_date (GsApp *app,
                         guint64 install_date);

Sets the date that an application was installed.

Parameters

app

a GsApp

 

install_date

an epoch, or GS_APP_INSTALL_DATE_UNKNOWN

 

Since: 3.22


gs_app_get_release_date ()

guint64
gs_app_get_release_date (GsApp *app);

Gets the date that an application was released.

Parameters

app

a GsApp

 

Returns

A UNIX epoch, or 0 for unset

Since: 3.40


gs_app_set_release_date ()

void
gs_app_set_release_date (GsApp *app,
                         guint64 release_date);

Sets the date that an application was released.

Parameters

app

a GsApp

 

release_date

an epoch, or 0

 

Since: 3.40


gs_app_get_categories ()

GPtrArray *
gs_app_get_categories (GsApp *app);

Gets the list of categories for an application.

Parameters

app

a GsApp

 

Returns

a list.

[element-type utf8][transfer none]

Since: 3.22


gs_app_set_categories ()

void
gs_app_set_categories (GsApp *app,
                       GPtrArray *categories);

Set the list of categories for an application.

Parameters

app

a GsApp

 

categories

a set of categories

 

Since: 3.22


gs_app_get_key_colors ()

GArray *
gs_app_get_key_colors (GsApp *app);

Gets the key colors used in the application icon.

Parameters

app

a GsApp

 

Returns

a list.

[element-type GdkRGBA][transfer none]

Since: 40


gs_app_set_key_colors ()

void
gs_app_set_key_colors (GsApp *app,
                       GArray *key_colors);

Sets the key colors used in the application icon.

Parameters

app

a GsApp

 

key_colors

a set of key colors.

[element-type GdkRGBA]

Since: 40


gs_app_add_key_color ()

void
gs_app_add_key_color (GsApp *app,
                      GdkRGBA *key_color);

Adds a key color used in the application icon.

Parameters

app

a GsApp

 

key_color

a GdkRGBA

 

Since: 3.22


gs_app_get_user_key_colors ()

gboolean
gs_app_get_user_key_colors (GsApp *app);

Returns whether the key colors provided by gs_app_get_key_colors() are set by the user (using GnomeSoftware::key-colors). FALSE means the colors have been calculated from the app icon.

Parameters

app

a GsApp

 

Returns

whether the key colors have been provided by the user.

Since: 42


gs_app_set_is_update_downloaded ()

void
gs_app_set_is_update_downloaded (GsApp *app,
                                 gboolean is_update_downloaded);

gs_app_set_is_update_downloaded has been deprecated since version 44 and should not be used in newly-written code.

No longer supported.

Sets if the new update is already downloaded for the app.

Parameters

app

a GsApp

 

is_update_downloaded

Whether a new update is already downloaded locally

 

Since: 3.36


gs_app_get_is_update_downloaded ()

gboolean
gs_app_get_is_update_downloaded (GsApp *app);

gs_app_get_is_update_downloaded has been deprecated since version 44 and should not be used in newly-written code.

No longer supported.

Gets if the new update is already downloaded for the app and is locally available.

Parameters

app

a GsApp

 

Returns

Whether a new update for the GsApp is already downloaded.

[element-type gboolean]

Since: 3.36


gs_app_has_category ()

gboolean
gs_app_has_category (GsApp *app,
                     const gchar *category);

Checks if the application is in a specific category.

Parameters

app

a GsApp

 

category

a category ID, e.g. "AudioVideo"

 

Returns

TRUE for success

Since: 3.22


gs_app_add_category ()

void
gs_app_add_category (GsApp *app,
                     const gchar *category);

Adds a category ID to an application.

Parameters

app

a GsApp

 

category

a category ID, e.g. "AudioVideo"

 

Since: 3.22


gs_app_remove_category ()

gboolean
gs_app_remove_category (GsApp *app,
                        const gchar *category);

Removes an category ID from an application, it exists.

Parameters

app

a GsApp

 

category

a category ID, e.g. "AudioVideo"

 

Returns

TRUE for success

Since: 3.24


gs_app_add_kudo ()

void
gs_app_add_kudo (GsApp *app,
                 GsAppKudo kudo);

Adds a kudo to the application.

Parameters

app

a GsApp

 

kudo

a GsAppKudo, e.g. GS_APP_KUDO_MY_LANGUAGE

 

Since: 3.22


gs_app_remove_kudo ()

void
gs_app_remove_kudo (GsApp *app,
                    GsAppKudo kudo);

Removes a kudo from the application.

Parameters

app

a GsApp

 

kudo

a GsAppKudo, e.g. GS_APP_KUDO_MY_LANGUAGE

 

Since: 3.30


gs_app_has_kudo ()

gboolean
gs_app_has_kudo (GsApp *app,
                 GsAppKudo kudo);

Finds out if a kudo has been awarded by the application.

Parameters

app

a GsApp

 

kudo

a GsAppKudo, e.g. GS_APP_KUDO_MY_LANGUAGE

 

Returns

TRUE if the app has the specified kudo

Since: 3.22


gs_app_get_kudos ()

guint64
gs_app_get_kudos (GsApp *app);

Gets all the kudos the application has been awarded.

Parameters

app

a GsApp

 

Returns

the kudos, as a bitfield

Since: 3.22


gs_app_get_kudos_percentage ()

guint
gs_app_get_kudos_percentage (GsApp *app);

Gets the kudos, as a percentage value.

Parameters

app

a GsApp

 

Returns

a percentage, with 0 for no kudos and a maximum of 100.

Since: 3.22


gs_app_get_to_be_installed ()

gboolean
gs_app_get_to_be_installed (GsApp *app);

Gets if the application is queued for installation.

This is only set for addons when the user has selected some addons to be installed before installing the main application. Plugins should check all the addons for this property when installing main applications so that the chosen set of addons is also installed at the same time. This is never set when applications do not have addons.

Parameters

app

a GsApp

 

Returns

TRUE for success

Since: 3.22


gs_app_set_to_be_installed ()

void
gs_app_set_to_be_installed (GsApp *app,
                            gboolean to_be_installed);

Sets if the application is queued for installation.

Parameters

app

a GsApp

 

to_be_installed

if the app is due to be installed

 

Since: 3.22


gs_app_set_match_value ()

void
gs_app_set_match_value (GsApp *app,
                        guint match_value);

Set a match quality value, where higher values correspond to a "better" search match, and should be shown above lower results.

Parameters

app

a GsApp

 

match_value

a value

 

Since: 3.22


gs_app_get_match_value ()

guint
gs_app_get_match_value (GsApp *app);

Get a match quality value, where higher values correspond to a "better" search match, and should be shown above lower results.

Note: This value is only valid when processing the result set and may be overwritten on subsequent searches if the plugin is using a cache.

Parameters

app

a GsApp

 

Returns

a value, where higher is better

Since: 3.22


gs_app_has_quirk ()

gboolean
gs_app_has_quirk (GsApp *app,
                  GsAppQuirk quirk);

Finds out if an application has a specific quirk.

Parameters

app

a GsApp

 

quirk

a GsAppQuirk, e.g. GS_APP_QUIRK_COMPULSORY

 

Returns

TRUE for success

Since: 3.22


gs_app_add_quirk ()

void
gs_app_add_quirk (GsApp *app,
                  GsAppQuirk quirk);

Adds a quirk to an application.

Parameters

app

a GsApp

 

quirk

a GsAppQuirk, e.g. GS_APP_QUIRK_COMPULSORY

 

Since: 3.22


gs_app_remove_quirk ()

void
gs_app_remove_quirk (GsApp *app,
                     GsAppQuirk quirk);

Removes a quirk from an application.

Parameters

app

a GsApp

 

quirk

a GsAppQuirk, e.g. GS_APP_QUIRK_COMPULSORY

 

Since: 3.22


gs_app_is_installed ()

gboolean
gs_app_is_installed (GsApp *app);

Gets whether the app is installed or not.

Parameters

app

a GsApp

 

Returns

TRUE if the app is installed, FALSE otherwise.

Since: 3.22


gs_app_is_updatable ()

gboolean
gs_app_is_updatable (GsApp *app);

Gets whether the app is updatable or not.

Parameters

app

a GsApp

 

Returns

TRUE if the app is updatable, FALSE otherwise.

Since: 3.22


gs_app_dup_origin_ui ()

gchar *
gs_app_dup_origin_ui (GsApp *app,
                      gboolean with_packaging_format);

Gets the package origin that's suitable for UI use, i.e. the value of “origin-ui”.

Parameters

app

a GsApp

 

with_packaging_format

TRUE, to include also packaging format

 

Returns

The package origin for UI use.

[not nullable][transfer full]

Since: 43


gs_app_set_origin_ui ()

void
gs_app_set_origin_ui (GsApp *app,
                      const gchar *origin_ui);

Set the value of “origin-ui”.

Parameters

app

a GsApp

 

origin_ui

the new origin UI.

[not nullable]

gs_app_get_packaging_format ()

gchar *
gs_app_get_packaging_format (GsApp *app);

Gets the packaging format, e.g. 'RPM' or 'Flatpak'.

Parameters

app

a GsApp

 

Returns

The packaging format

Since: 3.32


gs_app_get_packaging_format_raw ()

const gchar *
gs_app_get_packaging_format_raw (GsApp *app);

Similar to gs_app_get_packaging_format(), but it does not return a newly allocated string and the value is not suitable for the UI. Depending on the plugin, it can be "deb", "flatpak", "package", "RPM", "snap", ....

Parameters

app

a GsApp

 

Returns

The raw value of the packaging format

Since: 41


gs_app_subsume_metadata ()

void
gs_app_subsume_metadata (GsApp *app,
                         GsApp *donor);

Copies any metadata from donor to app .

Parameters

app

a GsApp

 

donor

another GsApp

 

Since: 3.32


gs_app_dup_permissions ()

GsAppPermissions *
gs_app_dup_permissions (GsApp *app);

Get a reference to the app permissions. The returned value can be NULL, when the app's permissions are unknown. Free the returned pointer, if not NULL, with g_object_unref(), when no longer needed.

Parameters

app

a GsApp

 

Returns

referenced GsAppPermissions, or NULL.

[nullable][transfer full]

Since: 43


gs_app_set_permissions ()

void
gs_app_set_permissions (GsApp *app,
                        GsAppPermissions *permissions);

Set permissions for the app . The permissions is referenced, if not NULL.

Note the permissions need to be sealed.

Parameters

app

a GsApp

 

permissions

a GsAppPermissions, or NULL.

[nullable][transfer none]

Since: 43


gs_app_dup_update_permissions ()

GsAppPermissions *
gs_app_dup_update_permissions (GsApp *app);

Get a reference to the update permissions. The returned value can be NULL, when no update permissions had been set. Free the returned pointer, if not NULL, with g_object_unref(), when no longer needed.

Parameters

app

a GsApp

 

Returns

referenced GsAppPermissions, or NULL.

[nullable][transfer full]

Since: 43


gs_app_set_update_permissions ()

void
gs_app_set_update_permissions (GsApp *app,
                               GsAppPermissions *update_permissions);

Set update permissions for the app , that is, the permissions, which change in an update or similar reasons. The update_permissions is referenced, if not NULL.

Note the update_permissions need to be sealed.

Parameters

app

a GsApp

 

update_permissions

a GsAppPermissions, or NULL.

[nullable][transfer none]

Since: 43


gs_app_get_version_history ()

GPtrArray *
gs_app_get_version_history (GsApp *app);

Gets the list of past releases for an application (including the latest one).

Parameters

app

a GsApp

 

Returns

a list, or NULL if the version history is not known.

[element-type AsRelease][transfer container][nullable]

Since: 41


gs_app_set_version_history ()

void
gs_app_set_version_history (GsApp *app,
                            GPtrArray *version_history);

Set the list of past releases for an application (including the latest one).

Parameters

app

a GsApp

 

version_history

a set of entries representing the version history, or NULL if none are known.

[element-type AsRelease][nullable]

Since: 40


gs_app_ensure_icons_downloaded ()

void
gs_app_ensure_icons_downloaded (GsApp *app,
                                SoupSession *soup_session,
                                guint maximum_icon_size,
                                GCancellable *cancellable);

Ensure all remote icons in the app 's icons are locally cached.

Parameters

app

a GsApp

 

soup_session

a SoupSession

 

maximum_icon_size

maximum icon size

 

cancellable

optional GCancellable object.

[nullable]

Since: 41


gs_app_get_relations ()

GPtrArray *
gs_app_get_relations (GsApp *app);

Gets the value of “relations”. NULL is equivalent to an empty array.

The returned array should not be modified.

Parameters

app

a GsApp

 

Returns

the value of “relations”, or NULL.

[transfer container][element-type AsRelation][nullable]

Since: 41


gs_app_add_relation ()

void
gs_app_add_relation (GsApp *app,
                     AsRelation *relation);

Adds relation to “relations”. relation must have all its properties set already.

Parameters

app

a GsApp

 

relation

a new AsRelation to add to the app.

[transfer none][not nullable]

Since: 41


gs_app_set_relations ()

void
gs_app_set_relations (GsApp *app,
                      GPtrArray *relations);

Set “relations” to relations , replacing its previous value. NULL is equivalent to an empty array.

Parameters

app

a GsApp

 

relations

a new set of relations for “relations”; NULL represents an empty array.

[element-type AsRelation][nullable][transfer none]

Since: 41


gs_app_get_has_translations ()

gboolean
gs_app_get_has_translations (GsApp *app);

Get the value of “has-translations”.

Parameters

app

a GsApp

 

Returns

TRUE if the app has translation metadata, FALSE otherwise

Since: 41


gs_app_set_has_translations ()

void
gs_app_set_has_translations (GsApp *app,
                             gboolean has_translations);

Set the value of “has-translations”.

Parameters

app

a GsApp

 

has_translations

TRUE if the app has translation metadata, FALSE otherwise

 

Since: 41


gs_app_is_downloaded ()

gboolean
gs_app_is_downloaded (GsApp *app);

Returns whether the app is downloaded for updates or not, considering also its dependencies.

Parameters

app

a GsApp

 

Returns

TRUE, when the app is downloaded, FALSE otherwise

Since: 43


gs_app_get_icons_state ()

GsAppIconsState
gs_app_get_icons_state (GsApp *app);

Returns the state of the icons of app .

Parameters

app

a GsApp

 

Returns

a GsAppIconsState

Since: 44


gs_app_is_application ()

gboolean
gs_app_is_application (GsApp *app);

Returns whether the app is an application, not a "generic" software.

Parameters

app

a GsApp

 

Returns

whether the app is an application, not a "generic" software

Since: 45

Types and Values

GS_TYPE_APP

#define GS_TYPE_APP (gs_app_get_type ())

struct GsAppClass

struct GsAppClass {
	GObjectClass		 parent_class;
	void			 (*to_string) (GsApp		*app,
						 GString *str);
	gpointer		 padding[30];
};

enum GsAppState

The application state.

Members

GS_APP_STATE_UNKNOWN

Unknown state

 

GS_APP_STATE_INSTALLED

Application is installed

 

GS_APP_STATE_AVAILABLE

Application is available

 

GS_APP_STATE_AVAILABLE_LOCAL

Application is locally available as a file

 

GS_APP_STATE_UPDATABLE

Application is installed and updatable

 

GS_APP_STATE_UNAVAILABLE

Application is referenced, but not available

 

GS_APP_STATE_QUEUED_FOR_INSTALL

Application is queued for install

 

GS_APP_STATE_INSTALLING

Application is being installed

 

GS_APP_STATE_REMOVING

Application is being removed

 

GS_APP_STATE_UPDATABLE_LIVE

Application is installed and updatable live

 

GS_APP_STATE_PURCHASABLE

Application is available for purchasing

 

GS_APP_STATE_PURCHASING

Application is being purchased

 

GS_APP_STATE_PENDING_INSTALL

Application is installed, but may have pending some actions, like restart, to finish it

 

GS_APP_STATE_PENDING_REMOVE

Application is removed, but may have pending some actions, like restart, to finish it

 

GS_APP_STATE_DOWNLOADING

Application is being downloaded

 

GS_APP_STATE_LAST

   

enum GsAppSpecialKind

A special occupation for GsApp. AsComponentKind can not represent certain GNOME Software specific features, like representing a GsApp as OS updates which have no associated AppStream entry. They are represented by a GsApp of kind AS_COMPONENT_KIND_GENERIC and a value from GsAppSpecialKind. which does not match any AppStream component type.

Members

GS_APP_SPECIAL_KIND_NONE

No special occupation

 

GS_APP_SPECIAL_KIND_OS_UPDATE

Application represents an OS update

 

enum GsAppKudo

Any awards given to the application.

Members

GS_APP_KUDO_MY_LANGUAGE

Localised in my language

 

GS_APP_KUDO_RECENT_RELEASE

Released recently

 

GS_APP_KUDO_FEATURED_RECOMMENDED

Chosen for the front page

 

GS_APP_KUDO_HAS_KEYWORDS

Has at least 1 keyword

 

GS_APP_KUDO_HAS_SCREENSHOTS

Supplies screenshots

 

GS_APP_KUDO_HI_DPI_ICON

Installs a HiDPI icon

 

GS_APP_KUDO_SANDBOXED

Application is sandboxed

 

GS_APP_KUDO_SANDBOXED_SECURE

Application is sandboxed securely

 

GS_APP_KUDO_LAST

   

enum GsAppQuirk

The application attributes.

Members

GS_APP_QUIRK_NONE

No special attributes

 

GS_APP_QUIRK_PROVENANCE

Installed by OS vendor

 

GS_APP_QUIRK_COMPULSORY

Cannot be removed

 

GS_APP_QUIRK_HAS_SOURCE

Has a source to allow staying up-to-date

 

GS_APP_QUIRK_IS_WILDCARD

Matches applications from any plugin

 

GS_APP_QUIRK_NEEDS_REBOOT

A reboot is required after the action

 

GS_APP_QUIRK_NOT_REVIEWABLE

The app is not reviewable

 

GS_APP_QUIRK_NOT_LAUNCHABLE

The app is not launchable (run-able)

 

GS_APP_QUIRK_NEEDS_USER_ACTION

The component requires some kind of user action

 

GS_APP_QUIRK_IS_PROXY

Is a proxy app that operates on other applications

 

GS_APP_QUIRK_UNUSABLE_DURING_UPDATE

The device is unusable whilst the action is performed

 

GS_APP_QUIRK_DEVELOPER_VERIFIED

The app developer has been verified

 

GS_APP_QUIRK_PARENTAL_FILTER

The app has been filtered by parental controls, and should be hidden

 

GS_APP_QUIRK_NEW_PERMISSIONS

The update requires new permissions

 

GS_APP_QUIRK_PARENTAL_NOT_LAUNCHABLE

The app cannot be run by the current user due to parental controls, and should not be launchable

 

GS_APP_QUIRK_HIDE_FROM_SEARCH

The app should not be shown in search results

 

GS_APP_QUIRK_HIDE_EVERYWHERE

The app should not be shown anywhere (it’s blocklisted)

 

GS_APP_QUIRK_DO_NOT_AUTO_UPDATE

The app should not be automatically updated

 

GS_APP_QUIRK_DEVELOPMENT_SOURCE

The app is from a development source (Since: 43)

 

GS_APP_QUIRK_LAST

   

GS_APP_INSTALL_DATE_UNSET

#define GS_APP_INSTALL_DATE_UNSET		0

GS_APP_INSTALL_DATE_UNKNOWN

#define GS_APP_INSTALL_DATE_UNKNOWN		1 /* 1s past the epoch */

enum GsSizeType

Types of download or file size for applications.

These are used to represent the validity of properties like “size-download”.

Members

GS_SIZE_TYPE_UNKNOWN

Size is unknown

 

GS_SIZE_TYPE_UNKNOWABLE

Size is unknown and is impossible to calculate

 

GS_SIZE_TYPE_VALID

Size is known and valid

 

Since: 43


enum GsAppQuality

Any awards given to the application.

Members

GS_APP_QUALITY_UNKNOWN

The quality value is unknown

 

GS_APP_QUALITY_LOWEST

Lowest quality

 

GS_APP_QUALITY_NORMAL

Normal quality

 

GS_APP_QUALITY_HIGHEST

Highest quality

 

GS_APP_QUALITY_LAST

   

enum GsAppIconsState

State of the icons of the application.

Members

GS_APP_ICONS_STATE_UNKNOWN

The state of the icons is unknown

 

GS_APP_ICONS_STATE_PENDING_DOWNLOAD

Icons are in queue to be downloaded

 

GS_APP_ICONS_STATE_DOWNLOADING

Icons are downloading

 

GS_APP_ICONS_STATE_AVAILABLE

Icons are available

 

Since: 44


GS_APP_PROGRESS_UNKNOWN

#define GS_APP_PROGRESS_UNKNOWN G_MAXUINT

A value returned by gs_app_get_progress() if the app’s progress is unknown or has a wide confidence interval. Typically this would be represented in the UI using a pulsing progress bar or spinner.

Since: 3.38


GsApp

typedef struct _GsApp GsApp;

GsAppList

typedef struct _GsAppList GsAppList;

GsPlugin

typedef struct _GsPlugin GsPlugin;