AppstreamCategory

AppstreamCategory — Description of an XDG Menu category

Synopsis

#define             APPSTREAM_TYPE_CATEGORY
void                appstream_category_add_subcategory  (AppstreamCategory *self,
                                                         AppstreamCategory *cat);
void                appstream_category_remove_subcategory
                                                        (AppstreamCategory *self,
                                                         AppstreamCategory *cat);
gboolean            appstream_category_has_subcategory  (AppstreamCategory *self);
AppstreamCategory * appstream_category_new              (void);
const gchar *       appstream_category_get_name         (AppstreamCategory *self);
const gchar *       appstream_category_get_summary      (AppstreamCategory *self);
const gchar *       appstream_category_get_icon         (AppstreamCategory *self);
const gchar *       appstream_category_get_directory    (AppstreamCategory *self);
GList *             appstream_category_get_included     (AppstreamCategory *self);
GList *             appstream_category_get_excluded     (AppstreamCategory *self);
gint                appstream_category_get_level        (AppstreamCategory *self);
GList *             appstream_category_get_subcategories
                                                        (AppstreamCategory *self);
struct              AppstreamCategory;
struct              AppstreamCategoryClass;
#define             APPSTREAM_TYPE_MENU_PARSER
GList *             appstream_menu_parser_parse         (AppstreamMenuParser *self);
AppstreamMenuParser * appstream_menu_parser_new         (void);
AppstreamMenuParser * appstream_menu_parser_new_from_file
                                                        (const gchar *menu_file);
gboolean            appstream_menu_parser_get_update_category_data
                                                        (AppstreamMenuParser *self);
void                appstream_menu_parser_set_update_category_data
                                                        (AppstreamMenuParser *self,
                                                         gboolean value);
struct              AppstreamMenuParser;
gpointer            appstream_menu_parser_ref           (gpointer instance);
void                appstream_menu_parser_unref         (gpointer instance);
GParamSpec *        appstream_param_spec_menu_parser    (const gchar *name,
                                                         const gchar *nick,
                                                         const gchar *blurb,
                                                         GType object_type,
                                                         GParamFlags flags);
void                appstream_value_set_menu_parser     (GValue *value,
                                                         gpointer v_object);
gpointer            appstream_value_get_menu_parser     (const GValue *value);
void                appstream_value_take_menu_parser    (GValue *value,
                                                         gpointer v_object);
struct              AppstreamMenuParserClass;
GList *             appstream_get_system_categories     (void);

Description

Details

APPSTREAM_TYPE_CATEGORY

#define APPSTREAM_TYPE_CATEGORY (appstream_category_get_type ())

The type for AppstreamCategory.


appstream_category_add_subcategory ()

void                appstream_category_add_subcategory  (AppstreamCategory *self,
                                                         AppstreamCategory *cat);

self :

the AppstreamCategory instance

cat :

 

appstream_category_remove_subcategory ()

void                appstream_category_remove_subcategory
                                                        (AppstreamCategory *self,
                                                         AppstreamCategory *cat);

self :

the AppstreamCategory instance

cat :

 

appstream_category_has_subcategory ()

gboolean            appstream_category_has_subcategory  (AppstreamCategory *self);

self :

the AppstreamCategory instance

Returns :

TRUE if this category has any subcategory

appstream_category_new ()

AppstreamCategory * appstream_category_new              (void);

appstream_category_get_name ()

const gchar *       appstream_category_get_name         (AppstreamCategory *self);

Get and return the current value of the "name" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "name" property

appstream_category_get_summary ()

const gchar *       appstream_category_get_summary      (AppstreamCategory *self);

Get and return the current value of the "summary" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "summary" property

appstream_category_get_icon ()

const gchar *       appstream_category_get_icon         (AppstreamCategory *self);

Get and return the current value of the "icon" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "icon" property

appstream_category_get_directory ()

const gchar *       appstream_category_get_directory    (AppstreamCategory *self);

Get and return the current value of the "directory" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "directory" property

appstream_category_get_included ()

GList *             appstream_category_get_included     (AppstreamCategory *self);

Get and return the current value of the "included" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "included" property

appstream_category_get_excluded ()

GList *             appstream_category_get_excluded     (AppstreamCategory *self);

Get and return the current value of the "excluded" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "excluded" property

appstream_category_get_level ()

gint                appstream_category_get_level        (AppstreamCategory *self);

Get and return the current value of the "level" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "level" property

appstream_category_get_subcategories ()

GList *             appstream_category_get_subcategories
                                                        (AppstreamCategory *self);

Get and return the current value of the "subcategories" property.

self :

the AppstreamCategory instance to query

Returns :

the value of the "subcategories" property

struct AppstreamCategory

struct AppstreamCategory {
	GObject parent_instance;
	AppstreamCategoryPrivate * priv;
};

Description of an XDG Menu category


struct AppstreamCategoryClass

struct AppstreamCategoryClass {
	GObjectClass parent_class;
};

The class structure for APPSTREAM_TYPE_CATEGORY. All the fields in this structure are private and should never be accessed directly.

GObjectClass parent_class;

the parent class structure

APPSTREAM_TYPE_MENU_PARSER

#define APPSTREAM_TYPE_MENU_PARSER (appstream_menu_parser_get_type ())

The type for AppstreamMenuParser.


appstream_menu_parser_parse ()

GList *             appstream_menu_parser_parse         (AppstreamMenuParser *self);

Parse the menu file

self :

the AppstreamMenuParser instance

Returns :

GList of Category objects found in the Menu, or NULL if there was an error

appstream_menu_parser_new ()

AppstreamMenuParser * appstream_menu_parser_new         (void);

Create a new MenuParser for the generic AppStream categories list


appstream_menu_parser_new_from_file ()

AppstreamMenuParser * appstream_menu_parser_new_from_file
                                                        (const gchar *menu_file);

Create a new MenuParser for an arbitrary menu file

menu_file :

 

appstream_menu_parser_get_update_category_data ()

gboolean            appstream_menu_parser_get_update_category_data
                                                        (AppstreamMenuParser *self);

Get and return the current value of the "update-category-data" property.

self :

the AppstreamMenuParser instance to query

Returns :

the value of the "update-category-data" property

appstream_menu_parser_set_update_category_data ()

void                appstream_menu_parser_set_update_category_data
                                                        (AppstreamMenuParser *self,
                                                         gboolean value);

Set the value of the "update-category-data" property to value.

self :

the AppstreamMenuParser instance to modify

value :

the new value of the "update-category-data" property

struct AppstreamMenuParser

struct AppstreamMenuParser {
	GTypeInstance parent_instance;
	volatile int ref_count;
	AppstreamMenuParserPrivate * priv;
};

Parser for XDG Menu files


appstream_menu_parser_ref ()

gpointer            appstream_menu_parser_ref           (gpointer instance);

Increases the reference count of object.

instance :

a AppstreamMenuParser.

Returns :

the same object

appstream_menu_parser_unref ()

void                appstream_menu_parser_unref         (gpointer instance);

Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

instance :

a AppstreamMenuParser.

appstream_param_spec_menu_parser ()

GParamSpec *        appstream_param_spec_menu_parser    (const gchar *name,
                                                         const gchar *nick,
                                                         const gchar *blurb,
                                                         GType object_type,
                                                         GParamFlags flags);

Creates a new GParamSpecBoxed instance specifying a APPSTREAM_TYPE_MENU_PARSER derived property.

See g_param_spec_internal() for details on property names.

name :

canonical name of the property specified

nick :

nick name for the property specified

blurb :

description of the property specified

object_type :

APPSTREAM_TYPE_MENU_PARSER derived type of this property

flags :

flags for the property specified

appstream_value_set_menu_parser ()

void                appstream_value_set_menu_parser     (GValue *value,
                                                         gpointer v_object);

Set the contents of a APPSTREAM_TYPE_MENU_PARSER derived GValue to v_object.

appstream_value_set_menu_parser() increases the reference count of v_object (the GValue holds a reference to v_object). If you do not wish to increase the reference count of the object (i.e. you wish to pass your current reference to the GValue because you no longer need it), use appstream_value_take_menu_parser() instead.

It is important that your GValue holds a reference to v_object (either its own, or one it has taken) to ensure that the object won't be destroyed while the GValue still exists).

value :

a valid GValue of APPSTREAM_TYPE_MENU_PARSER derived type

v_object :

object value to be set

appstream_value_get_menu_parser ()

gpointer            appstream_value_get_menu_parser     (const GValue *value);

Get the contents of a APPSTREAM_TYPE_MENU_PARSER derived GValue.

value :

a valid GValue of APPSTREAM_TYPE_MENU_PARSER derived type

Returns :

object contents of value

appstream_value_take_menu_parser ()

void                appstream_value_take_menu_parser    (GValue *value,
                                                         gpointer v_object);

Sets the contents of a APPSTREAM_TYPE_MENU_PARSER derived GValue to v_object and takes over the ownership of the callers reference to v_object; the caller doesn't have to unref it any more (i.e. the reference count of the object is not increased).

If you want the GValue to hold its own reference to v_object, use appstream_value_set_menu_parser() instead.

value :

a valid GValue of APPSTREAM_TYPE_MENU_PARSER derived type

v_object :

object value to be set

struct AppstreamMenuParserClass

struct AppstreamMenuParserClass {
	GTypeClass parent_class;
	void (*finalize) (AppstreamMenuParser *self);
};

The class structure for APPSTREAM_TYPE_MENU_PARSER. All the fields in this structure are private and should never be accessed directly.

GTypeClass parent_class;

the parent class structure

finalize ()


appstream_get_system_categories ()

GList *             appstream_get_system_categories     (void);

Get a GList of the default AppStream categories

self :

the (null) instance