# MIMEDirVJournal

## Name

MIMEDirVJournal -- iCalendar journal object

## Synopsis

    #include <mimedir/mimedir-vjournal.h>

                        MIMEDirVJournal;

    MIMEDirVJournal*    mimedir_vjournal_new                (void);
    MIMEDirVJournal*    mimedir_vjournal_new_from_profile   (MIMEDirProfile *profile,
                                                             GError **error);
    gboolean            mimedir_vjournal_read_from_profile  (MIMEDirVJournal *vjournal,
                                                             MIMEDirProfile *profile,
                                                             GError **error);
    gboolean            mimedir_vjournal_write_to_channel   (MIMEDirVJournal *vjournal,
                                                             GIOChannel *channel,
                                                             GError **error);
    MIMEDirProfile*     mimedir_vjournal_write_to_profile   (MIMEDirVJournal *vjournal);
    gchar*              mimedir_vjournal_write_to_string    (MIMEDirVJournal *vjournal);

## Description

## Details

### MIMEDirVJournal

    typedef struct {
    	MIMEDirVComponent parent;

    	MIMEDirVJournalPriv *priv;
    } MIMEDirVJournal;

### mimedir_vjournal_new ()

    MIMEDirVJournal*    mimedir_vjournal_new                (void);

Creates a new (empty) vJournal object.

Returns : | a new vJournal object

### mimedir_vjournal_new_from_profile ()

    MIMEDirVJournal*    mimedir_vjournal_new_from_profile   (MIMEDirProfile *profile,
                                                             GError **error);

Create a new vJournal object and fills it with data retrieved from the supplied profile object. If an error occurs during the read, `error` will be set and `NULL` will be returned.

`profile` : | a MIMEDirProfile object
`error` : | error storage location or `NULL`
Returns : | the new vJournal object or `NULL`

### mimedir_vjournal_read_from_profile ()

    gboolean            mimedir_vjournal_read_from_profile  (MIMEDirVJournal *vjournal,
                                                             MIMEDirProfile *profile,
                                                             GError **error);

Clears the supplied vJournal object and re-initializes it with data read from the supplied profile. If an error occurs during the read, `error` will be set and `FALSE` will be returned. Otherwise, `TRUE` is returned.

`vjournal` : | a vJournal object
`profile` : | a profile object
`error` : | error storage location or `NULL`
Returns : | success indicator

### mimedir_vjournal_write_to_channel ()

    gboolean            mimedir_vjournal_write_to_channel   (MIMEDirVJournal *vjournal,
                                                             GIOChannel *channel,
                                                             GError **error);

Saves the vjournal object to the supplied I/O channel. If an error occurs during the write, `error` will be set and `FALSE` will be returned. Otherwise, `TRUE` is returned.

`vjournal` : | a vjournal
`channel` : | I/O channel to save to
`error` : | error storage location or `NULL`
Returns : | success indicator

### mimedir_vjournal_write_to_profile ()

    MIMEDirProfile*     mimedir_vjournal_write_to_profile   (MIMEDirVJournal *vjournal);

Saves the vjournal object to a newly allocated profile object.

`vjournal` : | a vjournal
Returns : | a new profile

### mimedir_vjournal_write_to_string ()

    gchar*              mimedir_vjournal_write_to_string    (MIMEDirVJournal *vjournal);

Saves the vjournal object to a newly allocated memory buffer. You should free the returned buffer with `g_free()`.

`vjournal` : | a vjournal
Returns : | a newly allocated memory buffer