AppStream-glib Reference Manual: as-enums

## as-enums as-enums — Helper functions for converting to and from enum strings |

## Stability Level

Stable, unless otherwise indicated

## Functions

const gchar * | as_id_kind_to_string ()
AsIdKind | as_id_kind_from_string ()
const gchar * | as_icon_kind_to_string ()
AsIconKind | as_icon_kind_from_string ()
const gchar * | as_url_kind_to_string ()
AsUrlKind | as_url_kind_from_string ()
const gchar * | as_kudo_kind_to_string ()
AsKudoKind | as_kudo_kind_from_string ()

## Types and Values

enum | AsIdKind
enum | AsIconKind
enum | AsUrlKind
enum | AsKudoKind

## Includes

    #include <appstream-glib.h>

## Description

These helper functions may be useful if implementing an AppStream parser.

## Functions

### as_id_kind_to_string ()

    const gchar *
    as_id_kind_to_string (AsIdKind id_kind);

Converts the enumerated value to an text representation.

#### Parameters

id_kind | the AsIdKind. |

#### Returns

string version of `id_kind`

Since 0.1.0

### as_id_kind_from_string ()

    AsIdKind
    as_id_kind_from_string (const gchar *id_kind);

Converts the text representation to an enumerated value.

#### Parameters

id_kind | the string. |

#### Returns

a AsIdKind or `AS_ID_KIND_UNKNOWN` for unknown

Since 0.1.0

### as_icon_kind_to_string ()

    const gchar *
    as_icon_kind_to_string (AsIconKind icon_kind);

Converts the enumerated value to an text representation.

#### Parameters

icon_kind | the `AsIconKind` . |

#### Returns

string version of `icon_kind`

Since 0.1.0

### as_icon_kind_from_string ()

    AsIconKind
    as_icon_kind_from_string (const gchar *icon_kind);

Converts the text representation to an enumerated value.

#### Parameters

icon_kind | the string. |

#### Returns

a AsIconKind or `AS_ICON_KIND_UNKNOWN` for unknown

Since 0.1.0

### as_url_kind_to_string ()

    const gchar *
    as_url_kind_to_string (AsUrlKind url_kind);

Converts the enumerated value to an text representation.

#### Parameters

url_kind | the `AsUrlKind` . |

#### Returns

string version of `url_kind`

Since 0.1.0

### as_url_kind_from_string ()

    AsUrlKind
    as_url_kind_from_string (const gchar *url_kind);

Converts the text representation to an enumerated value.

#### Parameters

url_kind | the string. |

#### Returns

a AsUrlKind or `AS_URL_KIND_UNKNOWN` for unknown

Since 0.1.0

### as_kudo_kind_to_string ()

    const gchar *
    as_kudo_kind_to_string (AsKudoKind kudo_kind);

Converts the enumerated value to an text representation.

#### Parameters

kudo_kind | the `AsKudoKind` . |

#### Returns

string version of `kudo_kind`

Since 0.2.2

### as_kudo_kind_from_string ()

    AsKudoKind
    as_kudo_kind_from_string (const gchar *kudo_kind);

Converts the text representation to an enumerated value.

#### Parameters

kudo_kind | the string. |

#### Returns

a AsKudoKind or `AS_KUDO_KIND_UNKNOWN` for unknown

Since 0.2.2

## Types and Values

### enum AsIdKind

The ID type.

#### Members

AS_ID_KIND_UNKNOWN | Type invalid or not known |
AS_ID_KIND_DESKTOP | A desktop application |
AS_ID_KIND_FONT | A font add-on |
AS_ID_KIND_CODEC | A codec add-on |
AS_ID_KIND_INPUT_METHOD | A input method add-on |
AS_ID_KIND_WEB_APP | A web appication |
AS_ID_KIND_SOURCE | A software source |
AS_ID_KIND_ADDON | An addon, e.g. a plugin |

### enum AsIconKind

The icon type.

#### Members

AS_ICON_KIND_UNKNOWN | Type invalid or not known |
AS_ICON_KIND_STOCK | Stock icon or present in the generic icon theme |
AS_ICON_KIND_CACHED | An icon shipped with the AppStream metadata |
AS_ICON_KIND_REMOTE | An icon referenced by a remote URL |

### enum AsUrlKind

The URL type.

#### Members

AS_URL_KIND_UNKNOWN | Type invalid or not known |
AS_URL_KIND_HOMEPAGE | Application project homepage |
AS_URL_KIND_BUGTRACKER | Application bugtracker |
AS_URL_KIND_FAQ | Application FAQ page |
AS_URL_KIND_DONATION | Application donation page |
AS_URL_KIND_HELP | Application help manual |
AS_URL_KIND_MISSING | The package is available, but missing |

### enum AsKudoKind

The kudo type.

#### Members

AS_KUDO_KIND_UNKNOWN | Type invalid or not known |
AS_KUDO_KIND_SEARCH_PROVIDER | Installs a search provider |
AS_KUDO_KIND_USER_DOCS | Installs user documentation |
AS_KUDO_KIND_APP_MENU | Uses the GNOME application menu |
AS_KUDO_KIND_MODERN_TOOLKIT | Uses a modern toolkit like GTK3 or QT5 |
AS_KUDO_KIND_NOTIFICATIONS | Registers notifications with KDE or GNOME |
AS_KUDO_KIND_HIGH_CONTRAST | Installs a high contrast icon |