src/give_ebook.c File Reference

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

Include dependency graph for give_ebook.c:

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_ebookgive_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.


Detailed Description

The EBook interacts with the Evolution Data Server's EBook component, for data queries, and VCard representations of the contacts.

Definition in file give_ebook.c.


Define Documentation

#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 Documentation

typedef struct _give_ebook_private give_ebook_private

Definition at line 30 of file give_ebook.c.


Function Documentation

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.

Parameters:
klass a give_ebookClass class.

Definition at line 119 of file give_ebook.c.

References give_ebook_finalize().

Referenced by give_ebook_get_type().

Here is the call graph for this function:

Here is the caller graph for this function:

static void give_ebook_finalize ( GObject *  self  )  [static]

Free private members.

Note:
No members needed to be closed jet.
Parameters:
self a GObject.

Note:
no need to close the ebook, nothing to be freed jet.

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().

Here is the caller graph for this function:

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).

Parameters:
self A give_ebook object.
id The ID of the contact.
Returns:
The name 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().

Here is the caller graph for this function:

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.

Parameters:
self A give_ebook object.
id The ID of the contact.
Returns:
String representation of a VCard.

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().

Here is the caller graph for this function:

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.

Returns:
The new registered GType, with the name of "give_ebook".

Definition at line 83 of file give_ebook.c.

References give_ebook_class_init(), and give_ebook_init().

Here is the call graph for this function:

static void give_ebook_init ( give_ebook self  )  [static]

Connects to and opens the default system addressbook.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

give_ebook * give_ebook_new ( void   ) 

Creates a new instance of give_ebook.

Returns:
A new give_ebook object.

Definition at line 193 of file give_ebook.c.

References GIVE_EBOOK_TYPE.

Referenced by give_drag_and_drop_init().

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
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().

Here is the caller graph for this function:


Generated on Sat May 17 16:27:33 2008 for Give by  doxygen 1.5.3