AsApp

AsApp — An object for an AppStream application or add-on

Stability Level

Stable, unless otherwise indicated

Functions

AsApp * as_app_new ()
AsIconKind as_app_get_icon_kind ()
AsIdKind as_app_get_id_kind ()
GList * as_app_get_languages ()
GPtrArray * as_app_get_categories ()
GPtrArray * as_app_get_compulsory_for_desktops ()
GPtrArray * as_app_get_keywords ()
GPtrArray * as_app_get_pkgnames ()
GPtrArray * as_app_get_releases ()
GPtrArray * as_app_get_screenshots ()
GHashTable * as_app_get_urls ()
const gchar * as_app_get_icon ()
const gchar * as_app_get_icon_path ()
const gchar * as_app_get_id ()
const gchar * as_app_get_id_full ()
const gchar * as_app_get_project_group ()
const gchar * as_app_get_project_license ()
const gchar * as_app_get_name ()
const gchar * as_app_get_comment ()
const gchar * as_app_get_description ()
gint as_app_get_priority ()
gint as_app_get_language ()
const gchar * as_app_get_metadata_item ()
const gchar * as_app_get_url_item ()
void as_app_set_id_full ()
void as_app_set_id_kind ()
void as_app_set_project_group ()
void as_app_set_project_license ()
void as_app_set_icon ()
void as_app_set_icon_path ()
void as_app_set_icon_kind ()
void as_app_set_name ()
void as_app_set_comment ()
void as_app_set_description ()
void as_app_set_priority ()
void as_app_add_category ()
void as_app_add_keyword ()
void as_app_add_mimetype ()
void as_app_add_pkgname ()
void as_app_add_release ()
void as_app_add_screenshot ()
void as_app_add_language ()
void as_app_add_compulsory_for_desktop ()
void as_app_add_url ()
void as_app_add_metadata ()
void as_app_remove_metadata ()
void as_app_subsume ()
guint as_app_search_matches ()

Object Hierarchy

    GObject
    ╰── AsApp

Includes

#include <appstream-glib.h>

Description

This object represents the base object of all AppStream, the application. Although called AsApp, this object also represents components like fonts, codecs and input methods.

See also: AsScreenshot, AsRelease

Functions

as_app_new ()

AsApp *
as_app_new (void);

Creates a new AsApp.

Returns

a AsApp.

[transfer full]

Since 0.1.0


as_app_get_icon_kind ()

AsIconKind
as_app_get_icon_kind (AsApp *app);

Gets the icon kind.

Parameters

app

a AsApp instance.

 

Returns

enumerated value

Since 0.1.0


as_app_get_id_kind ()

AsIdKind
as_app_get_id_kind (AsApp *app);

Gets the ID kind.

Parameters

app

a AsApp instance.

 

Returns

enumerated value

Since 0.1.0


as_app_get_languages ()

GList *
as_app_get_languages (AsApp *app);

Get a list of all languages.

Parameters

app

a AsApp instance.

 

Returns

list of language values.

[transfer container][element-type utf8]

Since 0.1.0


as_app_get_categories ()

GPtrArray *
as_app_get_categories (AsApp *app);

Get the application categories.

Parameters

app

a AsApp instance.

 

Returns

an array.

[element-type utf8][transfer none]

Since 0.1.0


as_app_get_compulsory_for_desktops ()

GPtrArray *
as_app_get_compulsory_for_desktops (AsApp *app);

Returns the desktops where this application is compulsory.

Parameters

app

a AsApp instance.

 

Returns

an array.

[element-type utf8][transfer none]

Since 0.1.0


as_app_get_keywords ()

GPtrArray *
as_app_get_keywords (AsApp *app);

Gets any keywords the application should match against.

Parameters

app

a AsApp instance.

 

Returns

an array.

[element-type utf8][transfer none]

Since 0.1.0


as_app_get_pkgnames ()

GPtrArray *
as_app_get_pkgnames (AsApp *app);

Gets the package names (if any) for the application.

Parameters

app

a AsApp instance.

 

Returns

an array.

[element-type utf8][transfer none]

Since 0.1.0


as_app_get_releases ()

GPtrArray *
as_app_get_releases (AsApp *app);

Gets all the releases the application has had.

Parameters

app

a AsApp instance.

 

Returns

an array.

[element-type AsRelease][transfer none]

Since 0.1.0


as_app_get_screenshots ()

GPtrArray *
as_app_get_screenshots (AsApp *app);

Gets any screenshots the application has defined.

Parameters

app

a AsApp instance.

 

Returns

an array.

[element-type AsScreenshot][transfer none]

Since 0.1.0


as_app_get_urls ()

GHashTable *
as_app_get_urls (AsApp *app);

Gets the URLs set for the application.

Parameters

app

a AsApp instance.

 

Returns

URLs.

[transfer none]

Since 0.1.0


as_app_get_icon ()

const gchar *
as_app_get_icon (AsApp *app);

Gets the application icon. Use as_app_get_icon_path() if you need the create a full filename.

Parameters

app

a AsApp instance.

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_icon_path ()

const gchar *
as_app_get_icon_path (AsApp *app);

Gets the application icon path.

Parameters

app

a AsApp instance.

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_id ()

const gchar *
as_app_get_id (AsApp *app);

Returns the short version of the ID.

Parameters

app

a AsApp instance.

 

Returns

the short ID, e.g. "org.gnome.Software"

Since 0.1.0


as_app_get_id_full ()

const gchar *
as_app_get_id_full (AsApp *app);

Gets the full ID value.

Parameters

app

a AsApp instance.

 

Returns

the ID, e.g. "org.gnome.Software.desktop"

Since 0.1.0


as_app_get_project_group ()

const gchar *
as_app_get_project_group (AsApp *app);

Gets an application project group.

Parameters

app

a AsApp instance.

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_project_license ()

const gchar *
as_app_get_project_license (AsApp *app);

Gets the application project license.

Parameters

app

a AsApp instance.

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_name ()

const gchar *
as_app_get_name (AsApp *app,
                 const gchar *locale);

Gets the application name for a specific locale.

Parameters

app

a AsApp instance.

 

locale

the locale, or NULL. e.g. "en_GB"

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_comment ()

const gchar *
as_app_get_comment (AsApp *app,
                    const gchar *locale);

Gets the application summary for a specific locale.

Parameters

app

a AsApp instance.

 

locale

the locale, or NULL. e.g. "en_GB"

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_description ()

const gchar *
as_app_get_description (AsApp *app,
                        const gchar *locale);

Gets the application description markup for a specific locale.

Parameters

app

a AsApp instance.

 

locale

the locale, or NULL. e.g. "en_GB"

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_priority ()

gint
as_app_get_priority (AsApp *app);

Gets the application priority. Larger values trump smaller values.

Parameters

app

a AsApp instance.

 

Returns

priority value

Since 0.1.0


as_app_get_language ()

gint
as_app_get_language (AsApp *app,
                     const gchar *locale);

Gets the language coverage for the specific language.

Parameters

app

a AsApp instance.

 

locale

the locale, or NULL. e.g. "en_GB"

 

Returns

a percentage value

Since 0.1.0


as_app_get_metadata_item ()

const gchar *
as_app_get_metadata_item (AsApp *app,
                          const gchar *key);

Gets some metadata item.

Parameters

app

a AsApp instance.

 

key

the metadata key.

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_get_url_item ()

const gchar *
as_app_get_url_item (AsApp *app,
                     AsUrlKind url_kind);

Gets a URL.

Parameters

app

a AsApp instance.

 

url_kind

the URL kind, e.g. AS_URL_KIND_HOMEPAGE.

 

Returns

string, or NULL if unset

Since 0.1.0


as_app_set_id_full ()

void
as_app_set_id_full (AsApp *app,
                    const gchar *id_full,
                    gssize id_full_len);

Sets a new application ID. Any invalid characters will be automatically replaced.

Parameters

app

a AsApp instance.

 

id_full

the new _full_ application ID, e.g. "org.gnome.Software.desktop".

 

id_full_len

the size of id_full , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_id_kind ()

void
as_app_set_id_kind (AsApp *app,
                    AsIdKind id_kind);

Sets the application kind.

Parameters

app

a AsApp instance.

 

id_kind

the AsIdKind.

 

Since 0.1.0


as_app_set_project_group ()

void
as_app_set_project_group (AsApp *app,
                          const gchar *project_group,
                          gssize project_group_len);

Set any project affiliation.

Parameters

app

a AsApp instance.

 

project_group

the project group, e.g. "GNOME".

 

project_group_len

the size of project_group , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_project_license ()

void
as_app_set_project_license (AsApp *app,
                            const gchar *project_license,
                            gssize project_license_len);

Set the project license.

Parameters

app

a AsApp instance.

 

project_license

the project license string.

 

project_license_len

the size of project_license , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_icon ()

void
as_app_set_icon (AsApp *app,
                 const gchar *icon,
                 gssize icon_len);

Set the application icon.

Parameters

app

a AsApp instance.

 

icon

the icon filename or URL.

 

icon_len

the size of icon , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_icon_path ()

void
as_app_set_icon_path (AsApp *app,
                      const gchar *icon_path,
                      gssize icon_path_len);

Sets the icon path, where local icons would be found.

Parameters

app

a AsApp instance.

 

icon_path

the local path.

 

icon_path_len

the size of icon_path , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_icon_kind ()

void
as_app_set_icon_kind (AsApp *app,
                      AsIconKind icon_kind);

Sets the icon kind.

Parameters

app

a AsApp instance.

 

icon_kind

the AsIconKind.

 

Since 0.1.0


as_app_set_name ()

void
as_app_set_name (AsApp *app,
                 const gchar *locale,
                 const gchar *name,
                 gssize name_len);

Sets the application name for a specific locale.

Parameters

app

a AsApp instance.

 

locale

the locale, or NULL. e.g. "en_GB"

 

name

the application name.

 

name_len

the size of name , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_comment ()

void
as_app_set_comment (AsApp *app,
                    const gchar *locale,
                    const gchar *comment,
                    gssize comment_len);

Sets the application summary for a specific locale.

Parameters

app

a AsApp instance.

 

locale

the locale, or NULL. e.g. "en_GB"

 

comment

the application summary.

 

comment_len

the size of comment , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_description ()

void
as_app_set_description (AsApp *app,
                        const gchar *locale,
                        const gchar *description,
                        gssize description_len);

Sets the application descrption markup for a specific locale.

Parameters

app

a AsApp instance.

 

locale

the locale, or NULL. e.g. "en_GB"

 

description

the application description.

 

description_len

the size of description , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_set_priority ()

void
as_app_set_priority (AsApp *app,
                     gint priority);

Sets the application priority, where 0 is default and positive numbers are better than negative numbers.

Parameters

app

a AsApp instance.

 

priority

the priority.

 

Since 0.1.0


as_app_add_category ()

void
as_app_add_category (AsApp *app,
                     const gchar *category,
                     gssize category_len);

Adds a menu category to the application.

Parameters

app

a AsApp instance.

 

category

the category.

 

category_len

the size of category , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_add_keyword ()

void
as_app_add_keyword (AsApp *app,
                    const gchar *keyword,
                    gssize keyword_len);

Add a keyword the application should match against.

Parameters

app

a AsApp instance.

 

keyword

the keyword.

 

keyword_len

the size of keyword , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_add_mimetype ()

void
as_app_add_mimetype (AsApp *app,
                     const gchar *mimetype,
                     gssize mimetype_len);

Adds a mimetype the application can process.

Parameters

app

a AsApp instance.

 

mimetype

the mimetype.

 

mimetype_len

the size of mimetype , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_add_pkgname ()

void
as_app_add_pkgname (AsApp *app,
                    const gchar *pkgname,
                    gssize pkgname_len);

Adds a package name to an application.

Parameters

app

a AsApp instance.

 

pkgname

the package name.

 

pkgname_len

the size of pkgname , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_add_release ()

void
as_app_add_release (AsApp *app,
                    AsRelease *release);

Adds a release to an application.

Parameters

app

a AsApp instance.

 

release

a AsRelease instance.

 

Since 0.1.0


as_app_add_screenshot ()

void
as_app_add_screenshot (AsApp *app,
                       AsScreenshot *screenshot);

Adds a screenshot to an application.

Parameters

app

a AsApp instance.

 

screenshot

a AsScreenshot instance.

 

Since 0.1.0


as_app_add_language ()

void
as_app_add_language (AsApp *app,
                     gint percentage,
                     const gchar *locale,
                     gssize locale_len);

Adds a language to the application.

Parameters

app

a AsApp instance.

 

percentage

the percentage completion of the translation.

 

locale

the locale, or NULL. e.g. "en_GB"

 

locale_len

the size of locale , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_add_compulsory_for_desktop ()

void
as_app_add_compulsory_for_desktop (AsApp *app,
                                   const gchar *compulsory_for_desktop,
                                   gssize compulsory_for_desktop_len);

Adds a desktop that requires this application to be installed.

Parameters

app

a AsApp instance.

 

compulsory_for_desktop

the desktop string, e.g. "GNOME".

 

compulsory_for_desktop_len

the size of compulsory_for_desktop , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_add_url ()

void
as_app_add_url (AsApp *app,
                AsUrlKind url_kind,
                const gchar *url,
                gssize url_len);

Adds some URL data to the application.

Parameters

app

a AsApp instance.

 

url_kind

the URL kind, e.g. AS_URL_KIND_HOMEPAGE

 

url

the full URL.

 

url_len

the size of url , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_add_metadata ()

void
as_app_add_metadata (AsApp *app,
                     const gchar *key,
                     const gchar *value,
                     gssize value_len);

Adds a metadata entry to the application.

Parameters

app

a AsApp instance.

 

key

the metadata key.

 

value

the value to store.

 

value_len

the size of value , or -1 if NULL-terminated.

 

Since 0.1.0


as_app_remove_metadata ()

void
as_app_remove_metadata (AsApp *app,
                        const gchar *key);

Removes a metadata item from the application.

Parameters

app

a AsApp instance.

 

key

the metadata key.

 

Since 0.1.0


as_app_subsume ()

void
as_app_subsume (AsApp *app,
                AsApp *donor);

Copies information from the donor to the application object.

Parameters

app

a AsApp instance.

 

donor

the donor.

 

Since 0.1.0


as_app_search_matches ()

guint
as_app_search_matches (AsApp *app,
                       const gchar *search);

Searches application data for a specific keyword.

Parameters

app

a AsApp instance.

 

search

the search term.

 

Returns

a match scrore, where 0 is no match and 100 is the best match.

Since 0.1.0

Types and Values