Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

appinfo.h File Reference

Parsing an applications AppInfo.xml file. More...

#include <glib.h>
#include <glib-object.h>
#include <libxml/parser.h>

Data Structures

struct  ROXAppInfo
 Type used to store a parsed AppInfo file. More...

Defines

#define ROX_APPINFO(obj)   G_TYPE_CHECK_INSTANCE_CAST (obj, rox_appinfo_get_type (), ROXAppInfo)
#define ROX_APPINFO_CLASS(klass)   G_TYPE_CHECK_CLASS_CAST (klass, rox_appinfo_get_type (), ROXAppinfoClass)
#define ROX_IS_APPINFO(obj)   G_TYPE_CHECK_INSTANCE_TYPE (obj, rox_appinfo_get_type ())

Functions

GType rox_appinfo_get_type (void)
GObject * rox_appinfo_new (void)
void rox_appinfo_set_language (ROXAppInfo *ai, const gchar *lang)
const gchar * rox_appinfo_get_language (ROXAppInfo *ai)
const gchar * rox_appinfo_get_summary (ROXAppInfo *ai)
gchar * rox_appinfo_get_about (ROXAppInfo *ai, const gchar *lbl)
gchar * rox_appinfo_get_about_label (ROXAppInfo *ai, const gchar *lbl)
const xmlNode * rox_appinfo_get_element (ROXAppInfo *ai, const gchar *element)
GList * rox_appinfo_get_mime_type_list (ROXAppInfo *ai, const gchar *element)
void rox_appinfo_free_mime_type_list (GList *)
GList * rox_appinfo_get_can_run_list (ROXAppInfo *ai)
GList * rox_appinfo_get_can_thumbnail_list (ROXAppInfo *ai)


Detailed Description

Parsing an applications AppInfo.xml file.


Define Documentation

#define ROX_APPINFO obj   )     G_TYPE_CHECK_INSTANCE_CAST (obj, rox_appinfo_get_type (), ROXAppInfo)
 

Cast pointer into a pointer to ROXAppInfo only if it is valid, otherwise return NULL

Parameters:
[in] obj pointer to object
Returns:
pointer to ROXAppInfo or NULL for error

#define ROX_APPINFO_CLASS klass   )     G_TYPE_CHECK_CLASS_CAST (klass, rox_appinfo_get_type (), ROXAppinfoClass)
 

Cast pointer into a pointer to ROXAppInfo class only if it is valid, otherwise return NULL

Parameters:
[in] klass pointer to object class
Returns:
pointer to ROXAppInfo class or NULL for error

#define ROX_IS_APPINFO obj   )     G_TYPE_CHECK_INSTANCE_TYPE (obj, rox_appinfo_get_type ())
 

Check a pointer to ROXAppInfo

Parameters:
[in] obj pointer to object
Returns:
non-zero if a pointer to a ROXAppInfo


Function Documentation

void rox_appinfo_free_mime_type_list GList *  list  ) 
 

Free MIME type list.

Parameters:
[in,out] list MIME type list.

gchar* rox_appinfo_get_about ROXAppInfo ai,
const gchar *  lbl
 

Get the contents of the named element from the About node in the currently set language, or the neutral language (ROXAppInfo.about_no_lang) if that fails.

Parameters:
[in] ai parsed AppInfo file
[in] lbl name of element in About to fetch
Returns:
contents of the element, pass to g_free() when done.

gchar* rox_appinfo_get_about_label ROXAppInfo ai,
const gchar *  lbl
 

Get the label for the named element from the About node in the currently set language, or the neutral language (ROXAppInfo.about_no_lang) if that fails.

Parameters:
[in] ai parsed AppInfo file
[in] lbl name of element in About to fetch
Returns:
label for the element, pass to g_free() when done.

GList* rox_appinfo_get_can_run_list ROXAppInfo ai  ) 
 

Return list of types that the application has declared it can run. Equivalent to rox_appinfo_get_mime_type_list(ai, "CanRun").

Parameters:
[in] ai parsed AppInfo file
Returns:
list of MIMEType items, pass to rox_appinfo_free_mime_type_list() when done

GList* rox_appinfo_get_can_thumbnail_list ROXAppInfo ai  ) 
 

Return list of types that the application has declared it can generate thumbnails images for.. Equivalent to rox_appinfo_get_mime_type_list(ai, "CanThumbnail").

Parameters:
[in] ai parsed AppInfo file
Returns:
list of MIMEType items, pass to rox_appinfo_free_mime_type_list() when done

const xmlNode* rox_appinfo_get_element ROXAppInfo ai,
const gchar *  element
 

Get the named element from the AppInfo file

Parameters:
[in] ai parsed AppInfo file
[in] element name of element to fetch
Returns:
the elment

const gchar* rox_appinfo_get_language ROXAppInfo ai  ) 
 

Get the language used for scanning the AppInfo document.

Parameters:
[in,out] ai parsed AppInfo file
Returns:
the language code, e.g. en_GB

GList* rox_appinfo_get_mime_type_list ROXAppInfo ai,
const gchar *  element
 

From the named element from the AppInfo file return a list of MIME types

Parameters:
[in] ai parsed AppInfo file
[in] element name of element to fetch
Returns:
list of MIMEType items, pass to rox_appinfo_free_mime_type_list() when done

const gchar* rox_appinfo_get_summary ROXAppInfo ai  ) 
 

Get the contents of the Summary element in the currently set language.

Parameters:
[in] ai parsed AppInfo file
Returns:
the summary

GType rox_appinfo_get_type void   ) 
 

Returns:
GType code for the ROXAppInfo type.

GObject* rox_appinfo_new void   ) 
 

Construct a new ROXAppInfo object for the current application.

Returns:
pointer to new ROXAppInfo object, or NULL if the application does not have an AppInfo.xml file.

void rox_appinfo_set_language ROXAppInfo ai,
const gchar *  lang
 

Set the language used for scanning the AppInfo document. This updates ROXAppInfo.pref_lang, ROXAppInfo.summary, ROXAppInfo.about and ROXAppInfo.about_no_lang

Parameters:
[in,out] ai parsed AppInfo file
[in] lang language code, e.g. en_GB


Generated on Fri Nov 24 16:19:58 2006 for ROX-CLib by  doxygen 1.4.4