AsComponent

AsComponent — Object representing a software component

Synopsis

#include <appstream.h>

struct              AsComponent;
struct              AsComponentClass;
enum                AsComponentKind;
const gchar *       as_component_kind_to_string         (AsComponentKind kind);
AsComponentKind     as_component_kind_from_string       (const gchar *kind_str);
AsComponent *       as_component_new                    (void);
AsComponent *       as_component_construct              (GType object_type);
gboolean            as_component_is_valid               (AsComponent *self);
gchar *             as_component_to_string              (AsComponent *self);
gboolean            as_component_provides_item          (AsComponent *self,
                                                         AsProvidesKind kind,
                                                         const gchar *value);
AsComponentKind     as_component_get_kind               (AsComponent *self);
const gchar *       as_component_get_pkgname            (AsComponent *self);
const gchar *       as_component_get_idname             (AsComponent *self);
const gchar *       as_component_get_name               (AsComponent *self);
const gchar *       as_component_get_name_original      (AsComponent *self);
const gchar *       as_component_get_project_license    (AsComponent *self);
const gchar *       as_component_get_project_group      (AsComponent *self);
gchar **            as_component_get_compulsory_for_desktops
                                                        (AsComponent *self);
const gchar *       as_component_get_summary            (AsComponent *self);
gchar **            as_component_get_categories         (AsComponent *self);
GPtrArray *         as_component_get_screenshots        (AsComponent *self);
const gchar *       as_component_get_description        (AsComponent *self);
gchar **            as_component_get_keywords           (AsComponent *self);
const gchar *       as_component_get_icon               (AsComponent *self);
const gchar *       as_component_get_icon_url           (AsComponent *self);
const gchar *       as_component_get_homepage           (AsComponent *self);
gchar **            as_component_get_mimetypes          (AsComponent *self);
GPtrArray *         as_component_get_provided_items     (AsComponent *self);
GPtrArray *         as_component_get_releases           (AsComponent *self);
void                as_component_add_screenshot         (AsComponent *self,
                                                         AsScreenshot *sshot);
void                as_component_add_release            (AsComponent *self,
                                                         AsRelease *release);
void                as_component_set_categories_from_str
                                                        (AsComponent *self,
                                                         const gchar *categories_str);
void                as_component_set_kind               (AsComponent *self,
                                                         AsComponentKind value);
void                as_component_set_name               (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_keywords           (AsComponent *self,
                                                         gchar **value);
void                as_component_set_mimetypes          (AsComponent *self,
                                                         gchar **value);
void                as_component_set_compulsory_for_desktops
                                                        (AsComponent *self,
                                                         gchar **value);
void                as_component_set_pkgname            (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_idname             (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_name_original      (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_summary            (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_description        (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_homepage           (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_icon               (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_icon_url           (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_project_license    (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_project_group      (AsComponent *self,
                                                         const gchar *value);
void                as_component_set_categories         (AsComponent *self,
                                                         gchar **value);

Object Hierarchy

  GObject
   +----AsComponent
  GEnum
   +----AsComponentKind

Properties

  "categories"               GStrv                 : Read / Write
  "description"              gchar*                : Read / Write
  "homepage"                 gchar*                : Read / Write
  "icon"                     gchar*                : Read / Write
  "icon-url"                 gchar*                : Read / Write
  "idname"                   gchar*                : Read / Write
  "keywords"                 GStrv                 : Read / Write
  "kind"                     AsComponentKind       : Read / Write
  "mimetypes"                GStrv                 : Read / Write
  "name"                     gchar*                : Read / Write
  "name-original"            gchar*                : Read / Write
  "pkgname"                  gchar*                : Read / Write
  "project-license"          gchar*                : Read / Write
  "screenshots"              GPtrArray*            : Read
  "summary"                  gchar*                : Read / Write

Description

This object represents an Appstream software component which is associated to a package in the distribution's repositories. A component can be anything, ranging from an application to a font, a codec or even a non-visual software project providing libraries and python-modules for other applications to use.

The type of the component is stored as AsComponentKind and can be queried to find out which kind of component we're dealing with.

See also: AsProvidesKind, AsDatabase

Details

struct AsComponent

struct AsComponent;


struct AsComponentClass

struct AsComponentClass {
	GObjectClass parent_class;
};


enum AsComponentKind

typedef enum {
	AS_COMPONENT_KIND_UNKNOWN,
	AS_COMPONENT_KIND_GENERIC,
	AS_COMPONENT_KIND_DESKTOP_APP,
	AS_COMPONENT_KIND_FONT,
	AS_COMPONENT_KIND_CODEC,
	AS_COMPONENT_KIND_INPUTMETHOD,
	AS_COMPONENT_KIND_LAST
} AsComponentKind;

AS_COMPONENT_KIND_UNKNOWN

AS_COMPONENT_KIND_GENERIC

AS_COMPONENT_KIND_DESKTOP_APP

AS_COMPONENT_KIND_FONT

AS_COMPONENT_KIND_CODEC

AS_COMPONENT_KIND_INPUTMETHOD

AS_COMPONENT_KIND_LAST


as_component_kind_to_string ()

const gchar *       as_component_kind_to_string         (AsComponentKind kind);

Converts the enumerated value to an text representation.

kind :

the AsComponentKind.

Returns :

string version of kind

as_component_kind_from_string ()

AsComponentKind     as_component_kind_from_string       (const gchar *kind_str);

Converts the text representation to an enumerated value.

kind_str :

the string.

Returns :

a AsComponentKind or AS_COMPONENT_KIND_UNKNOWN for unknown

as_component_new ()

AsComponent *       as_component_new                    (void);

Creates a new AsComponent.

Returns :

an AsComponent. [transfer full]

as_component_construct ()

AsComponent *       as_component_construct              (GType object_type);


as_component_is_valid ()

gboolean            as_component_is_valid               (AsComponent *self);

Check if the essential properties of this Component are populated with useful data.

Returns :

TRUE if the component data was validated successfully.

as_component_to_string ()

gchar *             as_component_to_string              (AsComponent *self);

Returns a string identifying this component. (useful for debugging)

Returns :

A descriptive string. [transfer full]

as_component_provides_item ()

gboolean            as_component_provides_item          (AsComponent *self,
                                                         AsProvidesKind kind,
                                                         const gchar *value);

Checks if this component provides an item of the specified type

self a valid AsComponent kind the kind of the provides-item value the value of the provides-item

Returns :

TRUE if an item was found

as_component_get_kind ()

AsComponentKind     as_component_get_kind               (AsComponent *self);


as_component_get_pkgname ()

const gchar *       as_component_get_pkgname            (AsComponent *self);


as_component_get_idname ()

const gchar *       as_component_get_idname             (AsComponent *self);


as_component_get_name ()

const gchar *       as_component_get_name               (AsComponent *self);


as_component_get_name_original ()

const gchar *       as_component_get_name_original      (AsComponent *self);


as_component_get_project_license ()

const gchar *       as_component_get_project_license    (AsComponent *self);

Get the license of the project this component belongs to.


as_component_get_project_group ()

const gchar *       as_component_get_project_group      (AsComponent *self);

Get the component's project group.


as_component_get_compulsory_for_desktops ()

gchar **            as_component_get_compulsory_for_desktops
                                                        (AsComponent *self);

Returns :

A list of desktops where this component is compulsory. [transfer none]

as_component_get_summary ()

const gchar *       as_component_get_summary            (AsComponent *self);


as_component_get_categories ()

gchar **            as_component_get_categories         (AsComponent *self);


as_component_get_screenshots ()

GPtrArray *         as_component_get_screenshots        (AsComponent *self);

Get a list of associated screenshots.

Returns :

an array of AsScreenshot instances. [element-type AsScreenshot][transfer none]

as_component_get_description ()

const gchar *       as_component_get_description        (AsComponent *self);


as_component_get_keywords ()

gchar **            as_component_get_keywords           (AsComponent *self);


as_component_get_icon ()

const gchar *       as_component_get_icon               (AsComponent *self);


as_component_get_icon_url ()

const gchar *       as_component_get_icon_url           (AsComponent *self);


as_component_get_homepage ()

const gchar *       as_component_get_homepage           (AsComponent *self);


as_component_get_mimetypes ()

gchar **            as_component_get_mimetypes          (AsComponent *self);


as_component_get_provided_items ()

GPtrArray *         as_component_get_provided_items     (AsComponent *self);

Get an array of the provides-items this component is associated with.

Returns :

A list of desktops where this component is compulsory. [element-type utf8][transfer none]

as_component_get_releases ()

GPtrArray *         as_component_get_releases           (AsComponent *self);

Get an array of the AsRelease items this component provides.

Returns :

A list of releases. [element-type AsRelease][transfer none]

as_component_add_screenshot ()

void                as_component_add_screenshot         (AsComponent *self,
                                                         AsScreenshot *sshot);

Add an AsScreenshot to this component.

self :

a AsComponent instance.

sshot :

The AsScreenshot to add

as_component_add_release ()

void                as_component_add_release            (AsComponent *self,
                                                         AsRelease *release);

Add an AsRelease to this component.

self :

a AsComponent instance.

release :

The AsRelease to add

as_component_set_categories_from_str ()

void                as_component_set_categories_from_str
                                                        (AsComponent *self,
                                                         const gchar *categories_str);

Set the categories list from a string

self a valid AsComponent instance categories_str Comma-separated list of category-names


as_component_set_kind ()

void                as_component_set_kind               (AsComponent *self,
                                                         AsComponentKind value);


as_component_set_name ()

void                as_component_set_name               (AsComponent *self,
                                                         const gchar *value);


as_component_set_keywords ()

void                as_component_set_keywords           (AsComponent *self,
                                                         gchar **value);


as_component_set_mimetypes ()

void                as_component_set_mimetypes          (AsComponent *self,
                                                         gchar **value);


as_component_set_compulsory_for_desktops ()

void                as_component_set_compulsory_for_desktops
                                                        (AsComponent *self,
                                                         gchar **value);

Set a list of desktops where this component is compulsory.


as_component_set_pkgname ()

void                as_component_set_pkgname            (AsComponent *self,
                                                         const gchar *value);


as_component_set_idname ()

void                as_component_set_idname             (AsComponent *self,
                                                         const gchar *value);


as_component_set_name_original ()

void                as_component_set_name_original      (AsComponent *self,
                                                         const gchar *value);


as_component_set_summary ()

void                as_component_set_summary            (AsComponent *self,
                                                         const gchar *value);


as_component_set_description ()

void                as_component_set_description        (AsComponent *self,
                                                         const gchar *value);


as_component_set_homepage ()

void                as_component_set_homepage           (AsComponent *self,
                                                         const gchar *value);


as_component_set_icon ()

void                as_component_set_icon               (AsComponent *self,
                                                         const gchar *value);


as_component_set_icon_url ()

void                as_component_set_icon_url           (AsComponent *self,
                                                         const gchar *value);


as_component_set_project_license ()

void                as_component_set_project_license    (AsComponent *self,
                                                         const gchar *value);

Set the project license.


as_component_set_project_group ()

void                as_component_set_project_group      (AsComponent *self,
                                                         const gchar *value);

Set the component's project group.


as_component_set_categories ()

void                as_component_set_categories         (AsComponent *self,
                                                         gchar **value);

Property Details

The "categories" property

  "categories"               GStrv                 : Read / Write

categories.


The "description" property

  "description"              gchar*                : Read / Write

description.

Default value: NULL


The "homepage" property

  "homepage"                 gchar*                : Read / Write

homepage.

Default value: NULL


The "icon" property

  "icon"                     gchar*                : Read / Write

icon.

Default value: NULL


The "icon-url" property

  "icon-url"                 gchar*                : Read / Write

icon-url.

Default value: NULL


The "idname" property

  "idname"                   gchar*                : Read / Write

idname.

Default value: NULL


The "keywords" property

  "keywords"                 GStrv                 : Read / Write

keywords.


The "kind" property

  "kind"                     AsComponentKind       : Read / Write

kind.

Default value: AS_COMPONENT_KIND_UNKNOWN


The "mimetypes" property

  "mimetypes"                GStrv                 : Read / Write

mimetypes.


The "name" property

  "name"                     gchar*                : Read / Write

name.

Default value: NULL


The "name-original" property

  "name-original"            gchar*                : Read / Write

name-original.

Default value: NULL


The "pkgname" property

  "pkgname"                  gchar*                : Read / Write

pkgname.

Default value: NULL


The "project-license" property

  "project-license"          gchar*                : Read / Write

project-license.

Default value: NULL


The "screenshots" property

  "screenshots"              GPtrArray*            : Read

screenshots.


The "summary" property

  "summary"                  gchar*                : Read / Write

summary.

Default value: NULL