AppStream-glib Reference Manual: AsApp

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

## Stability Level

Stable, unless otherwise indicated

## Functions

AsApp * | as_app_new ()
GQuark | as_app_error_quark ()
AsAppSourceKind | as_app_guess_source_kind ()
AsAppSourceKind | as_app_source_kind_from_string ()
const gchar * | as_app_source_kind_to_string ()
const gchar * | as_app_state_to_string ()
AsIconKind | as_app_get_icon_kind ()
AsIdKind | as_app_get_id_kind ()
AsAppSourceKind | as_app_get_source_kind ()
AsAppState | as_app_get_state ()
AsAppTrustFlags | as_app_get_trust_flags ()
GList * | as_app_get_languages ()
GPtrArray * | as_app_get_addons ()
GPtrArray * | as_app_get_categories ()
GPtrArray * | as_app_get_compulsory_for_desktops ()
GPtrArray * | as_app_get_extends ()
GPtrArray * | as_app_get_keywords ()
GPtrArray * | as_app_get_kudos ()
GPtrArray * | as_app_get_mimetypes ()
GPtrArray * | as_app_get_pkgnames ()
GPtrArray * | as_app_get_architectures ()
GPtrArray * | as_app_get_releases ()
GPtrArray * | as_app_get_provides ()
GPtrArray * | as_app_get_screenshots ()
GHashTable * | as_app_get_names ()
GHashTable * | as_app_get_comments ()
GHashTable * | as_app_get_developer_names ()
GHashTable * | as_app_get_metadata ()
GHashTable * | as_app_get_descriptions ()
GHashTable * | as_app_get_urls ()
GPtrArray * | as_app_get_vetos ()
const gchar * | as_app_get_icon ()
const gchar * | as_app_get_icon_path ()
const gchar * | as_app_get_id ()
const gchar * | as_app_get_pkgname_default ()
const gchar * | as_app_get_source_pkgname ()
const gchar * | as_app_get_project_group ()
const gchar * | as_app_get_project_license ()
const gchar * | as_app_get_metadata_license ()
const gchar * | as_app_get_update_contact ()
const gchar * | as_app_get_source_file ()
const gchar * | as_app_get_name ()
const gchar * | as_app_get_comment ()
const gchar * | as_app_get_developer_name ()
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 ()
gboolean | as_app_has_category ()
gboolean | as_app_has_kudo ()
gboolean | as_app_has_kudo_kind ()
void | as_app_set_id_kind ()
void | as_app_set_source_kind ()
void | as_app_set_state ()
void | as_app_set_trust_flags ()
void | as_app_set_project_group ()
void | as_app_set_project_license ()
void | as_app_set_metadata_license ()
void | as_app_set_source_pkgname ()
void | as_app_set_update_contact ()
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_developer_name ()
void | as_app_set_description ()
void | as_app_set_source_file ()
void | as_app_set_priority ()
void | as_app_add_category ()
void | as_app_add_keyword ()
void | as_app_add_kudo ()
void | as_app_add_kudo_kind ()
void | as_app_add_mimetype ()
void | as_app_add_pkgname ()
void | as_app_add_arch ()
void | as_app_add_release ()
void | as_app_add_provide ()
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_add_addon ()
void | as_app_add_extends ()
GPtrArray * | as_app_validate ()
void | as_app_subsume ()
void | as_app_subsume_full ()
void | as_app_add_veto ()
guint | as_app_search_matches_all ()
guint | as_app_search_matches ()
gboolean | as_app_parse_file ()
gboolean | as_app_to_file ()

## Types and Values

enum | AsAppParseFlags
enum | AsAppSubsumeFlags
enum | AsAppError
enum | AsAppValidateFlags
enum | AsAppTrustFlags
enum | AsAppSourceKind
enum | AsAppState
#define | AS_APP_ERROR

## 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_error_quark ()

    GQuark
    as_app_error_quark (void);

#### Returns

An error quark.

Since 0.1.2

### as_app_guess_source_kind ()

    AsAppSourceKind
    as_app_guess_source_kind (const gchar *filename);

Guesses the source kind based from the filename.

#### Parameters

filename | a file name |

#### Returns

A AsAppSourceKind, e.g. `AS_APP_SOURCE_KIND_APPSTREAM`.

Since 0.1.8

### as_app_source_kind_from_string ()

    AsAppSourceKind
    as_app_source_kind_from_string (const gchar *source_kind);

Converts the text representation to an enumerated value.

#### Parameters

source_kind | a source kind string |

#### Returns

A AsAppSourceKind, e.g. `AS_APP_SOURCE_KIND_APPSTREAM`.

Since 0.2.2

### as_app_source_kind_to_string ()

    const gchar *
    as_app_source_kind_to_string (AsAppSourceKind source_kind);

Converts the enumerated value to an text representation.

#### Parameters

source_kind | the AsAppSourceKind. |

#### Returns

string version of `source_kind` , or `NULL` for unknown

Since 0.2.2

### as_app_state_to_string ()

    const gchar *
    as_app_state_to_string (AsAppState state);

Converts the enumerated value to an text representation.

#### Parameters

state | the AsAppState. |

#### Returns

string version of `state` , or `NULL` for unknown

Since 0.2.2

### 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_source_kind ()

    AsAppSourceKind
    as_app_get_source_kind (AsApp *app);

Gets the source kind, i.e. where the AsApp came from.

#### Parameters

app | a AsApp instance. |

#### Returns

enumerated value

Since 0.1.4

### as_app_get_state ()

    AsAppState
    as_app_get_state (AsApp *app);

Gets the application state.

#### Parameters

app | a AsApp instance. |

#### Returns

enumerated value

Since 0.2.2

### as_app_get_trust_flags ()

    AsAppTrustFlags
    as_app_get_trust_flags (AsApp *app);

Gets the trust flags, i.e. how trusted the incoming data is.

#### Parameters

app | a AsApp instance. |

#### Returns

bitfield

Since 0.2.2

### 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_addons ()

    GPtrArray *
    as_app_get_addons (AsApp *app);

Gets all the addons the application has.

#### Parameters

app | a AsApp instance. |

#### Returns

an array.

[element-type AsApp][transfer none]

Since 0.1.7

### 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_extends ()

    GPtrArray *
    as_app_get_extends (AsApp *app);

Gets the IDs that are extended from the addon.

#### Parameters

app | a AsApp instance. |

#### Returns

an array.

[element-type utf8][transfer none]

Since 0.1.7

### as_app_get_keywords ()

    GPtrArray *
    as_app_get_keywords (AsApp *app,
                         const gchar *locale);

Gets any keywords the application should match against.

#### Parameters

app | a AsApp instance. |
locale | the locale, or `NULL`. e.g. "en_GB" |

#### Returns

an array, or `NULL`.

[element-type utf8][transfer none]

Since 0.3.0

### as_app_get_kudos ()

    GPtrArray *
    as_app_get_kudos (AsApp *app);

Gets any kudos the application has obtained.

#### Parameters

app | a AsApp instance. |

#### Returns

an array.

[element-type utf8][transfer none]

Since 0.2.2

### as_app_get_mimetypes ()

    GPtrArray *
    as_app_get_mimetypes (AsApp *app);

Gets any mimetypes the application will register.

#### Parameters

app | a AsApp instance. |

#### Returns

an array.

[transfer none][element-type utf8]

Since 0.2.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_architectures ()

    GPtrArray *
    as_app_get_architectures (AsApp *app);

Gets the supported architectures for the application, or an empty list if all architectures are supported.

#### Parameters

app | a AsApp instance. |

#### Returns

an array.

[element-type utf8][transfer none]

Since 0.1.1

### 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_provides ()

    GPtrArray *
    as_app_get_provides (AsApp *app);

Gets all the provides the application has.

#### Parameters

app | a AsApp instance. |

#### Returns

an array.

[element-type AsProvide][transfer none]

Since 0.1.6

### 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_names ()

    GHashTable *
    as_app_get_names (AsApp *app);

Gets the names set for the application.

#### Parameters

app | a AsApp instance. |

#### Returns

hash table of names.

[transfer none]

Since 0.1.6

### as_app_get_comments ()

    GHashTable *
    as_app_get_comments (AsApp *app);

Gets the comments set for the application.

#### Parameters

app | a AsApp instance. |

#### Returns

hash table of comments.

[transfer none]

Since 0.1.6

### as_app_get_developer_names ()

    GHashTable *
    as_app_get_developer_names (AsApp *app);

Gets the developer_names set for the application.

#### Parameters

app | a AsApp instance. |

#### Returns

hash table of developer_names.

[transfer none]

Since 0.1.8

### as_app_get_metadata ()

    GHashTable *
    as_app_get_metadata (AsApp *app);

Gets the metadata set for the application.

#### Parameters

app | a AsApp instance. |

#### Returns

hash table of metadata.

[transfer none]

Since 0.1.6

### as_app_get_descriptions ()

    GHashTable *
    as_app_get_descriptions (AsApp *app);

Gets the descriptions set for the application.

#### Parameters

app | a AsApp instance. |

#### Returns

hash table of descriptions.

[transfer none]

Since 0.1.6

### as_app_get_urls ()

    GHashTable *
    as_app_get_urls (AsApp *app);

Gets the URLs set for the application.

#### Parameters

app | a AsApp instance. |

#### Returns

hash table of URLs.

[transfer none]

Since 0.1.0

### as_app_get_vetos ()

    GPtrArray *
    as_app_get_vetos (AsApp *app);

Gets the list of vetos.

#### Parameters

app | A AsApp |

#### Returns

A list of vetos.

[transfer none][element-type utf8]

Since 0.2.5

### 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);

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_pkgname_default ()

    const gchar *
    as_app_get_pkgname_default (AsApp *app);

Gets the default package name.

#### Parameters

app | a AsApp instance. |

#### Returns

string, or `NULL` if unset

Since 0.2.0

### as_app_get_source_pkgname ()

    const gchar *
    as_app_get_source_pkgname (AsApp *app);

Gets the source package name that produced the binary package. Only source packages producing more than one binary package will have this entry set.

#### Parameters

app | a AsApp instance. |

#### Returns

string, or `NULL` if unset

Since 0.2.4

### 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_metadata_license ()

    const gchar *
    as_app_get_metadata_license (AsApp *app);

Gets the application project license.

#### Parameters

app | a AsApp instance. |

#### Returns

string, or `NULL` if unset

Since 0.1.4

### as_app_get_update_contact ()

    const gchar *
    as_app_get_update_contact (AsApp *app);

Gets the application upstream update contact email.

#### Parameters

app | a AsApp instance. |

#### Returns

string, or `NULL` if unset

Since 0.1.4

### as_app_get_source_file ()

    const gchar *
    as_app_get_source_file (AsApp *app);

Gets the source filename the instance was populated from.

NOTE: this is not set for `AS_APP_SOURCE_KIND_APPSTREAM` entries.

#### Parameters

app | a AsApp instance. |

#### Returns

string, or `NULL` if unset

Since 0.2.2

### 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_developer_name ()

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

Gets the application developer 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.8

### 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 where 0 is unspecified, or -1 for not found

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_has_category ()

    gboolean
    as_app_has_category (AsApp *app,
                         const gchar *category);

Searches the category list for a specific item.

#### Parameters

app | a AsApp instance. |
category | a category string, e.g. "DesktopSettings" |

#### Returns

`TRUE` if the application has got the specified category

Since 0.1.5

### as_app_has_kudo ()

    gboolean
    as_app_has_kudo (AsApp *app,
                     const gchar *kudo);

Searches the kudo list for a specific item.

#### Parameters

app | a AsApp instance. |
kudo | a kudo string, e.g. "SearchProvider" |

#### Returns

`TRUE` if the application has got the specified kudo

Since 0.2.2

### as_app_has_kudo_kind ()

    gboolean
    as_app_has_kudo_kind (AsApp *app,
                          AsKudoKind kudo);

Searches the kudo list for a specific item.

#### Parameters

app | a AsApp instance. |
kudo | a AsKudoKind, e.g. `AS_KUDO_KIND_SEARCH_PROVIDER` |

#### Returns

`TRUE` if the application has got the specified kudo

Since 0.2.2

### 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_source_kind ()

    void
    as_app_set_source_kind (AsApp *app,
                            AsAppSourceKind source_kind);

Sets the source kind.

#### Parameters

app | a AsApp instance. |
source_kind | the AsAppSourceKind. |

Since 0.1.4

### as_app_set_state ()

    void
    as_app_set_state (AsApp *app,
                      AsAppState state);

Sets the application state.

#### Parameters

app | a AsApp instance. |
state | the AsAppState. |

Since 0.2.2

### as_app_set_trust_flags ()

    void
    as_app_set_trust_flags (AsApp *app,
                            AsAppTrustFlags trust_flags);

Sets the check flags, where `AS_APP_TRUST_FLAG_COMPLETE` is completely trusted input.

#### Parameters

app | a AsApp instance. |
trust_flags | the AsAppSourceKind. |

Since 0.2.2

### 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_metadata_license ()

    void
    as_app_set_metadata_license (AsApp *app,
                                 const gchar *metadata_license,
                                 gssize metadata_license_len);

Set the project license.

#### Parameters

app | a AsApp instance. |
metadata_license | the project license string. |
metadata_license_len | the size of `metadata_license` , or -1 if `NULL`-terminated. |

Since 0.1.4

### as_app_set_source_pkgname ()

    void
    as_app_set_source_pkgname (AsApp *app,
                               const gchar *source_pkgname,
                               gssize source_pkgname_len);

Set the project license.

#### Parameters

app | a AsApp instance. |
source_pkgname | the project license string. |
source_pkgname_len | the size of `source_pkgname` , or -1 if `NULL`-terminated. |

Since 0.2.4

### as_app_set_update_contact ()

    void
    as_app_set_update_contact (AsApp *app,
                               const gchar *update_contact,
                               gssize update_contact_len);

Set the project license.

#### Parameters

app | a AsApp instance. |
update_contact | the project license string. |
update_contact_len | the size of `update_contact` , or -1 if `NULL`-terminated. |

Since 0.1.4

### 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_developer_name ()

    void
    as_app_set_developer_name (AsApp *app,
                               const gchar *locale,
                               const gchar *developer_name,
                               gssize developer_name_len);

Sets the application developer name for a specific locale.

#### Parameters

app | a AsApp instance. |
locale | the locale, or `NULL`. e.g. "en_GB" |
developer_name | the application developer name. |
developer_name_len | the size of `developer_name` , 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_source_file ()

    void
    as_app_set_source_file (AsApp *app,
                            const gchar *source_file);

Set the file that the instance was sourced from.

#### Parameters

app | a AsApp instance. |
source_file | the filename. |

Since 0.2.2

### 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 *locale,
                        const gchar *keyword,
                        gssize keyword_len);

Add a keyword the application should match against.

#### Parameters

app | a AsApp instance. |
locale | the locale, or `NULL`. e.g. "en_GB" |
keyword | the keyword. |
keyword_len | the size of `keyword` , or -1 if `NULL`-terminated. |

Since 0.3.0

### as_app_add_kudo ()

    void
    as_app_add_kudo (AsApp *app,
                     const gchar *kudo,
                     gssize kudo_len);

Add a kudo the application has obtained.

#### Parameters

app | a AsApp instance. |
kudo | the kudo. |
kudo_len | the size of `kudo` , or -1 if `NULL`-terminated. |

Since 0.2.2

### as_app_add_kudo_kind ()

    void
    as_app_add_kudo_kind (AsApp *app,
                          AsKudoKind kudo_kind);

Add a kudo the application has obtained.

#### Parameters

app | a AsApp instance. |
kudo_kind | the AsKudoKind. |

Since 0.2.2

### 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_arch ()

    void
    as_app_add_arch (AsApp *app,
                     const gchar *arch,
                     gssize arch_len);

Adds a package name to an application.

#### Parameters

app | a AsApp instance. |
arch | the package name. |
arch_len | the size of `arch` , or -1 if `NULL`-terminated. |

Since 0.1.1

### 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_provide ()

    void
    as_app_add_provide (AsApp *app,
                        AsProvide *provide);

Adds a provide to an application.

#### Parameters

app | a AsApp instance. |
provide | a AsProvide instance. |

Since 0.1.6

### 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, or 0 for unknown |
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_add_addon ()

    void
    as_app_add_addon (AsApp *app,
                      AsApp *addon);

Adds a addon to an application.

#### Parameters

app | a AsApp instance. |
addon | a AsApp instance. |

Since 0.1.7

### as_app_add_extends ()

    void
    as_app_add_extends (AsApp *app,
                        const gchar *extends,
                        gssize extends_len);

Adds a parent ID to the application.

#### Parameters

app | a AsApp instance. |
extends | the full ID, e.g. "eclipse.desktop". |
extends_len | the size of `extends` , or -1 if `NULL`-terminated. |

Since 0.1.7

### as_app_validate ()

    GPtrArray *
    as_app_validate (AsApp *app,
                     AsAppValidateFlags flags,
                     GError **error);

Validates data in the instance for style and consitency.

#### Parameters

app | a AsApp instance. |
flags | the AsAppValidateFlags to use, e.g. `AS_APP_VALIDATE_FLAG_NONE` |
error | A GError or `NULL`. |

#### Returns

A list of problems, or `NULL`.

[transfer container][element-type AsProblem]

Since 0.1.4

### 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_subsume_full ()

    void
    as_app_subsume_full (AsApp *app,
                         AsApp *donor,
                         AsAppSubsumeFlags flags);

Copies information from the donor to the application object.

#### Parameters

app | a AsApp instance. |
donor | the donor. |
flags | any optional flags, e.g. `AS_APP_SUBSUME_FLAG_NO_OVERWRITE` |

Since 0.1.4

### as_app_add_veto ()

    void
    as_app_add_veto (AsApp *app,
                     const gchar *fmt,
                     ...);

Adds a reason to not include the application in the metadata.

#### Parameters

app | A AsApp |
fmt | format string |
... | varargs |

Since 0.2.5

### as_app_search_matches_all ()

    guint
    as_app_search_matches_all (AsApp *app,
                               gchar **search);

Searches application data for all the specific keywords.

#### Parameters

app | a AsApp instance. |
search | the search terms. |

#### Returns

a match scrore, where 0 is no match and larger numbers are better matches.

Since 0.1.3

### 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

### as_app_parse_file ()

    gboolean
    as_app_parse_file (AsApp *app,
                       const gchar *filename,
                       AsAppParseFlags flags,
                       GError **error);

Parses a desktop or AppData file and populates the application state.

Applications that are not suitable for the store will have vetos added.

#### Parameters

app | a AsApp instance. |
filename | file to load. |
flags | AsAppParseFlags, e.g. `AS_APP_PARSE_FLAG_USE_HEURISTICS` |
error | A GError or `NULL`. |

#### Returns

`TRUE` for success

Since 0.1.2

### as_app_to_file ()

    gboolean
    as_app_to_file (AsApp *app,
                    GFile *file,
                    GCancellable *cancellable,
                    GError **error);

Exports a DOM tree to an XML file.

#### Parameters

app | a AsApp instance. |
file | a GFile |
cancellable | A GCancellable, or `NULL` |
error | A GError or `NULL` |

#### Returns

`TRUE` for success

Since 0.2.0

## Types and Values

### enum AsAppParseFlags

The flags to use when parsing resources.

#### Members

AS_APP_PARSE_FLAG_NONE | No special actions to use |
AS_APP_PARSE_FLAG_USE_HEURISTICS | Use heuristic to infer properties |
AS_APP_PARSE_FLAG_KEEP_COMMENTS | Save comments from the file |
AS_APP_PARSE_FLAG_CONVERT_TRANSLATABLE | Allow translatable flags like <_p> |
AS_APP_PARSE_FLAG_APPEND_DATA | Append new data rather than replacing |
AS_APP_PARSE_FLAG_ALLOW_VETO | Do not return errors for vetoed apps |

### enum AsAppSubsumeFlags

The flags to use when subsuming applications.

#### Members

AS_APP_SUBSUME_FLAG_NONE | No special actions to use |
AS_APP_SUBSUME_FLAG_NO_OVERWRITE | Do not overwrite already set properties |
AS_APP_SUBSUME_FLAG_BOTH_WAYS | Copy unset properties both ways |
AS_APP_SUBSUME_FLAG_PARTIAL | Only subsume a safe subset |

### enum AsAppError

The error type.

#### Members

AS_APP_ERROR_FAILED | Generic failure |
AS_APP_ERROR_INVALID_TYPE | Invalid type |

### enum AsAppValidateFlags

The flags to use when validating.

#### Members

AS_APP_VALIDATE_FLAG_NONE | No extra flags to use |
AS_APP_VALIDATE_FLAG_RELAX | Relax the checks |
AS_APP_VALIDATE_FLAG_STRICT | Make the checks more strict |
AS_APP_VALIDATE_FLAG_NO_NETWORK | Do not use the network |

### enum AsAppTrustFlags

The flags to use when checking input.

#### Members

AS_APP_TRUST_FLAG_COMPLETE | Trusted data with no validation |
AS_APP_TRUST_FLAG_CHECK_DUPLICATES | Check for duplicates |
AS_APP_TRUST_FLAG_CHECK_VALID_UTF8 | Check for valid UTF-8 |

### enum AsAppSourceKind

The source kind.

#### Members

AS_APP_SOURCE_KIND_UNKNOWN | Not sourced from a file |
AS_APP_SOURCE_KIND_APPSTREAM | Sourced from a AppStream file |
AS_APP_SOURCE_KIND_DESKTOP | Sourced from a desktop file |
AS_APP_SOURCE_KIND_APPDATA | Sourced from a AppData file |
AS_APP_SOURCE_KIND_METAINFO | Sourced from a MetaInfo file |

### enum AsAppState

The application state.

#### Members

AS_APP_STATE_UNKNOWN | Unknown state |
AS_APP_STATE_INSTALLED | Application is installed |
AS_APP_STATE_AVAILABLE | Application is available |
AS_APP_STATE_AVAILABLE_LOCAL | Application is locally available as a file |
AS_APP_STATE_UPDATABLE | Application is installed and updatable |
AS_APP_STATE_UNAVAILABLE | Application is referenced, but not available |
AS_APP_STATE_QUEUED_FOR_INSTALL | Application is queued for install |
AS_APP_STATE_INSTALLING | Application is being installed |
AS_APP_STATE_REMOVING | Application is being removed |

### AS_APP_ERROR

    #define AS_APP_ERROR				as_app_error_quark ()