#include "give_ebook.h"#include <string.h>#include <libebook/e-book.h>

Go to the source code of this file.
Classes | |
| struct | _give_ebook_private |
| Struct of private members of give_ebook. More... | |
Defines | |
| #define | GIVE_EBOOK_GET_PRIVATE(obj) |
Typedefs | |
| typedef struct _give_ebook_private | give_ebook_private |
Functions | |
Private functions | |
| GType | give_ebook_get_type (void) |
| Registers the give_ebook type statically. | |
| static void | give_ebook_class_init (give_ebookClass *klass) |
| Overrites the class finalize function and adds the private structure. | |
| static void | give_ebook_init (give_ebook *self) |
| Connects to and opens the default system addressbook. | |
| static void | give_ebook_finalize (GObject *self) |
| Free private members. | |
| static void | give_ebook_open_response (EBook *book, EBookStatus status, gpointer data) |
| Callback of asynchronous EBook opening. | |
| static void | give_ebook_status_to_string (EBookStatus status, gchar *state_string) |
| Converts a EBookStatus to a string. | |
Public functions | |
| give_ebook * | give_ebook_new (void) |
| Creates a new instance of give_ebook. | |
| gchar * | give_ebook_get_contact_name (give_ebook *self, const gchar *id) |
| Get the contact's name, from the ID. | |
| gchar * | give_ebook_get_contact_vcard (give_ebook *self, const gchar *id) |
| Get the string representation of the contact, from the ID. | |
Definition in file give_ebook.c.
| #define GIVE_EBOOK_GET_PRIVATE | ( | obj | ) |
Value:
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
GIVE_EBOOK_TYPE, \
give_ebook_private));
Definition at line 32 of file give_ebook.c.
Referenced by give_ebook_finalize(), give_ebook_get_contact_name(), give_ebook_get_contact_vcard(), give_ebook_init(), and give_ebook_open_response().
| typedef struct _give_ebook_private give_ebook_private |
Definition at line 30 of file give_ebook.c.
| static void give_ebook_class_init | ( | give_ebookClass * | klass | ) | [static] |
Overrites the class finalize function and adds the private structure.
Sets give_ebook_finalize as the class' finalize function.
Registers the give_ebook_private structure as private member.
| klass | a give_ebookClass class. |
Definition at line 119 of file give_ebook.c.
References give_ebook_finalize().
Referenced by give_ebook_get_type().


| static void give_ebook_finalize | ( | GObject * | self | ) | [static] |
Free private members.
| self | a GObject. |
Definition at line 171 of file give_ebook.c.
References GIVE_EBOOK_GET_PRIVATE, and GIVE_EBOOK_IS_OBJECT.
Referenced by give_ebook_class_init().

| gchar * give_ebook_get_contact_name | ( | give_ebook * | self, | |
| const gchar * | id | |||
| ) |
Get the contact's name, from the ID.
The the EBook is opened (_give_ebook_private::ready = true), gets an EContact with e_book_get_contact according to the ID, and querys the full name with invoking e_contact_get (contact, E_CONTACT_FULL_NAME).
| self | A give_ebook object. | |
| id | The ID of the contact. |
Definition at line 347 of file give_ebook.c.
References _give_ebook_private::ebook, GIVE_EBOOK_GET_PRIVATE, GIVE_EBOOK_IS_OBJECT, and _give_ebook_private::ready.
Referenced by give_drag_and_drop_create_dialog(), and give_drag_and_drop_run_dialog().

| gchar * give_ebook_get_contact_vcard | ( | give_ebook * | self, | |
| const gchar * | id | |||
| ) |
Get the string representation of the contact, from the ID.
The the EBook is opened (_give_ebook_private::ready = true), gets an EContact with e_book_get_contact according to the ID. The string representation available for EContact's parent object: E_VCard, so first the contact needs to be casted to E_VCard. Then the return string is generated with: e_vcard_to_string.
| self | A give_ebook object. | |
| id | The ID of the contact. |
Definition at line 391 of file give_ebook.c.
References _give_ebook_private::ebook, GIVE_EBOOK_GET_PRIVATE, GIVE_EBOOK_IS_OBJECT, and _give_ebook_private::ready.
Referenced by give_drag_and_drop_run_dialog().

| GType give_ebook_get_type | ( | void | ) |
Registers the give_ebook type statically.
Sets class init, and instance init functions.
The class finalize function has been set in the class init function.
Definition at line 83 of file give_ebook.c.
References give_ebook_class_init(), and give_ebook_init().

| static void give_ebook_init | ( | give_ebook * | self | ) | [static] |
Connects to and opens the default system addressbook.
| self | a give_ebook object. |
Definition at line 139 of file give_ebook.c.
References _give_ebook_private::ebook, GIVE_EBOOK_GET_PRIVATE, GIVE_EBOOK_IS_OBJECT, and give_ebook_open_response().
Referenced by give_ebook_get_type().


| give_ebook * give_ebook_new | ( | void | ) |
Creates a new instance of give_ebook.
Definition at line 193 of file give_ebook.c.
References GIVE_EBOOK_TYPE.
Referenced by give_drag_and_drop_init().

| static void give_ebook_open_response | ( | EBook * | book, | |
| EBookStatus | status, | |||
| gpointer | data | |||
| ) | [static] |
Callback of asynchronous EBook opening.
Converts the status to string with give_ebook_status_to_string and prints it. If the status is E_BOOK_ERROR_OK (success), sets the _give_ebook_private::ready private member to false or true, accordin to it.
| book | The opened EBook. | |
| status | The status returned by opening. | |
| data | User data passed to give_ebook_open_response. It is the give_ebook_object. |
Definition at line 218 of file give_ebook.c.
References GIVE_EBOOK_GET_PRIVATE, give_ebook_status_to_string(), and _give_ebook_private::ready.
Referenced by give_ebook_init().


| static void give_ebook_status_to_string | ( | EBookStatus | status, | |
| gchar * | state_string | |||
| ) | [static] |
Converts a EBookStatus to a string.
Converts an emun to a readable string.
| status | An EBookStatus code. | |
| state_string | The return string, memory has not been allocated, it needs to be handled in the caller side. |
Definition at line 253 of file give_ebook.c.
Referenced by give_ebook_open_response().

1.5.3