AsProvided: AppStream Library Reference Manual

## AsProvided AsProvided — Description of the provided-items in components |

## Functions

const gchar * | as_provided_kind_to_string ()
AsProvidedKind | as_provided_kind_from_string ()
const gchar * | as_provided_kind_to_l10n_string ()
AsProvided * | as_provided_new ()
AsProvidedKind | as_provided_get_kind ()
void | as_provided_set_kind ()
GPtrArray * | as_provided_get_items ()
void | as_provided_add_item ()
gboolean | as_provided_has_item ()

## Types and Values

#define | AS_TYPE_PROVIDED
struct | AsProvidedClass
enum | AsProvidedKind
#define | AS_PROVIDED_KIND_MIMETYPE
| AsProvided

## Includes

    #include <appstream.h>

## Description

Components can provide various items, like libraries, Python-modules, firmware, binaries, etc. Functions to work with these items are provided here.

See also: AsComponent

## Functions

### as_provided_kind_to_string ()

    const gchar *
    as_provided_kind_to_string (AsProvidedKind kind);

Converts the enumerated value to a text representation.

#### Parameters

kind | the AsProvidedKind. |

#### Returns

string version of `kind`

### as_provided_kind_from_string ()

    AsProvidedKind
    as_provided_kind_from_string (const gchar *kind_str);

Converts the text representation to an enumerated value.

#### Parameters

kind_str | the string. |

#### Returns

a AsProvidedKind or `AS_PROVIDED_KIND_UNKNOWN` for unknown

### as_provided_kind_to_l10n_string ()

    const gchar *
    as_provided_kind_to_l10n_string (AsProvidedKind kind);

Converts the enumerated value to a localized text representation, using the plural forms (e.g. "Libraries" instead of "Library").

This can be useful when displaying provided items in GUI dialogs.

#### Parameters

kind | the AsProvidedKind. |

#### Returns

Pluralized, l10n string version of `kind`

### as_provided_new ()

    AsProvided *
    as_provided_new (void);

Creates a new AsProvided.

#### Returns

a AsProvided.

[transfer full]

### as_provided_get_kind ()

    AsProvidedKind
    as_provided_get_kind (AsProvided *prov);

The kind of items this AsProvided object stores.

#### Parameters

prov | a AsProvided instance. |

#### Returns

an enum of type AsProvidedKind

### as_provided_set_kind ()

    void
    as_provided_set_kind (AsProvided *prov,
                          AsProvidedKind kind);

Set the kind of items this AsProvided object stores.

#### Parameters

prov | a AsProvided instance. |
kind | the new AsProvidedKind |

### as_provided_get_items ()

    GPtrArray *
    as_provided_get_items (AsProvided *prov);

Get an array of provided data.

#### Parameters

prov | a AsProvided instance. |

#### Returns

An string list of provided items.

[transfer none][element-type utf8]

### as_provided_add_item ()

    void
    as_provided_add_item (AsProvided *prov,
                          const gchar *item);

Add a new provided item.

#### Parameters

prov | a AsProvided instance. |

### as_provided_has_item ()

    gboolean
    as_provided_has_item (AsProvided *prov,
                          const gchar *item);

Check if the current AsProvided contains an item of the given name.

#### Parameters

prov | a AsProvided instance. |
item | the name of a provided item, e.g. "audio/x-vorbis" (in case the provided kind is a mimetype) |

#### Returns

`TRUE` if found.

## Types and Values

### AS_TYPE_PROVIDED

    #define AS_TYPE_PROVIDED (as_provided_get_type ())

### struct AsProvidedClass

    struct AsProvidedClass {
    	GObjectClass		parent_class;
    };

### enum AsProvidedKind

Type of the public interface components can provide.

#### Members

AS_PROVIDED_KIND_UNKNOWN | Unknown kind |
AS_PROVIDED_KIND_LIBRARY | A shared library |
AS_PROVIDED_KIND_BINARY | A binary installed into a directory in PATH |
AS_PROVIDED_KIND_MEDIATYPE | Provides a handler for a mimetype |
AS_PROVIDED_KIND_FONT | A font |
AS_PROVIDED_KIND_MODALIAS | A modalias |
AS_PROVIDED_KIND_PYTHON_2 | A Python2 module |
AS_PROVIDED_KIND_PYTHON | A Python3 module |
AS_PROVIDED_KIND_DBUS_SYSTEM | A DBus service name on the system bus. |
AS_PROVIDED_KIND_DBUS_USER | A DBus service name on the user/session bus. |
AS_PROVIDED_KIND_FIRMWARE_RUNTIME | Firmware flashed at runtime. |
AS_PROVIDED_KIND_FIRMWARE_FLASHED | Firmware flashed permanently to the device. |
AS_PROVIDED_KIND_ID | An AppStream component |

### AS_PROVIDED_KIND_MIMETYPE

    #define AS_PROVIDED_KIND_MIMETYPE AS_PROVIDED_KIND_MEDIATYPE

### AsProvided

    typedef struct _AsProvided AsProvided;