PIM Categories

PIM Categories — API functions for PIM categories.

Synopsis




struct      gpe_pim_category;
gboolean    gpe_pim_categories_init         (void);
GSList*     gpe_pim_categories_list         (void);
gboolean    gpe_pim_category_new            (const gchar *title,
                                             gint *id);
const gchar* gpe_pim_category_name          (gint id);
gboolean    gpe_pim_category_rename         (gint id,
                                             gchar *new_name);
gboolean    gpe_pim_category_set_colour     (gint id,
                                             const gchar *new_colour);
const gchar* gpe_pim_category_colour        (gint id);

Description

Set of API functions to handle GPE PIM category data. NOTE: currently all categories are global.

Details

struct gpe_pim_category

struct gpe_pim_category {
  const gchar *name;
  guint id;
  const gchar *colour;
};

A category

const gchar *name; Name of the category
guint id; Id of the category
const gchar *colour; Colour assigned to identify this category in GUI applications

gpe_pim_categories_init ()

gboolean    gpe_pim_categories_init         (void);

Initializes the category management framework.

Returns : TRUE if initialisation succeed, FALSE otherwise.

gpe_pim_categories_list ()

GSList*     gpe_pim_categories_list         (void);

Returns a list of registered categories. The elements of the list are of type gpe_pim_category

Returns : A list of registered categories.

gpe_pim_category_new ()

gboolean    gpe_pim_category_new            (const gchar *title,
                                             gint *id);

Adds a new category. id

title : Name of the category to be added.
id : Pointer to a gint to host the new category id. Must be allocated.
Returns : TRUE if the category is added, FALSE otherwise.

gpe_pim_category_name ()

const gchar* gpe_pim_category_name          (gint id);

Returns the name of the category with specified id.

id : the id of the category
Returns : the name of the category

gpe_pim_category_rename ()

gboolean    gpe_pim_category_rename         (gint id,
                                             gchar *new_name);

Rename an existing category.

id : Category id
new_name : String
Returns : TRUE on success, FALSE otherwise.

gpe_pim_category_set_colour ()

gboolean    gpe_pim_category_set_colour     (gint id,
                                             const gchar *new_colour);

Set the colour descrition for a category. Valid strings are symbolic names like 'green' or HTML-like RGB values e.g. “11FF11

id : Category id
new_colour : Colour description.
Returns : TRUE on success, FALSE otherwise.

gpe_pim_category_colour ()

const gchar* gpe_pim_category_colour        (gint id);

Get the colour assigned to the given category.

id : Category id
Returns : Colour string.