Top | ![]() |
![]() |
![]() |
![]() |
#define | GS_TYPE_APP |
struct | GsAppClass |
enum | GsAppState |
enum | GsAppSpecialKind |
enum | GsAppKudo |
enum | GsAppQuirk |
#define | GS_APP_INSTALL_DATE_UNSET |
#define | GS_APP_INSTALL_DATE_UNKNOWN |
enum | GsSizeType |
enum | GsAppQuality |
enum | GsAppIconsState |
enum | GsColorScheme |
#define | GS_APP_PROGRESS_UNKNOWN |
GsApp | |
GsAppList | |
GsPlugin |
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()
.
const gchar *
gs_app_state_to_string (GsAppState state
);
Converts the enumerated value to an text representation.
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.
Since: 3.22
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.
unique_id |
an application unique ID, e.g.
|
Since: 3.22
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.
app |
a GsApp |
|
unique_id |
an application unique ID, e.g.
|
Since: 3.26
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.
Since: 3.22
void gs_app_to_string_append (GsApp *app
,GString *str
);
Appends the application to an existing string.
Since: 3.26
AsComponentKind
gs_app_get_kind (GsApp *app
);
Gets the kind of the application.
Since: 40
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 |
Since: 40
GsAppState
gs_app_get_state (GsApp *app
);
Gets the state of the application.
Since: 40
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 |
Since: 3.22
AsComponentScope
gs_app_get_scope (GsApp *app
);
Gets the scope of the application.
Since: 40
void gs_app_set_scope (GsApp *app
,AsComponentScope scope
);
This sets the scope of the application.
Since: 40
AsBundleKind
gs_app_get_bundle_kind (GsApp *app
);
Gets the bundle kind of the application.
Since: 40
void gs_app_set_bundle_kind (GsApp *app
,AsBundleKind bundle_kind
);
This sets the bundle kind of the application.
Since: 40
GsAppSpecialKind
gs_app_get_special_kind (GsApp *app
);
Gets the special occupation of the application.
Since: 40
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).
Since: 40
void
gs_app_set_state_recover (GsApp *app
);
Sets the application state to the last status value that was not transient.
Since: 3.22
guint
gs_app_get_progress (GsApp *app
);
Gets the percentage completion.
Since: 3.22
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.
app |
a GsApp |
|
percentage |
a percentage progress (0–100 inclusive), or |
Since: 3.22
gboolean
gs_app_get_allow_cancel (GsApp *app
);
Gets whether the app's installation or upgrade can be cancelled.
Since: 3.26
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.
Since: 3.26
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
Since: 3.22
const gchar *
gs_app_get_branch (GsApp *app
);
Gets the application branch.
Since: 3.22
void gs_app_set_branch (GsApp *app
,const gchar *branch
);
Sets the application branch.
Since: 3.22
const gchar *
gs_app_get_name (GsApp *app
);
Gets the application name.
Since: 3.22
void gs_app_set_name (GsApp *app
,GsAppQuality quality
,const gchar *name
);
Sets the application name.
app |
a GsApp |
|
quality |
A GsAppQuality, e.g. |
|
name |
The short localized name, e.g. "Calculator" |
Since: 3.22
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.
Since: 40
void gs_app_set_renamed_from (GsApp *app
,const gchar *renamed_from
);
Sets the old name of an application that's being renamed
Since: 40
const gchar *
gs_app_get_source_default (GsApp *app
);
Gets the default source.
Since: 3.22
void gs_app_add_source (GsApp *app
,const gchar *source
);
Adds a source name for the application.
Since: 3.22
GPtrArray *
gs_app_get_sources (GsApp *app
);
Gets the list of sources for the application.
Since: 3.22
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.
Since: 3.22
const gchar *
gs_app_get_source_id_default (GsApp *app
);
Gets the default source ID.
Since: 3.22
void gs_app_add_source_id (GsApp *app
,const gchar *source_id
);
Adds a source ID to the application.
Since: 3.22
GPtrArray *
gs_app_get_source_ids (GsApp *app
);
Gets the list of source IDs.
Since: 3.22
void gs_app_set_source_ids (GsApp *app
,GPtrArray *source_ids
);
This ID is used internally to the controlling plugin.
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
void
gs_app_clear_source_ids (GsApp *app
);
Clear the list of source IDs.
Since: 3.22
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.
Since: 3.22
void gs_app_set_project_group (GsApp *app
,const gchar *project_group
);
Sets a project group for the application.
Since: 3.22
const gchar *
gs_app_get_developer_name (GsApp *app
);
Gets the developer name for the application.
Since: 3.22
void gs_app_set_developer_name (GsApp *app
,const gchar *developer_name
);
Sets a developer name for the application.
Since: 3.22
const gchar *
gs_app_get_agreement (GsApp *app
);
Gets the agreement text for the application.
Since: 3.28
void gs_app_set_agreement (GsApp *app
,const gchar *agreement
);
Sets the application end-user agreement (e.g. a EULA) in AppStream description format.
Since: 3.28
const gchar *
gs_app_get_version (GsApp *app
);
Gets the exact version for the application.
Since: 3.22
const gchar *
gs_app_get_version_ui (GsApp *app
);
Gets a version string that can be displayed in a UI.
Since: 3.22
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.
Since: 3.22
const gchar *
gs_app_get_summary (GsApp *app
);
Gets the single-line description of the application.
Since: 3.22
void gs_app_set_summary (GsApp *app
,GsAppQuality quality
,const gchar *summary
);
The medium length one-line localized name.
app |
a GsApp |
|
quality |
a GsAppQuality, e.g. |
|
summary |
a string, e.g. "A graphical calculator for GNOME" |
Since: 3.22
const gchar *
gs_app_get_summary_missing (GsApp *app
);
Gets the one-line summary to use when this application is missing.
Since: 3.22
void gs_app_set_summary_missing (GsApp *app
,const gchar *summary_missing
);
Sets the one-line summary to use when this application is missing.
Since: 3.22
const gchar *
gs_app_get_description (GsApp *app
);
Gets the long multi-line description of the application.
Since: 3.22
void gs_app_set_description (GsApp *app
,GsAppQuality quality
,const gchar *description
);
Sets the long multi-line description of the application.
app |
a GsApp |
|
quality |
a GsAppQuality, e.g. |
|
description |
a string, e.g. "GNOME Calculator is a graphical calculator for GNOME..." |
Since: 3.22
const gchar * gs_app_get_url (GsApp *app
,AsUrlKind kind
);
Gets a web address of a specific type.
Since: 40
void gs_app_set_url (GsApp *app
,AsUrlKind kind
,const gchar *url
);
Sets a web address of a specific type.
Since: 40
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.
Since: 40
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.
Since: 40
const gchar * gs_app_get_launchable (GsApp *app
,AsLaunchableKind kind
);
Gets a launchable of a specific type.
Since: 40
void gs_app_set_launchable (GsApp *app
,AsLaunchableKind kind
,const gchar *launchable
);
Sets a launchable of a specific type.
app |
a GsApp |
|
kind |
a AsLaunchableKind, e.g. |
|
launchable |
a way to launch, e.g. "org.gnome.Sysprof2.desktop" |
Since: 40
const gchar *
gs_app_get_license (GsApp *app
);
Gets the project license of the application.
Since: 3.22
gboolean
gs_app_get_license_is_free (GsApp *app
);
Returns if the application is free software.
Since: 3.22
void gs_app_set_license (GsApp *app
,GsAppQuality quality
,const gchar *license
);
Sets the project licenses used in the application.
app |
a GsApp |
|
quality |
a GsAppQuality, e.g. |
|
license |
a SPDX license string, e.g. "GPL-3.0 AND LGPL-2.0-or-later" |
Since: 3.22
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.
a NULL
-terminated array of strings.
[array zero-terminated=1][element-type utf8][transfer none]
Since: 3.22
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.
app |
a GsApp |
|
menu_path |
a |
[array zero-terminated=1][element-type utf8][transfer none] |
Since: 3.22
const gchar *
gs_app_get_origin (GsApp *app
);
Gets the origin for the application, e.g. "fedora".
Since: 3.22
void gs_app_set_origin (GsApp *app
,const gchar *origin
);
The origin is the original source of the application e.g. "fedora-updates"
Since: 3.22
const gchar *
gs_app_get_origin_appstream (GsApp *app
);
Gets the appstream origin for the application, e.g. "fedora".
Since: 3.28
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"
Since: 3.28
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".
Since: 3.22
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".
Since: 3.22
GPtrArray *
gs_app_get_screenshots (GsApp *app
);
Gets the list of screenshots.
Since: 3.22
void gs_app_add_screenshot (GsApp *app
,AsScreenshot *screenshot
);
Adds a screenshot to the application.
Since: 40
AsScreenshot *
gs_app_get_action_screenshot (GsApp *app
);
Gets a screenshot for the pending user action.
Since: 40
void gs_app_set_action_screenshot (GsApp *app
,AsScreenshot *screenshot
);
Sets a screenshot used to represent the action.
Since: 40
const gchar *
gs_app_get_update_version (GsApp *app
);
Gets the newest update version.
Since: 3.22
const gchar *
gs_app_get_update_version_ui (GsApp *app
);
Gets the update version for the UI.
Since: 3.22
void gs_app_set_update_version (GsApp *app
,const gchar *update_version
);
Sets the new version number of the update.
Since: 3.22
const gchar *
gs_app_get_update_details_markup (GsApp *app
);
Gets the multi-line description for the update as a Pango markup.
Since: 42.0
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()
Since: 42.0
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()
Since: 42.0
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.
Since: 45
AsUrgencyKind
gs_app_get_update_urgency (GsApp *app
);
Gets the update urgency.
Since: 40
void gs_app_set_update_urgency (GsApp *app
,AsUrgencyKind update_urgency
);
Sets the update urgency.
Since: 40
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.
Since: 42
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.
Since: 42
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.
Since: 42
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.
Since: 40
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.
an array of icons,
or NULL
if there are no icons.
[transfer none][element-type GIcon][nullable]
Since: 3.22
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.
an array of icons,
or NULL
if there are no icons.
[transfer container][element-type GIcon][nullable]
Since: 45
gboolean
gs_app_has_icons (GsApp *app
);
Checks whether there are any icons set.
Since: 45
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.
Since: 40
void
gs_app_remove_all_icons (GsApp *app
);
Remove all icons from app
.
Since: 40
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.
Since: 3.22
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.
Since: 3.22
AsContentRating *
gs_app_dup_content_rating (GsApp *app
);
Gets the content rating for this application.
Since: 41
void gs_app_set_content_rating (GsApp *app
,AsContentRating *content_rating
);
Sets the content rating for this application.
Since: 40
GsApp *
gs_app_get_runtime (GsApp *app
);
Gets the runtime for the installed application.
Since: 3.22
void gs_app_set_runtime (GsApp *app
,GsApp *runtime
);
Sets the runtime that the installed application requires.
Since: 3.22
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
.
Since: 3.22
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.
Since: 3.26
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.
Since: 3.22
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
.
Since: 3.26
gint
gs_app_get_rating (GsApp *app
);
Gets the percentage rating of the application, where 100 is 5 stars.
Since: 3.22
void gs_app_set_rating (GsApp *app
,gint rating
);
Gets the percentage rating of the application.
Since: 3.22
GArray *
gs_app_get_review_ratings (GsApp *app
);
Gets the review ratings.
Since: 3.22
void gs_app_set_review_ratings (GsApp *app
,GArray *review_ratings
);
Sets the review ratings.
Since: 3.22
GPtrArray *
gs_app_get_reviews (GsApp *app
);
Gets all the user-submitted reviews for the application.
Since: 3.22
void gs_app_add_review (GsApp *app
,AsReview *review
);
Adds a user-submitted review to the application.
Since: 40
void gs_app_remove_review (GsApp *app
,AsReview *review
);
Removes a user-submitted review to the application.
Since: 40
GPtrArray *
gs_app_get_provided (GsApp *app
);
Gets all the provided item sets for the application.
Since: 40
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.
cpt |
a AsComponent instance. |
|
kind |
kind of the provided item, e.g. |
Since: 40
void gs_app_add_provided_item (GsApp *app
,AsProvidedKind kind
,const gchar *item
);
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.
app |
a GsApp |
|
size_bytes_out |
return location for
the installed size, in bytes, or |
[optional][out caller-allocates] |
Since: 43
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
.
Since: 43
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.
app |
a GsApp |
|
size_bytes_out |
return location for
the installed size of dependencies, in bytes, or |
[optional][out caller-allocates] |
Since: 43
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.
app |
A GsApp |
|
size_bytes_out |
return location for
the user data size, in bytes, or |
[optional][out caller-allocates] |
Since: 43
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
.
Since: 43
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.
app |
A GsApp |
|
size_bytes_out |
return location for
the cache data size, in bytes, or |
[optional][out caller-allocates] |
Since: 43
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
.
Since: 43
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.
app |
A GsApp |
|
size_bytes_out |
return location for
the download size, in bytes, or |
[optional][out caller-allocates] |
Since: 43
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
.
Since: 43
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.
app |
A GsApp |
|
size_bytes_out |
return location for
the download size of dependencies, in bytes, or |
[optional][out caller-allocates] |
Since: 43
void gs_app_add_related (GsApp *app
,GsApp *app2
);
Adds a related application.
Since: 3.22
void gs_app_add_addons (GsApp *app
,GsAppList *addons
);
Adds zero or more addons to the list of application addons.
Since: 43
void gs_app_add_history (GsApp *app
,GsApp *app2
);
Adds a history item for this package.
Since: 3.22
guint64
gs_app_get_install_date (GsApp *app
);
Gets the date that an application was installed.
Since: 3.22
void gs_app_set_install_date (GsApp *app
,guint64 install_date
);
Sets the date that an application was installed.
Since: 3.22
guint64
gs_app_get_release_date (GsApp *app
);
Gets the date that an application was released.
Since: 3.40
void gs_app_set_release_date (GsApp *app
,guint64 release_date
);
Sets the date that an application was released.
Since: 3.40
GPtrArray *
gs_app_get_categories (GsApp *app
);
Gets the list of categories for an application.
Since: 3.22
void gs_app_set_categories (GsApp *app
,GPtrArray *categories
);
Set the list of categories for an application.
Since: 3.22
GArray *
gs_app_get_key_colors (GsApp *app
);
Gets the key colors used in the application icon.
Since: 40
void gs_app_set_key_colors (GsApp *app
,GArray *key_colors
);
Sets the key colors used in the application icon.
Since: 40
void gs_app_add_key_color (GsApp *app
,GdkRGBA *key_color
);
Adds a key color used in the application icon.
Since: 3.22
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.
Since: 42
void gs_app_set_key_color_for_color_scheme (GsApp *app
,GsColorScheme for_color_scheme
,const GdkRGBA *rgba
);
Sets preferred app color (key color) for the specified color scheme.
When the for_color_scheme
is GS_COLOR_SCHEME_ANY
, then covers both
color schemes, unless they've been previously set.
Use NULL
rgba
to unset the color.
app |
a GsApp |
|
for_color_scheme |
for which GsColorScheme |
|
rgba |
a GdkRGBA to use, or |
[nullable] |
Since: 47
gboolean gs_app_get_key_color_for_color_scheme (GsApp *app
,GsColorScheme for_color_scheme
,GdkRGBA *out_rgba
);
Gets preferred app color (key color) previously set by
the gs_app_set_key_color_for_color_scheme()
.
When the for_color_scheme
is GS_COLOR_SCHEME_ANY
, then returns whichever
color scheme's color is set, in no particular order.
The out_rgba
is left untouched when no color for the for_color_scheme
had been set and returns FALSE
.
app |
a GsApp |
|
for_color_scheme |
for which GsColorScheme |
|
out_rgba |
a GdkRGBA to store the value in. |
[out caller-allocates] |
TRUE
, when the color for the for_color_scheme
had been previously set
and the out_rgba
had been populated, FALSE
otherwise
Since: 47
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.
Since: 3.36
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.
Since: 3.36
gboolean gs_app_has_category (GsApp *app
,const gchar *category
);
Checks if the application is in a specific category.
Since: 3.22
void gs_app_add_category (GsApp *app
,const gchar *category
);
Adds a category ID to an application.
Since: 3.22
gboolean gs_app_remove_category (GsApp *app
,const gchar *category
);
Removes an category ID from an application, it exists.
Since: 3.24
void gs_app_add_kudo (GsApp *app
,GsAppKudo kudo
);
Adds a kudo to the application.
Since: 3.22
void gs_app_remove_kudo (GsApp *app
,GsAppKudo kudo
);
Removes a kudo from the application.
Since: 3.30
gboolean gs_app_has_kudo (GsApp *app
,GsAppKudo kudo
);
Finds out if a kudo has been awarded by the application.
Since: 3.22
guint64
gs_app_get_kudos (GsApp *app
);
Gets all the kudos the application has been awarded.
Since: 3.22
guint
gs_app_get_kudos_percentage (GsApp *app
);
Gets the kudos, as a percentage value.
Since: 3.22
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.
Since: 3.22
void gs_app_set_to_be_installed (GsApp *app
,gboolean to_be_installed
);
Sets if the application is queued for installation.
Since: 3.22
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.
Since: 3.22
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.
Since: 3.22
gboolean gs_app_has_quirk (GsApp *app
,GsAppQuirk quirk
);
Finds out if an application has a specific quirk.
Since: 3.22
void gs_app_add_quirk (GsApp *app
,GsAppQuirk quirk
);
Adds a quirk to an application.
Since: 3.22
void gs_app_remove_quirk (GsApp *app
,GsAppQuirk quirk
);
Removes a quirk from an application.
Since: 3.22
gboolean
gs_app_is_installed (GsApp *app
);
Gets whether the app is installed or not.
Since: 3.22
gboolean
gs_app_is_updatable (GsApp *app
);
Gets whether the app is updatable or not.
Since: 3.22
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”.
Since: 43
void gs_app_set_origin_ui (GsApp *app
,const gchar *origin_ui
);
Set the value of “origin-ui”.
gchar *
gs_app_get_packaging_format (GsApp *app
);
Gets the packaging format, e.g. 'RPM' or 'Flatpak'.
Since: 3.32
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", ....
Since: 41
void gs_app_subsume_metadata (GsApp *app
,GsApp *donor
);
Copies any metadata from donor
to app
.
Since: 3.32
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.
Since: 43
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.
Since: 43
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.
Since: 43
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.
Since: 43
GPtrArray *
gs_app_get_version_history (GsApp *app
);
Gets the list of past releases for an application (including the latest one).
a list, or
NULL
if the version history is not known.
[element-type AsRelease][transfer container][nullable]
Since: 41
void gs_app_set_version_history (GsApp *app
,GPtrArray *version_history
);
Set the list of past releases for an application (including the latest one).
app |
a GsApp |
|
version_history |
a set of entries
representing the version history, or |
[element-type AsRelease][nullable] |
Since: 40
void gs_app_ensure_icons_downloaded (GsApp *app
,SoupSession *soup_session
,guint maximum_icon_size
,guint scale
,GCancellable *cancellable
);
Ensure all remote icons in the app
's icons are locally cached.
Since: 48
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.
Since: 41
void gs_app_add_relation (GsApp *app
,AsRelation *relation
);
Adds relation
to “relations”. relation
must have all its properties
set already.
Since: 41
void gs_app_set_relations (GsApp *app
,GPtrArray *relations
);
Set “relations” to relations
, replacing its previous value. NULL
is
equivalent to an empty array.
app |
a GsApp |
|
relations |
a new set
of relations for “relations”; |
[element-type AsRelation][nullable][transfer none] |
Since: 41
gboolean
gs_app_get_has_translations (GsApp *app
);
Get the value of “has-translations”.
Since: 41
void gs_app_set_has_translations (GsApp *app
,gboolean has_translations
);
Set the value of “has-translations”.
Since: 41
gboolean
gs_app_is_downloaded (GsApp *app
);
Returns whether the app
is downloaded for updates or not,
considering also its dependencies.
Since: 43
GsAppIconsState
gs_app_get_icons_state (GsApp *app
);
Returns the state of the icons of app
.
Since: 44
gboolean
gs_app_is_application (GsApp *app
);
Returns whether the app
is an application, not a "generic" software.
Since: 45
void gs_app_set_mok_key_pending (GsApp *app
,gboolean mok_key_pending
);
Set the value of “mok-key-pending”. Set to TRUE
, when the app
requires
restart to enroll a Machine Owner Key (MOK).
Note: The value is ignored, when the project is not built with enabled DKMS support.
Since: 47
gboolean
gs_app_get_mok_key_pending (GsApp *app
);
Get the value of “mok-key-pending”.
Note: It returns always FALSE
, when the project is not built with
enabled DKMS support.
Since: 47
struct GsAppClass { GObjectClass parent_class; void (*to_string) (GsApp *app, GString *str); gpointer padding[30]; };
The application state.
Unknown state |
||
Application is installed |
||
Application is available |
||
Application is locally available as a file |
||
Application is installed and updatable |
||
Application is referenced, but not available |
||
Application is queued for install |
||
Application is being installed |
||
Application is being removed |
||
Application is installed and updatable live |
||
Application is available for purchasing |
||
Application is being purchased |
||
Application is installed, but may have pending some actions, like restart, to finish it |
||
Application is removed, but may have pending some actions, like restart, to finish it |
||
Application is being downloaded |
||
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.
Any awards given to the application.
The application attributes.
No special attributes |
||
Installed by OS vendor |
||
Cannot be removed |
||
Has a source to allow staying up-to-date |
||
Matches applications from any plugin |
||
A reboot is required after the action |
||
The app is not reviewable |
||
The app is not launchable (run-able) |
||
The component requires some kind of user action |
||
Is a proxy app that operates on other applications |
||
The device is unusable whilst the action is performed |
||
The app developer has been verified |
||
The app has been filtered by parental controls, and should be hidden |
||
The update requires new permissions |
||
The app cannot be run by the current user due to parental controls, and should not be launchable |
||
The app should not be shown in search results |
||
The app should not be shown anywhere (it’s blocklisted) |
||
The app should not be automatically updated |
||
The app is from a development source (Since: 43) |
||
Types of download or file size for applications.
These are used to represent the validity of properties like “size-download”.
Since: 43
#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