AsCategory

AsCategory — Representation of a XDG category

Functions

Properties

gpointer children Read
gchar * icon Read / Write
gchar * id Read / Write
gchar * name Read / Write
gchar * summary Read
GPtrArray * categories Read
gchar * description Read / Write
gchar * developer-name Read / Write
gpointer icons 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

Types and Values

Object Hierarchy

    GObject
    ├── AsCategory
    ╰── AsComponent

Includes

#include <appstream.h>

Description

This object represents an XDG category, as defined at: http://standards.freedesktop.org/menu-spec/menu-spec-1.0.htmlcategory-registry

The AsCategory object does not support all aspects of a menu. Its main purpose is to be used in software-centers to group visual components (gui/web applications).

You can use as_get_default_categories() to get a set of supported default categories.

See also: AsComponent

Functions

as_category_new ()

AsCategory *
as_category_new (void);

Creates a new AsCategory.

Returns

a new AsCategory.

[transfer full]


as_category_get_id ()

const gchar *
as_category_get_id (AsCategory *category);

Get the ID of this category.

Parameters

category

An instance of AsCategory.

 

as_category_set_id ()

void
as_category_set_id (AsCategory *category,
                    const gchar *id);

Set the ID of this category.

Parameters

category

An instance of AsCategory.

 

as_category_get_name ()

const gchar *
as_category_get_name (AsCategory *category);

Get the name of this category.

Parameters

category

An instance of AsCategory.

 

as_category_set_name ()

void
as_category_set_name (AsCategory *category,
                      const gchar *value);

Set the name of this category.

Parameters

category

An instance of AsCategory.

 

as_category_get_summary ()

const gchar *
as_category_get_summary (AsCategory *category);

Get the summary (short description) of this category.

Parameters

category

An instance of AsCategory.

 

as_category_set_summary ()

void
as_category_set_summary (AsCategory *category,
                         const gchar *value);

Get the summary (short description) of this category.

Parameters

category

An instance of AsCategory.

 

value

A new short summary of this category.

 

as_category_get_icon ()

const gchar *
as_category_get_icon (AsCategory *category);

Get the stock icon name for this category.

Parameters

category

An instance of AsCategory.

 

as_category_set_icon ()

void
as_category_set_icon (AsCategory *category,
                      const gchar *value);

Set the stock icon name for this category.

Parameters

category

An instance of AsCategory.

 

as_category_get_children ()

GPtrArray *
as_category_get_children (AsCategory *category);

Parameters

category

An instance of AsCategory.

 

Returns

A list of subcategories.

[element-type AsCategory][transfer none]


as_category_has_children ()

gboolean
as_category_has_children (AsCategory *category);

Test for sub-categories.

Parameters

category

An instance of AsCategory.

 

Returns

TRUE if this category has any subcategory


as_category_add_child ()

void
as_category_add_child (AsCategory *category,
                       AsCategory *subcat);

Add a subcategory to this category.

Parameters

category

An instance of AsCategory.

 

subcat

A subcategory to add.

 

as_category_remove_child ()

void
as_category_remove_child (AsCategory *category,
                          AsCategory *subcat);

Drop a subcategory from this AsCategory.

Parameters

category

An instance of AsCategory.

 

subcat

A subcategory to remove.

 

as_category_get_desktop_groups ()

GPtrArray *
as_category_get_desktop_groups (AsCategory *category);

Parameters

category

An instance of AsCategory.

 

Returns

A list of desktop-file categories.

[transfer none][element-type utf8]


as_category_add_desktop_group ()

void
as_category_add_desktop_group (AsCategory *category,
                               const gchar *group_name);

Add a desktop-file category to this AsCategory.

Parameters

category

An instance of AsCategory.

 

group_name

A subcategory to add.

 

as_category_get_components ()

GPtrArray *
as_category_get_components (AsCategory *category);

Get list of components which have been sorted into this category.

Parameters

category

An instance of AsCategory.

 

Returns

List of AsCategory.

[transfer none][element-type AsComponent]


as_category_add_component ()

void
as_category_add_component (AsCategory *category,
                           AsComponent *cpt);

Add a component to this category.

Parameters

category

An instance of AsCategory.

 

cpt

The AsComponent to add.

 

as_category_has_component ()

gboolean
as_category_has_component (AsCategory *category,
                           AsComponent *cpt);

Check if the exact AsComponent cpt is a member of this category already.

Parameters

category

An instance of AsCategory.

 

cpt

The AsComponent to look for.

 

Returns

TRUE if the component is present.


as_get_default_categories ()

GPtrArray *
as_get_default_categories (gboolean with_special);

Get a list of the default Freedesktop and AppStream categories that software components (especially GUI applications) can be sorted into in software centers.

Parameters

with_special

Include special categories (e.g. "addons", and "all"/"featured" in submenus)

 

Returns

a list of AsCategory.

[transfer container][element-type AsCategory]

Types and Values

AS_TYPE_CATEGORY

#define AS_TYPE_CATEGORY (as_category_get_type ())


struct AsCategoryClass

struct AsCategoryClass {
	GObjectClass parent_class;
};


AsCategory

typedef struct _AsCategory AsCategory;


AsComponent

typedef struct _AsComponent AsComponent;

Property Details

The “children” property

  “children”                 gpointer

children.

Flags: Read


The “icon” property

  “icon”                     gchar *

icon.

Flags: Read / Write

Default value: NULL


The “id” property

  “id”                       gchar *

id.

Flags: Read / Write

Default value: NULL


The “name” property

  “name”                     gchar *

name.

Flags: Read / Write

Default value: NULL


The “summary” property

  “summary”                  gchar *

summary.

Flags: Read

Default value: NULL


The “categories” property

  “categories”               GPtrArray *

string array of categories

Flags: Read


The “description” property

  “description”              gchar *

the description

Flags: Read / Write

Default value: NULL


The “developer-name” property

  “developer-name”           gchar *

the developer name

Flags: Read / Write

Default value: NULL


The “icons” property

  “icons”                    gpointer

hash map of icon urls and sizes

[type GList(AsIcon)]

Flags: Read


The “id” property

  “id”                       gchar *

the unique identifier

Flags: Read / Write

Default value: NULL


The “keywords” property

  “keywords”                 GStrv

string array of keywords

Flags: Read / Write


The “kind” property

  “kind”                     AsComponentKind

the AsComponentKind of this component

Flags: Read / Write

Default value: AS_COMPONENT_KIND_UNKNOWN


The “name” property

  “name”                     gchar *

the name

Flags: Read / Write

Default value: NULL


The “pkgnames” property

  “pkgnames”                 GStrv

string array of packages name

Flags: Read / Write


The “project-group” property

  “project-group”            gchar *

the project group

Flags: Read / Write

Default value: NULL


The “project-license” property

  “project-license”          gchar *

the project license

Flags: Read / Write

Default value: NULL


The “screenshots” property

  “screenshots”              GPtrArray *

screenshots.

Flags: Read


The “summary” property

  “summary”                  gchar *

the summary

Flags: Read / Write

Default value: NULL


The “urls” property

  “urls”                     GHashTable *

urls.

Flags: Read