RubricaAbook

RubricaAbook —

Synopsis




#define     RUBRICA_ABOOK_TYPE
#define     RUBRICA_ABOOK                   (obj)
#define     RUBRICA_ABOOK_CLASS             (klass)
#define     IS_RUBRICA_ABOOK                (obj)
#define     IS_RUBRICA_ABOOK_CLASS          (klass)
#define     RUBRICA_ABOOK_GET_CLASS         (klass)
            RubricaAbookPrivate;
GType       rubrica_abook_get_type          (void);
RubricaAbook* rubrica_abook_new             (void);
void        rubrica_abook_free              (RubricaAbook *abook);
gboolean    rubrica_abook_open_file         (RubricaAbook *abook,
                                             gchar *fname);
gboolean    rubrica_abook_save_file         (RubricaAbook *abook,
                                             gchar *fname);
RubricaAbook* rubrica_abook_copy            (RubricaAbook *abook);
void        rubrica_abook_set_name          (RubricaAbook *abook,
                                             gchar *name);
void        rubrica_abook_set_path          (RubricaAbook *abook,
                                             gchar *path);
gchar*      rubrica_abook_get_name          (RubricaAbook *abook);
gchar*      rubrica_abook_get_path          (RubricaAbook *abook);
gint        rubrica_abook_get_items         (RubricaAbook *abook);
void        rubrica_abook_add_card          (RubricaAbook *abook,
                                             gpointer card);
void        rubrica_abook_remove_card       (RubricaAbook *abook,
                                             gpointer card);
void        rubrica_abook_replace_card      (RubricaAbook *abook,
                                             gpointer old,
                                             gpointer new);
gpointer    rubrica_abook_get_card_by_id    (RubricaAbook *abook,
                                             gchar *id);
gpointer    rubrica_abook_get_selected_card (RubricaAbook *abook);
gpointer    rubrica_abook_get_card          (RubricaAbook *abook);
gpointer    rubrica_abook_get_next_card     (RubricaAbook *abook);
gpointer    rubrica_abook_get_prev_card     (RubricaAbook *abook);
void        rubrica_abook_reset_book        (RubricaAbook *abook);
GList*      rubrica_abook_find_cards_in_group
                                            (RubricaAbook *abook,
                                             gchar *group_name);
void        rubrica_abook_set_selected_card_id
                                            (RubricaAbook *abook,
                                             gchar *id);
gchar*      rubrica_abook_get_selected_card_id
                                            (RubricaAbook *abook);

Description

Details

RUBRICA_ABOOK_TYPE

#define RUBRICA_ABOOK_TYPE            (rubrica_abook_get_type())


RUBRICA_ABOOK()

#define     RUBRICA_ABOOK(obj)

obj :

RUBRICA_ABOOK_CLASS()

#define     RUBRICA_ABOOK_CLASS(klass)

klass :

IS_RUBRICA_ABOOK()

#define     IS_RUBRICA_ABOOK(obj)

obj :

IS_RUBRICA_ABOOK_CLASS()

#define     IS_RUBRICA_ABOOK_CLASS(klass)

klass :

RUBRICA_ABOOK_GET_CLASS()

#define     RUBRICA_ABOOK_GET_CLASS(klass)

klass :

RubricaAbookPrivate

typedef struct _RubricaAbookPrivate RubricaAbookPrivate;


rubrica_abook_get_type ()

GType       rubrica_abook_get_type          (void);

Returns :

rubrica_abook_new ()

RubricaAbook* rubrica_abook_new             (void);

create a RubricaAbook

Returns : a new RubricaAbook

rubrica_abook_free ()

void        rubrica_abook_free              (RubricaAbook *abook);

free the RubricaAbook

abook : a RubricaAbook

rubrica_abook_open_file ()

gboolean    rubrica_abook_open_file         (RubricaAbook *abook,
                                             gchar *fname);

open the addressbook with given name

abook : a RubricaAbook
fname : the name of the addressbook
Returns : TRUE if file is opened successfully, FALSE otherwise

rubrica_abook_save_file ()

gboolean    rubrica_abook_save_file         (RubricaAbook *abook,
                                             gchar *fname);

save the addressbook with given filename

abook : a RubricaAbook
fname : the name of file
Returns : TRUE if file is saved successfully, FALSE otherwise

rubrica_abook_copy ()

RubricaAbook* rubrica_abook_copy            (RubricaAbook *abook);

copy the addressbook pointed by abook

abook : a RubricaAbook
Returns : a new RubricaAbook

rubrica_abook_set_name ()

void        rubrica_abook_set_name          (RubricaAbook *abook,
                                             gchar *name);

set the name of addressbook

abook : a RubricaAbook
name : the name of the addressbook

rubrica_abook_set_path ()

void        rubrica_abook_set_path          (RubricaAbook *abook,
                                             gchar *path);

set the path of addressbook

abook : a RubricaAbook
path : the addressbook's path

rubrica_abook_get_name ()

gchar*      rubrica_abook_get_name          (RubricaAbook *abook);

get the address book's name. Caller must free the returned value

abook : a RubricaAbook
Returns : a gchar*

rubrica_abook_get_path ()

gchar*      rubrica_abook_get_path          (RubricaAbook *abook);

get the path of addressbok. Caller must free the returned value

abook : a RubricaAbook
Returns : a gchar*

rubrica_abook_get_items ()

gint        rubrica_abook_get_items         (RubricaAbook *abook);

get the number of cards into addressbok

abook : a RubricaAbook
Returns : integer

rubrica_abook_add_card ()

void        rubrica_abook_add_card          (RubricaAbook *abook,
                                             gpointer card);

append the given card into the addressbook

abook : a RubricaAbook
card : a RubricaPersonalCard or RubricaCompanyCard object

rubrica_abook_remove_card ()

void        rubrica_abook_remove_card       (RubricaAbook *abook,
                                             gpointer card);

remove the given card from addressbook

abook : a RubricaAbook
card : a RubricaPersonalCard or RubricaCompanyCard object

rubrica_abook_replace_card ()

void        rubrica_abook_replace_card      (RubricaAbook *abook,
                                             gpointer old,
                                             gpointer new);

replace the old card with the new one

abook : a RubricaAbook
old : a RubricaPersonalCard or RubricaCompanyCard object
new : a RubricaPersonalCard or RubricaCompanyCard object

rubrica_abook_get_card_by_id ()

gpointer    rubrica_abook_get_card_by_id    (RubricaAbook *abook,
                                             gchar *id);

get the card with "id" id

abook : a RubricaAbook
id : the card id
Returns : a pointer to the card or NULL if addressbook doesn't own that card

rubrica_abook_get_selected_card ()

gpointer    rubrica_abook_get_selected_card (RubricaAbook *abook);

abook :
Returns :

rubrica_abook_get_card ()

gpointer    rubrica_abook_get_card          (RubricaAbook *abook);

Get the first card in addressbook.

abook : a RubricaAbook
Returns : a pointer to the card or NULL if addressbook is empty

rubrica_abook_get_next_card ()

gpointer    rubrica_abook_get_next_card     (RubricaAbook *abook);

get the next card in addressbook

abook : a RubricaAbook
Returns : a pointer to the card or NULL if the cards's end list is reached.

rubrica_abook_get_prev_card ()

gpointer    rubrica_abook_get_prev_card     (RubricaAbook *abook);

get the previous card in addressbook

abook : a RubricaAbook
Returns : a pointer to the card or NULL if the cards's head list is reached.

rubrica_abook_reset_book ()

void        rubrica_abook_reset_book        (RubricaAbook *abook);

reset the private addressbook iterator. The iterator will point the head of cards's list.

abook : a RubricaAbook

rubrica_abook_find_cards_in_group ()

GList*      rubrica_abook_find_cards_in_group
                                            (RubricaAbook *abook,
                                             gchar *group_name);

Find all cards that belongs to the given group. Found cards's ID has inserted in a GList. Caller must free returned GList

abook : a RubricaAbook
group_name : the name of the group
Returns : a GList*

rubrica_abook_set_selected_card_id ()

void        rubrica_abook_set_selected_card_id
                                            (RubricaAbook *abook,
                                             gchar *id);

store the id of currently active card

abook : a RubricaAbook
id : the card's id

rubrica_abook_get_selected_card_id ()

gchar*      rubrica_abook_get_selected_card_id
                                            (RubricaAbook *abook);

get the id of the active card. Caller must free the returned value (DEPRECATED)

abook : a RubricaAbook
Returns : a gchar*