KatzeItem

KatzeItem — A useful item

Functions

KatzeItem * katze_item_new ()
const gchar * katze_item_get_name ()
void katze_item_set_name ()
const gchar * katze_item_get_text ()
void katze_item_set_text ()
const gchar * katze_item_get_uri ()
void katze_item_set_uri ()
const gchar * katze_item_get_icon ()
void katze_item_set_icon ()
GdkPixbuf * katze_item_get_pixbuf ()
GtkWidget * katze_item_get_image ()
const gchar * katze_item_get_token ()
void katze_item_set_token ()
gint64 katze_item_get_added ()
void katze_item_set_added ()
GList * katze_item_get_meta_keys ()
const gchar * katze_item_get_meta_string ()
void katze_item_set_meta_string ()
gint64 katze_item_get_meta_integer ()
gboolean katze_item_get_meta_boolean ()
void katze_item_set_meta_integer ()
gpointer katze_item_get_parent ()
void katze_item_set_parent ()
KatzeItem * katze_item_copy ()

Includes

#include <katze/katze.h>

Description

KatzeItem is a particularly useful item that provides several commonly needed properties.

Functions

katze_item_new ()

KatzeItem *
katze_item_new (void);

Creates a new KatzeItem.

Returns

a new KatzeItem


katze_item_get_name ()

const gchar *
katze_item_get_name (KatzeItem *item);

Retrieves the name of item .

Parameters

item

a KatzeItem

 

Returns

the name of the item


katze_item_set_name ()

void
katze_item_set_name (KatzeItem *item,
                     const gchar *name);

Sets the name of item .

Parameters

item

a KatzeItem

 

name

a string

 

katze_item_get_text ()

const gchar *
katze_item_get_text (KatzeItem *item);

Retrieves the descriptive text of item .

Parameters

item

a KatzeItem

 

Returns

the text of the item


katze_item_set_text ()

void
katze_item_set_text (KatzeItem *item,
                     const gchar *text);

Sets the descriptive text of item .

Parameters

item

a KatzeItem

 

text

a string

 

katze_item_get_uri ()

const gchar *
katze_item_get_uri (KatzeItem *item);

Retrieves the URI of item .

Parameters

item

a KatzeItem

 

Returns

the URI of the item


katze_item_set_uri ()

void
katze_item_set_uri (KatzeItem *item,
                    const gchar *uri);

Sets the URI of item .

Parameters

item

a KatzeItem

 

uri

a string

 

katze_item_get_icon ()

const gchar *
katze_item_get_icon (KatzeItem *item);

Retrieves the icon of item .

Parameters

item

a KatzeItem

 

Returns

the icon of the item


katze_item_set_icon ()

void
katze_item_set_icon (KatzeItem *item,
                     const gchar *icon);

Sets the icon of item .

Parameters

item

a KatzeItem

 

icon

a string

 

katze_item_get_pixbuf ()

GdkPixbuf *
katze_item_get_pixbuf (KatzeItem *item,
                       GtkWidget *widget);

Creates a GdkPixbuf fit to display item .

Parameters

item

a KatzeItem

 

widget

a GtkWidget, or NULL

 

Returns

the icon of the item, or NULL.

[transfer full]

Since 0.4.6


katze_item_get_image ()

GtkWidget *
katze_item_get_image (KatzeItem *item,
                      GtkWidget *widget);

Creates a GtkImage fit to display item .

Parameters

item

a KatzeItem

 

widget

a GtkWidget, or NULL

 

Returns

the icon of the item.

[transfer floating]

Since 0.4.4


katze_item_get_token ()

const gchar *
katze_item_get_token (KatzeItem *item);

Retrieves the token of item .

Parameters

item

a KatzeItem

 

Returns

the token of the item


katze_item_set_token ()

void
katze_item_set_token (KatzeItem *item,
                      const gchar *token);

Sets the token of item .

Parameters

item

a KatzeItem

 

token

a string

 

katze_item_get_added ()

gint64
katze_item_get_added (KatzeItem *item);

Determines when item was added.

Parameters

item

a KatzeItem

 

Returns

a timestamp


katze_item_set_added ()

void
katze_item_set_added (KatzeItem *item,
                      gint64 added);

Sets when item was added.

Parameters

item

a KatzeItem

 

added

a timestamp

 

katze_item_get_meta_keys ()

GList *
katze_item_get_meta_keys (KatzeItem *item);

Retrieves a list of all meta keys.

Parameters

item

a KatzeItem

 

Returns

a newly allocated GList of constant strings.

[element-type utf8][transfer container]

Since 0.1.8


katze_item_get_meta_string ()

const gchar *
katze_item_get_meta_string (KatzeItem *item,
                            const gchar *key);

Retrieves a string value by the specified key from the meta data of the item.

Specify "namespace:key" or "key" to use the default namespace.

Parameters

item

a KatzeItem

 

key

the name of an integer value

 

Returns

a string, or NULL

Since 0.1.8


katze_item_set_meta_string ()

void
katze_item_set_meta_string (KatzeItem *item,
                            const gchar *key,
                            const gchar *value);

Saves the specified string value in the meta data of the item under the specified key.

Specify "namespace:key" or "key" to use the default namespace.

Parameters

item

a KatzeItem

 

key

the name of a string value

 

value

the value as a string

 

Since 0.1.8


katze_item_get_meta_integer ()

gint64
katze_item_get_meta_integer (KatzeItem *item,
                             const gchar *key);

Retrieves an integer value by the specified key from the meta data of the item.

If the key is present but not representable as an integer, -1 is returned.

Parameters

item

a KatzeItem

 

key

the name of an integer value

 

Returns

an integer value, or -1

Since 0.1.8


katze_item_get_meta_boolean ()

gboolean
katze_item_get_meta_boolean (KatzeItem *item,
                             const gchar *key);

The Value should be set with katze_item_set_meta_integer(). If the value is set and not 0, TRUE will be returned.

Parameters

item

a KatzeItem

 

key

the name of a boolean value

 

Since 0.2.7


katze_item_set_meta_integer ()

void
katze_item_set_meta_integer (KatzeItem *item,
                             const gchar *key,
                             gint64 value);

Saves the specified integer value in the meta data of the item under the specified key.

A value of -1 is intepreted as unset.

Parameters

item

a KatzeItem

 

key

the name of an integer value

 

Since 0.1.8


katze_item_get_parent ()

gpointer
katze_item_get_parent (KatzeItem *item);

Determines the parent of item .

Since 0.1.2 you can monitor the "parent" property.

Parameters

item

a KatzeItem

 

Returns

the parent of the item.

[type GObject][transfer none]


katze_item_set_parent ()

void
katze_item_set_parent (KatzeItem *item,
                       gpointer parent);

Sets the parent of item .

This is intended for item container implementations. Notably the new parent will not be notified of the change.

Since 0.1.2 you can monitor the "parent" property, so unsetting the parent is actually safe if the parent supports it.

Parameters

item

a KatzeItem

 

parent

the new parent

 

katze_item_copy ()

KatzeItem *
katze_item_copy (KatzeItem *item);

Creates an exact copy of item .

Note that subclass specific features will only be preserved if the class implements it.

Since 0.4.3 meta data is copied.

Parameters

item

a KatzeItem

 

Returns

a new KatzeItem

Since 0.1.3

Types and Values

See Also

KatzeArray