Top | ![]() |
![]() |
![]() |
![]() |
GStrv | categories | Read / Write |
gchar * | description | Read / Write |
gchar * | developer-name | Read / Write |
GHashTable * | icon-urls | Read |
gchar * | id | Read / Write |
GStrv | keywords | Read / Write |
AsComponentKind | kind | Read / Write |
gchar * | name | Read / Write |
GStrv | pkgnames | Read / Write |
gchar * | project-group | Read / Write |
gchar * | project-license | Read / Write |
GPtrArray * | screenshots | Read |
gchar * | summary | Read / Write |
GHashTable * | urls | Read |
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
const gchar *
as_component_kind_to_string (AsComponentKind kind
);
Converts the enumerated value to an text representation.
AsComponentKind
as_component_kind_from_string (const gchar *kind_str
);
Converts the text representation to an enumerated value.
AsIconKind
as_icon_kind_from_string (const gchar *kind_str
);
Converts the text representation to an enumerated value.
const gchar *
as_icon_kind_to_string (AsIconKind kind
);
Converts the enumerated value to an text representation.
gboolean
as_component_is_valid (AsComponent *cpt
);
Check if the essential properties of this Component are populated with useful data.
gchar *
as_component_to_string (AsComponent *cpt
);
Returns a string identifying this component. (useful for debugging)
gchar *
as_component_get_active_locale (AsComponent *cpt
);
Get the current active locale for this component, which is used to get localized messages.
void as_component_set_active_locale (AsComponent *cpt
,const gchar *locale
);
Set the current active locale for this component, which is used to get localized messages. If the AsComponent was fetched from a localized database, usually only one locale is available.
AsComponentKind
as_component_get_kind (AsComponent *cpt
);
Returns the AsComponentKind of this component.
void as_component_set_kind (AsComponent *cpt
,AsComponentKind value
);
Sets the AsComponentKind of this component.
const gchar *
as_component_get_id (AsComponent *cpt
);
Set the unique identifier for this component.
void as_component_set_id (AsComponent *cpt
,const gchar *value
);
Set the unique identifier for this component.
gchar **
as_component_get_pkgnames (AsComponent *cpt
);
Get a list of package names which this component consists of. This usually is just one package name.
void as_component_set_pkgnames (AsComponent *cpt
,gchar **value
);
Set a list of package names this component consists of. (This should usually be just one package name)
const gchar *
as_component_get_source_pkgname (AsComponent *cpt
);
void as_component_set_source_pkgname (AsComponent *cpt
,const gchar *spkgname
);
const gchar *
as_component_get_name (AsComponent *cpt
);
A human-readable name for this component.
void as_component_set_name (AsComponent *cpt
,const gchar *value
,const gchar *locale
);
Set a human-readable name for this component.
cpt |
A valid AsComponent |
|
value |
The name |
|
locale |
The locale the used for this value, or |
const gchar *
as_component_get_summary (AsComponent *cpt
);
Get a short description of this component.
void as_component_set_summary (AsComponent *cpt
,const gchar *value
,const gchar *locale
);
Set a short description for this component.
cpt |
A valid AsComponent |
|
value |
The summary |
|
locale |
The locale the used for this value, or |
const gchar *
as_component_get_description (AsComponent *cpt
);
Get the localized long description of this component.
void as_component_set_description (AsComponent *cpt
,const gchar *value
,const gchar *locale
);
Set long description for this component.
cpt |
A valid AsComponent |
|
value |
The long description |
|
locale |
The locale the used for this value, or |
const gchar *
as_component_get_project_license (AsComponent *cpt
);
Get the license of the project this component belongs to.
void as_component_set_project_license (AsComponent *cpt
,const gchar *value
);
Set the project license.
const gchar *
as_component_get_project_group (AsComponent *cpt
);
Get the component's project group.
void as_component_set_project_group (AsComponent *cpt
,const gchar *value
);
Set the component's project group.
const gchar *
as_component_get_developer_name (AsComponent *cpt
);
Get the component's developer or development team name.
void as_component_set_developer_name (AsComponent *cpt
,const gchar *value
,const gchar *locale
);
Set the the component's developer or development team name.
gchar **
as_component_get_compulsory_for_desktops
(AsComponent *cpt
);
void as_component_set_compulsory_for_desktops (AsComponent *cpt
,gchar **value
);
Set a list of desktops where this component is compulsory.
gboolean as_component_is_compulsory_for_desktop (AsComponent *cpt
,const gchar *desktop
);
Check if this component is compulsory for the given desktop.
void as_component_set_categories_from_str (AsComponent *cpt
,const gchar *categories_str
);
Set the categories list from a string
cpt |
a valid AsComponent instance |
|
categories_str |
Semicolon-separated list of category-names |
gboolean as_component_has_category (AsComponent *cpt
,const gchar *category
);
Check if component is in the specified category.
GPtrArray *
as_component_get_screenshots (AsComponent *cpt
);
Get a list of associated screenshots.
void as_component_add_screenshot (AsComponent *cpt
,AsScreenshot *sshot
);
Add an AsScreenshot to this component.
void as_component_set_keywords (AsComponent *cpt
,gchar **value
,const gchar *locale
);
Set keywords for this component.
const gchar * as_component_get_icon (AsComponent *cpt
,AsIconKind kind
,int width
,int height
);
The raw icon data found for the given icon kind and size.
If the icon kind is AS_ICON_KIND_STOCK
, the size is ignored.
NULL
is returned in case no icon was found.
void as_component_add_icon (AsComponent *cpt
,AsIconKind kind
,int width
,int height
,const gchar *value
);
Add an icon of the given type to this component.
const gchar * as_component_get_icon_url (AsComponent *cpt
,int width
,int height
);
A convenience method to retrieve an icon for this component.
This method is designed to be used by software center applications,
it will always return a full path or url to a valid icon, in contrast
to the as_component_get_icon()
method, which returns unprocessed icon data.
The full url for an icon with the given width and height.
In case no icon matching the size is found, NULL
is returned.
The returned path will either be a http link or an absolute, local
path to the image file of the icon.
Since 0.7.4
void as_component_add_icon_url (AsComponent *cpt
,int width
,int height
,const gchar *value
);
Set an icon url for this component, which can be a remote or local location.
The icon_url does not end up in XML generated for this component,
it is mereley designed to be a fast way to get icon information
for a component.
If you want to set an icon which gets serialized to AppStream xml,
use the as_component_add_icon()
method instead.
cpt |
an AsComponent instance |
|
width |
An icon width |
|
height |
An icon height |
|
value |
The full icon url |
Since 0.7.4
GHashTable *
as_component_get_icon_urls (AsComponent *cpt
);
Gets the icon-urls has table for the component.
Since 0.7.4
GPtrArray *
as_component_get_provided_items (AsComponent *cpt
);
Get an array of the provides-items this component is associated with.
void as_component_add_provided_item (AsComponent *cpt
,AsProvidesKind kind
,const gchar *value
,const gchar *data
);
Adds a provided item to the component.
cpt |
a AsComponent instance. |
|
kind |
the kind of the provided item (e.g. |
|
data |
additional data associated with this item, or |
[allow-none][default NULL] |
Since 0.6.2
gboolean as_component_provides_item (AsComponent *cpt
,AsProvidesKind kind
,const gchar *value
);
Checks if this component provides an item of the specified type
cpt |
a valid AsComponent |
|
kind |
the kind of the provides-item |
|
value |
the value of the provides-item |
GHashTable *
as_component_get_urls (AsComponent *cpt
);
Gets the URLs set for the component.
Since 0.6.2
const gchar * as_component_get_url (AsComponent *cpt
,AsUrlKind url_kind
);
Gets a URL.
Since 0.6.2
void as_component_add_url (AsComponent *cpt
,AsUrlKind url_kind
,const gchar *url
);
Adds some URL data to the component.
cpt |
a AsComponent instance. |
|
url_kind |
the URL kind, e.g. |
|
url |
the full URL. |
Since 0.6.2
GPtrArray *
as_component_get_releases (AsComponent *cpt
);
Get an array of the AsRelease items this component provides.
void as_component_add_release (AsComponent *cpt
,AsRelease *release
);
Add an AsRelease to this component.
GPtrArray *
as_component_get_extends (AsComponent *cpt
);
Returns a string list of IDs of components which are extended by this addon.
Since 0.7.0
void as_component_add_extends (AsComponent *cpt
,const gchar *cpt_id
);
Add a reference to the extended component
cpt |
a AsComponent instance. |
|
cpt_id |
The id of a component which is extended by this component |
void as_component_add_language (AsComponent *cpt
,const gchar *locale
,gint percentage
);
Adds a language to the component.
cpt |
an AsComponent instance. |
|
locale |
the locale, or |
|
percentage |
the percentage completion of the translation, 0 for locales with unknown amount of translation |
Since 0.7.0
gint as_component_get_language (AsComponent *cpt
,const gchar *locale
);
Gets the translation coverage in percent for a specific locale
Since 0.7.0
GList *
as_component_get_languages (AsComponent *cpt
);
Get a list of all languages.
Since 0.7.0
GHashTable *
as_component_get_bundle_ids (AsComponent *cpt
);
Gets the bundle-ids set for the component.
Since 0.8.0
const gchar * as_component_get_bundle_id (AsComponent *cpt
,AsBundleKind bundle_kind
);
Gets a bundle identifier string.
Since 0.8.0
void as_component_add_bundle_id (AsComponent *cpt
,AsBundleKind bundle_kind
,const gchar *id
);
Adds a bundle identifier to the component.
cpt |
a AsComponent instance. |
|
bundle_kind |
the URL kind, e.g. |
|
id |
The bundle identification string |
Since 0.8.0
The URL type.
“description”
property “description” gchar *
description.
Flags: Read / Write
Default value: NULL
“developer-name”
property “developer-name” gchar *
developer-name.
Flags: Read / Write
Default value: NULL
“kind”
property“kind” AsComponentKind
kind.
Flags: Read / Write
Default value: AS_COMPONENT_KIND_UNKNOWN
“project-group”
property “project-group” gchar *
project-group.
Flags: Read / Write
Default value: NULL
“project-license”
property “project-license” gchar *
project-license.
Flags: Read / Write
Default value: NULL