![]() |
![]() |
![]() |
Libral, the Rubrica Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
RAbookRAbook — The addressbook manager object |
#define R_ABOOK_TYPE #define R_ABOOK (obj) #define R_ABOOK_CLASS (klass) #define IS_R_ABOOK (obj) #define IS_R_ABOOK_CLASS (klass) #define R_ABOOK_GET_CLASS (klass) RAbookPrivate; RAbook; GType r_abook_get_type (void); RAbook* r_abook_new (void); void r_abook_free (RAbook *abook); gboolean r_abook_open_file (RAbook *abook, gchar *fname); gboolean r_abook_save_file (RAbook *abook, gchar *fname, gint compression_rate); gboolean r_abook_overwrite_file (RAbook *abook, gboolean backup, gint compression_rate); RAbook* r_abook_copy (RAbook *abook); gboolean r_abook_plugin_from_file (RAbook *abook, gchar *filename); gboolean r_abook_load_plugin (RAbook *abook, const gchar *plugin_name); gchar* r_abook_get_plugin_extension (RAbook *abook); gpointer r_abook_get_plugin (RAbook *abook); gpointer r_abook_get_r_plugin (RAbook *abook); gint r_abook_get_items (RAbook *abook); gint r_abook_get_deleted (RAbook *abook); gboolean r_abook_is_empty (RAbook *abook); void r_abook_add_card (RAbook *abook, RCard *card); void r_abook_add_loaded_card (RAbook *abook, RCard *card); void r_abook_paste_card (RAbook *abook, RCard *card); void r_abook_empty_trash (RAbook *abook); void r_abook_delete_card (RAbook *abook, RCard *card); void r_abook_destroy_card (RAbook *abook, RCard *card); gboolean r_abook_recovery_card (RAbook *abook, RCard *card); void r_abook_replace_card (RAbook *abook, RCard *old, RCard *new); gpointer r_abook_get_card (RAbook *abook); gpointer r_abook_get_next_card (RAbook *abook); gpointer r_abook_get_prev_card (RAbook *abook); void r_abook_reset_book (RAbook *abook); void r_abook_foreach_card (RAbook *abook, RFunc func, gpointer data); gpointer r_abook_get_card_by_id (RAbook *abook, glong id); gpointer r_abook_get_selected_card (RAbook *abook); void r_abook_unselect_cards (RAbook *abook); gpointer r_abook_get_groups_box (RAbook *abook); GList* r_abook_find_cards_by_group (RAbook *abook, const gchar *group_name); GList* r_abook_find_cards_by_type (RAbook *abook, const gchar *type); GList* r_abook_find_cards_by_genre (RAbook *abook, const gchar *genre); GList* r_abook_find_cards_by_rate (RAbook *abook, RRate rate); GList* r_abook_search (RAbook *abook, const gchar *str); GList* r_abook_search_date (RAbook *abook, gint date, SearchType type); GList* r_abook_search_between (RAbook *abook, gint first, gint second, SearchType type);
"addressbook-name" gchararray : Read / Write / Construct "addressbook-path" gchararray : Read / Write / Construct "deleted-cards" gint : Read "file-filter" gchararray : Read / Write / Construct "selected-id" glong : Read / Write / Construct
"addressbook-changed" : Run Last "addressbook-closed" : Run Last "addressbook-read" : Run Last "addressbook-saved" : Run Last "card-added" : Run Last "card-cutted" : Run Last "card-deleted" : Run Last "card-destroyed" : Run Last "card-read" : Run Last "card-recovered" : Run Last "card-replaced" : Run Last "need-name" : Run Last "open-fail" : Run Last "save-fail" : Run Last
void r_abook_free (RAbook *abook);
free the RAbook The "addressbook_closed" signal is emitted
|
a RAbook |
gboolean r_abook_open_file (RAbook *abook, gchar *fname);
open the addressbook with given name
|
a RAbook |
|
the name of the addressbook |
Returns : |
TRUE if file is opened successfully, FALSE otherwise
|
gboolean r_abook_save_file (RAbook *abook, gchar *fname, gint compression_rate);
save the addressbook with given filename
|
a RAbook |
|
the name of file |
|
|
Returns : |
TRUE if file is saved successfully, FALSE otherwise
|
gboolean r_abook_overwrite_file (RAbook *abook, gboolean backup, gint compression_rate);
overwrite an existing addressbook with a new one.
If backup is TRUE
the old addressbook is backuped.
|
a RAbook |
|
boolean |
|
|
Returns : |
a TRUE if old addressbook was successfully overwited,
FALSE otherwise
|
gboolean r_abook_plugin_from_file (RAbook *abook, gchar *filename);
Try to load the plugin using the file extension. If the file has a known extension the rigth plugin is loaded.
|
a RAbook |
|
gchar* |
Returns : |
TRUE if plugin is loaded, FALSE otherwise
|
gboolean r_abook_load_plugin (RAbook *abook, const gchar *plugin_name);
Load the "plugin_name" plugin.
|
a RAbook |
|
const gchar* |
Returns : |
TRUE if plugin is loaded, FALSE otherwise
|
gchar* r_abook_get_plugin_extension (RAbook *abook);
Get the extension that is associate to the current active plugin
|
a RAbook |
Returns : |
a gchar* or NULL if an error occured |
gpointer r_abook_get_plugin (RAbook *abook);
Get the currently active plugin (the real plugin)
gpointer r_abook_get_r_plugin (RAbook *abook);
Get the currently active plugin (ptr to an RPlugin struct)
gint r_abook_get_items (RAbook *abook);
get the number of cards into addressbok
|
a RAbook |
Returns : |
an integer |
gboolean r_abook_is_empty (RAbook *abook);
is the addressbook empty?
|
a RAbook |
Returns : |
a boolean. TRUE if addressbook is empty, FALSE otherwise
|
void r_abook_add_card (RAbook *abook, RCard *card);
append the given card into the addressbook The "card_added" and "addressbook_changed" signals are emitted
void r_abook_add_loaded_card (RAbook *abook, RCard *card);
append the card read from disk into the addressbook
void r_abook_paste_card (RAbook *abook, RCard *card);
peste the given card into the addressbook (append the card)
void r_abook_empty_trash (RAbook *abook);
Destroy all cards in the trash. The destroyed cards are unrecoverable the "addressbook_changed" signal is emitted
|
a RAbook |
void r_abook_delete_card (RAbook *abook, RCard *card);
mark the given card as delete. The id of the card is appended to the addressbook's trash The "card_removed" and "addressbook_changed" signals are emitted
void r_abook_destroy_card (RAbook *abook, RCard *card);
Destroy the given card. The destroyed cards are unrecoverable The "card_destroyed" and "addressbook_changed" signals are emitted
gboolean r_abook_recovery_card (RAbook *abook, RCard *card);
unmark the card previously marked as deleted. The "card_recovered" and "addressbook_changed" signals are emitted
void r_abook_replace_card (RAbook *abook, RCard *old, RCard *new);
replace the old card with the new one The "card_replaced" and "addressbook_changed" signals are emitted
gpointer r_abook_get_card (RAbook *abook);
Get the first card in addressbook.
|
a RAbook |
Returns : |
a pointer to the card or NULL if addressbook is empty |
gpointer r_abook_get_next_card (RAbook *abook);
get the next card in addressbook
|
a RAbook |
Returns : |
a pointer to the card or NULL if the cards's end list is reached. |
gpointer r_abook_get_prev_card (RAbook *abook);
get the previous card in addressbook
|
a RAbook |
Returns : |
a pointer to the card or NULL if the cards's head list is reached. |
void r_abook_reset_book (RAbook *abook);
reset the private addressbook iterator. The iterator will point the head of cards's list.
|
a RAbook |
void r_abook_foreach_card (RAbook *abook, RFunc func, gpointer data);
Call the function func()
for each card in the RAbook.
gpointer r_abook_get_card_by_id (RAbook *abook, glong id);
get the card with "id" id
|
a RAbook |
|
the card id |
Returns : |
a pointer to the card or NULL if addressbook doesn't own that card |
gpointer r_abook_get_selected_card (RAbook *abook);
Get the selected card in the addressbook
|
a RAbook |
Returns : |
void r_abook_unselect_cards (RAbook *abook);
unselect card. Clear previpus selections
|
a RAbook |
GList* r_abook_find_cards_by_group (RAbook *abook, const 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
|
a RAbook |
|
the name of the group |
Returns : |
a GList* or NULL if no cards belong to group
|
GList* r_abook_find_cards_by_type (RAbook *abook, const gchar *type);
|
|
|
|
Returns : |
GList* r_abook_find_cards_by_genre (RAbook *abook, const gchar *genre);
|
|
|
|
Returns : |
GList* r_abook_find_cards_by_rate (RAbook *abook, RRate rate);
|
|
|
|
Returns : |
GList* r_abook_search_date (RAbook *abook, gint date, SearchType type);
|
|
|
|
|
|
Returns : |
GList* r_abook_search_between (RAbook *abook, gint first, gint second, SearchType type);
|
|
|
|
|
|
|
|
Returns : |
addressbook-name
" property"addressbook-name" gchararray : Read / Write / Construct
the name (filename) of the addressbook.
Default value: NULL
addressbook-path
" property"addressbook-path" gchararray : Read / Write / Construct
the path of the addressbook.
Default value: NULL
deleted-cards
" property"deleted-cards" gint : Read
number of cards marked as deleted in the addressbook.
Default value: 0
file-filter
" property"file-filter" gchararray : Read / Write / Construct
filter used to identify the file's type.
Default value: NULL
selected-id
" property"selected-id" glong : Read / Write / Construct
load/save the id of the selected card.
Default value: 0
void user_function (RAbook *abook, gpointer user_data) : Run Last
The "addressbook_changed" signal
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer user_data) : Run Last
The "addressbook_closed" signal
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer user_data) : Run Last
The "addressbook-read" signal is emitted when the addressbook is read
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer user_data) : Run Last
The "addressbook_saved" signal
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer data, gpointer user_data) : Run Last
The "card-added" signal is emitted after a card is added to addressbook. A pointer to the card is passed to the callback function
|
the RAbook object that receives the signal |
|
a pointer to the readed card |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer data, gpointer user_data) : Run Last
The "card-cutted" signal is emitted when a card in the addressbook is cutted. A pointer to the cutted card is passed to the callback function
|
the RAbook object that receives the signal |
|
a pointer to the cutted card |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer arg1, gpointer user_data) : Run Last
The "card-removed" signal is emitted when a card is (deleted) removed from addressbook. The removed cards are marked as deleted, to really delete (remove) the card you must destroy it. You can recover (deleted) removed cards. Destroyed cards are unrecoverable
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gchar *arg1, gpointer user_data) : Run Last
The "card-destroyed" signal is emitted when a card is deleted from addressbook. Destroyed cards are unrecoverable.
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer data, gpointer user_data) : Run Last
The "card-read" signal is emitted after the addressbook has been readed
|
the RAbook object that receives the signal |
|
a pointer to the readed card |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer arg1, gpointer user_data) : Run Last
The "card-recovered" signal is emitted when a previously deleted marked card is unmarked.
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer data, gpointer user_data) : Run Last
The "card-replaced" signal is emitted on a card replacement. A pointer to the new card is passed to the callback function
|
the RAbook object that receives the signal |
|
a pointer to the readed card |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gpointer user_data) : Run Last
The "need-name" signal is emitted if user tries to save an addressbook without giving a filename to it
|
the RAbook object that receives the signal |
|
user data set when the signal handler was connected. |
void user_function (RAbook *abook, gint err, gpointer user_data) : Run Last
the "open-fail" signal is emitted if the given file can't be read