## kolab-conv kolab-conv |

## Synopsis

    #define             KOLAB_TYPE_MAIL
    #define             KOLAB_TYPE_EVENT
    #define             KOLAB_TYPE_JOURNAL
    #define             KOLAB_TYPE_TASK
    #define             KOLAB_TYPE_NOTE
    #define             KOLAB_TYPE_CONTACT
    #define             KOLAB_SUBTYPE_DEFAULT
    #define             KOLAB_SUBTYPE_MAIL_INBOX
    #define             KOLAB_SUBTYPE_MAIL_DRAFTS
    #define             KOLAB_SUBTYPE_MAIL_SENTITEMS
    #define             KOLAB_SUBTYPE_MAIL_JUNKEMAIL
    #define             KOLAB_ANNOTATION_FOLDER_TYPE
    #define             KOLAB_ANNOTATION_FOLDER_TYPE_ATTRIBUTE
    #define             KOLAB_MESSAGE_MIMETYPE_PREFIX
    #define             KOLABCONV_PRODUCT_ID
    #define             KOLABCONV_ERROR_GENERIC
    #define             KOLABCONV_ERROR_READ_KOLAB
    #define             KOLABCONV_ERROR_READ_EVOLUTION
    GQuark              kolabconv_error_generic_quark       (void);
    GQuark              kolabconv_error_read_kolab_quark    (void);
    GQuark              kolabconv_error_read_evolution_quark
                                                            (void);
                        ECalComponentWithTZ;
    void                kolabconv_initialize                (void);
    void                kolabconv_shutdown                  (void);
    EContact *          kolabconv_kcontact_to_econtact      (const Kolab_conv_mail *Param1,
                                                             GError **Param2);
    Kolab_conv_mail *   kolabconv_econtact_to_kcontact      (const EContact *Param1,
                                                             GError **Param2);
    ECalComponentWithTZ * kolabconv_kevent_to_eevent        (const Kolab_conv_mail *Param1,
                                                             GError **Param2);
    Kolab_conv_mail *   kolabconv_eevent_to_kevent          (const ECalComponentWithTZ *Param1,
                                                             GError **Param2);
    ECalComponentWithTZ * kolabconv_ktask_to_etask          (const Kolab_conv_mail *Param1,
                                                             GError **Param2);
    Kolab_conv_mail *   kolabconv_etask_to_ktask            (const ECalComponentWithTZ *Param1,
                                                             GError **Param2);
    ECalComponentWithTZ * kolabconv_knote_to_enote          (const Kolab_conv_mail *Param1,
                                                             GError **Param2);
    Kolab_conv_mail *   kolabconv_enote_to_knote            (const ECalComponentWithTZ *Param1,
                                                             GError **Param2);
    void                kolabconv_free_econtact             (EContact *econtact);
    void                kolabconv_free_ecalendar            (ECalComponentWithTZ *ecalcomp);
    void                kolabconv_free_kmail                (Kolab_conv_mail *kmail);
    void                kolabconv_free_kmail_part           (void **mailpart);
    gchar *             kolabconv_cal_util_freebusy_new_fb_url
                                                            (const gchar *servername,
                                                             const gchar *username,
                                                             gboolean use_ssl,
                                                             Kolab_conv_freebusy_type listtype);
    ECalComponent *     kolabconv_cal_util_freebusy_ecalcomp_new_from_ics
                                                            (const gchar *ics_string,
                                                             gint nbytes,
                                                             GError **err);

## Description

## Details

### KOLAB_TYPE_MAIL

    #define KOLAB_TYPE_MAIL    "mail"

### KOLAB_TYPE_EVENT

    #define KOLAB_TYPE_EVENT   "event"

### KOLAB_TYPE_JOURNAL

    #define KOLAB_TYPE_JOURNAL "journal"

### KOLAB_TYPE_TASK

    #define KOLAB_TYPE_TASK    "task"

### KOLAB_TYPE_NOTE

    #define KOLAB_TYPE_NOTE    "note"

### KOLAB_TYPE_CONTACT

    #define KOLAB_TYPE_CONTACT "contact"

### KOLAB_SUBTYPE_DEFAULT

    #define KOLAB_SUBTYPE_DEFAULT "default"

### KOLAB_SUBTYPE_MAIL_INBOX

    #define KOLAB_SUBTYPE_MAIL_INBOX     "inbox"

### KOLAB_SUBTYPE_MAIL_DRAFTS

    #define KOLAB_SUBTYPE_MAIL_DRAFTS    "drafts"

### KOLAB_SUBTYPE_MAIL_SENTITEMS

    #define KOLAB_SUBTYPE_MAIL_SENTITEMS "sentitems"

### KOLAB_SUBTYPE_MAIL_JUNKEMAIL

    #define KOLAB_SUBTYPE_MAIL_JUNKEMAIL "junkemail"

### KOLAB_ANNOTATION_FOLDER_TYPE

    #define KOLAB_ANNOTATION_FOLDER_TYPE "/vendor/kolab/folder-type"

### KOLAB_ANNOTATION_FOLDER_TYPE_ATTRIBUTE

    #define KOLAB_ANNOTATION_FOLDER_TYPE_ATTRIBUTE "value.shared"

### KOLAB_MESSAGE_MIMETYPE_PREFIX

    #define KOLAB_MESSAGE_MIMETYPE_PREFIX "application/x-vnd.kolab."

### KOLABCONV_PRODUCT_ID

    #define KOLABCONV_PRODUCT_ID "Evolution/libekolabconv"

### KOLABCONV_ERROR_GENERIC

    #define KOLABCONV_ERROR_GENERIC (kolabconv_error_generic_quark())

### KOLABCONV_ERROR_READ_KOLAB

    #define KOLABCONV_ERROR_READ_KOLAB (kolabconv_error_read_kolab_quark())

### KOLABCONV_ERROR_READ_EVOLUTION

    #define KOLABCONV_ERROR_READ_EVOLUTION (kolabconv_error_read_evolution_quark())

### kolabconv_error_generic_quark ()

    GQuark              kolabconv_error_generic_quark       (void);

Create error quark for generic error.

Returns : | Error quark

### kolabconv_error_read_kolab_quark ()

    GQuark              kolabconv_error_read_kolab_quark    (void);

Create error quark for kolab read error.

Returns : | Error quark

### kolabconv_error_read_evolution_quark ()

    GQuark              kolabconv_error_read_evolution_quark
                                                            (void);

Create error quark for evolution read error.

Returns : | Error quark

### ECalComponentWithTZ

    typedef struct {
    	ECalComponent *maincomp;
    	ECalComponent *timezone; /* can be null for UTC */
    } ECalComponentWithTZ;

### kolabconv_initialize ()

    void                kolabconv_initialize                (void);

### kolabconv_shutdown ()

    void                kolabconv_shutdown                  (void);

### kolabconv_kcontact_to_econtact ()

    EContact *          kolabconv_kcontact_to_econtact      (const Kolab_conv_mail *Param1,
                                                             GError **Param2);

Converts Kolab_conv_mail structure containing a kolab contact to internal I_contact structure and then to an Evolution EContact GObject.

`kmail` : | a Kolab_conv_mail structure. Container for kolab mail MIME parts.
`error` : | Placeholder for error information.
Returns : | EContact (GObject). Use `kolabconv_free_econtact()` to free memory for EContact if no longer needed.

### kolabconv_econtact_to_kcontact ()

    Kolab_conv_mail *   kolabconv_econtact_to_kcontact      (const EContact *Param1,
                                                             GError **Param2);

Converts Evolution EContact GObject to internal I_contact structure and then to a Kolab_conv_mail structure containing a kolab contact.

`econtact` : | an EContact (GObject). Contains an Evolution contact PIM-Object.
`error` : | Placeholder for error information.
Returns : | Kolab_conv_mail structure containing the kolab mail MIME parts. Use `kolabconv_free_kmail()` to free memory for Kolab_conv_mail if no longer needed.

### kolabconv_kevent_to_eevent ()

    ECalComponentWithTZ * kolabconv_kevent_to_eevent        (const Kolab_conv_mail *Param1,
                                                             GError **Param2);

Converts Kolab_conv_mail structure containing a kolab event to internal I_event structure and then to an Evolution ECalComponentWithTZ structure.

`kmail` : | a Kolab_conv_mail structure. Container for kolab mail MIME parts.
`error` : | Placeholder for error information.
Returns : | ECalComponentWithTZ structure. Use `kolabconv_free_ecalendar()` to free memory if no longer needed.

### kolabconv_eevent_to_kevent ()

    Kolab_conv_mail *   kolabconv_eevent_to_kevent          (const ECalComponentWithTZ *Param1,
                                                             GError **Param2);

Converts Evolution ECalComponentWithTZ structure to internal I_event structure and then to a Kolab_conv_mail structure containing a kolab event.

`ecalcomp` : | an ECalComponentWithTZ structure. Contains an Evolution event PIM-Object.
`error` : | Placeholder for error information.
Returns : | Kolab_conv_mail structure containing the kolab mail MIME parts. Use `kolabconv_free_kmail()` to free memory for Kolab_conv_mail if no longer needed.

### kolabconv_ktask_to_etask ()

    ECalComponentWithTZ * kolabconv_ktask_to_etask          (const Kolab_conv_mail *Param1,
                                                             GError **Param2);

Converts Kolab_conv_mail structure containing a kolab task to internal I_task structure and then to an Evolution ECalComponentWithTZ structure.

`kmail` : | a Kolab_conv_mail structure. Container for kolab mail MIME parts.
`error` : | Placeholder for error information.
Returns : | ECalComponentWithTZ structure. Use `kolabconv_free_ecalendar()` to free memory if no longer needed.

### kolabconv_etask_to_ktask ()

    Kolab_conv_mail *   kolabconv_etask_to_ktask            (const ECalComponentWithTZ *Param1,
                                                             GError **Param2);

Converts Evolution ECalComponentWithTZ structure to internal I_task structure and then to a Kolab_conv_mail structure containing a kolab task.

`ecalcomp` : | an ECalComponentWithTZ structure. Contains an Evolution task PIM-Object.
`error` : | Placeholder for error information.
Returns : | Kolab_conv_mail structure containing the kolab mail MIME parts. Use `kolabconv_free_kmail()` to free memory for Kolab_conv_mail if no longer needed.

### kolabconv_knote_to_enote ()

    ECalComponentWithTZ * kolabconv_knote_to_enote          (const Kolab_conv_mail *Param1,
                                                             GError **Param2);

Converts Kolab_conv_mail structure containing a kolab note to internal I_note structure and then to an Evolution ECalComponentWithTZ GObject.

`kmail` : | a Kolab_conv_mail structure. Container for kolab mail MIME parts.
`error` : | Placeholder for error information.
Returns : | ECalComponentWithTZ structure. Use `kolabconv_free_ecalendar()` to free memory if no longer needed.

### kolabconv_enote_to_knote ()

    Kolab_conv_mail *   kolabconv_enote_to_knote            (const ECalComponentWithTZ *Param1,
                                                             GError **Param2);

Converts Evolution ECalComponentWithTZ structure to internal I_note structure and then to a Kolab_conv_mail structure containing a kolab note.

`ecalcomp` : | an ECalComponentWithTZ structure. Contains an Evolution note PIM-Object.
`error` : | Placeholder for error information.
Returns : | Kolab_conv_mail structure containing the kolab mail MIME parts. Use `kolabconv_free_kmail()` to free memory for Kolab_conv_mail if no longer needed.

### kolabconv_free_econtact ()

    void                kolabconv_free_econtact             (EContact *econtact);

free EContact.

`econtact` : | EContact to free.

### kolabconv_free_ecalendar ()

    void                kolabconv_free_ecalendar            (ECalComponentWithTZ *ecalcomp);

free ECalComponentWithTZ.

`comp` : | ECalComponentWithTZ to free.

### kolabconv_free_kmail ()

    void                kolabconv_free_kmail                (Kolab_conv_mail *kmail);

free Kolab_conv_mail.

`kmail` : | Kolab_conv_mail to free.

### kolabconv_free_kmail_part ()

    void                kolabconv_free_kmail_part           (void **mailpart);

free Kolab_conv_mail_part.

`mailpart` : | Kolab_conv_mail_part to free.

### kolabconv_cal_util_freebusy_new_fb_url ()

    gchar *             kolabconv_cal_util_freebusy_new_fb_url
                                                            (const gchar *servername,
                                                             const gchar *username,
                                                             gboolean use_ssl,
                                                             Kolab_conv_freebusy_type listtype);

Creates a new Kolab F/B trigger/request URL given the Kolab server name, user name and whether or not to use an SSL encrypted connection. The listtype parameter specifies which kind of URL to create (trigger, ifb, vfb, xfb).

`servername` : | The fully-qualified server name or an IP number string
`username` : | The user name to use for the request URL `use_ssl` If TRUE, use "HTTPS", otherwise use "HTTP" `listtype` The type of URL to create (trigger URL or ifb, vfb, xfb)
Returns : | A NULL-terminated string containing a full KOLAB F/B trigger/request URL (free it using `g_free()` if no longer needed)

### kolabconv_cal_util_freebusy_ecalcomp_new_from_ics ()

    ECalComponent *     kolabconv_cal_util_freebusy_ecalcomp_new_from_ics
                                                            (const gchar *ics_string,
                                                             gint nbytes,
                                                             GError **err);

Creates a new ECalComponent from an ICS string as sent by the Kolab server as an answer to a trigger- or freebusy-request. No sanity checking on the server response string (the ics_string) is done currently.

`ics_string` : | Ical string containing the trigger dummy response or freebusy information as sent by the Kolab server (for the format check with the Kolab format specification)
`nbytes` : | The number of bytes the ics_string is supposed to contain (this info is obtained from the underlying tcp stream infrastructure)
`err` : | A GError, set in case of empty server response, missing VFREEBUSY component, or otherwise invalid input data
Returns : | A pointer to an ECalComponent structure containing the converted VFREEBUSY information. In case of an error, the return value is NULL. free the object using `g_object_unref()` if no longer needed