## E2kFreebusy

E2kFreebusy — Exchange Free/Busy processing

## Synopsis

                        E2kFreebusy;
    enum                E2kBusyStatus;
                        E2kFreebusyEvent;

    E2kFreebusy *       e2k_freebusy_new                    (E2kContext *ctx,
                                                             const gchar *public_uri,
                                                             const gchar *dn);
    void                e2k_freebusy_reset                  (E2kFreebusy *fb,
                                                             gint nmonths);
    void                e2k_freebusy_add_interval           (E2kFreebusy *fb,
                                                             E2kBusyStatus busystatus,
                                                             time_t start,
                                                             time_t end);
    void                e2k_freebusy_clear_interval         (E2kFreebusy *fb,
                                                             time_t start,
                                                             time_t end);
    E2kHTTPStatus       e2k_freebusy_add_from_calendar_uri  (E2kFreebusy *fb,
                                                             const gchar *uri,
                                                             time_t start_tt,
                                                             time_t end_tt);
    E2kHTTPStatus       e2k_freebusy_save                   (E2kFreebusy *fb);
    void                e2k_freebusy_destroy                (E2kFreebusy *fb);

## Description

### Note

This code is not currently used.

## Details

### E2kFreebusy

    typedef struct {
    } E2kFreebusy;

### enum E2kBusyStatus

    typedef enum {
    	E2K_BUSYSTATUS_FREE = 0,
    	E2K_BUSYSTATUS_TENTATIVE = 1,
    	E2K_BUSYSTATUS_BUSY = 2,
    	E2K_BUSYSTATUS_OOF = 3,

    	E2K_BUSYSTATUS_MAX,

    	/* Alias for internal use */
    	E2K_BUSYSTATUS_ALL = E2K_BUSYSTATUS_FREE
    } E2kBusyStatus;

### E2kFreebusyEvent

    typedef struct {
    } E2kFreebusyEvent;

### e2k_freebusy_new ()

    E2kFreebusy *       e2k_freebusy_new                    (E2kContext *ctx,
                                                             const gchar *public_uri,
                                                             const gchar *dn);

Creates a new E2kFreebusy, filled in with information from the indicated user's published free/busy information. This uses the public free/busy folder; the caller does not need permission to access the `dn`'s Calendar.

Note that currently, this will fail and return `NULL` if the user does not already have free/busy information stored on the server.

`ctx` : | an E2kContext
`public_uri` : | the URI of the MAPI public folder tree
`dn` : | the legacy Exchange DN of a user
Returns : | the freebusy information

### e2k_freebusy_reset ()

    void                e2k_freebusy_reset                  (E2kFreebusy *fb,
                                                             gint nmonths);

Clears all existing data in `fb` and resets the start and end times to a span of `nmonths` around the current date.

`fb` : | an E2kFreebusy
`nmonths` : | the number of months of info `fb` will store

### e2k_freebusy_add_interval ()

    void                e2k_freebusy_add_interval           (E2kFreebusy *fb,
                                                             E2kBusyStatus busystatus,
                                                             time_t start,
                                                             time_t end);

This adds an interval of type `busystatus` to `fb`.

`fb` : | an E2kFreebusy
`busystatus` : | the busy status of the interval
`start` : | the start of the interval
`end` : | the end of the interval

### e2k_freebusy_clear_interval ()

    void                e2k_freebusy_clear_interval         (E2kFreebusy *fb,
                                                             time_t start,
                                                             time_t end);

This removes any events between `start` and `end` in `fb`.

`fb` : | an E2kFreebusy
`start` : | the start of the interval
`end` : | the end of the interval

### e2k_freebusy_add_from_calendar_uri ()

    E2kHTTPStatus       e2k_freebusy_add_from_calendar_uri  (E2kFreebusy *fb,
                                                             const gchar *uri,
                                                             time_t start_tt,
                                                             time_t end_tt);

This queries the server for events between `start_tt` and `end_tt` in the calendar at `uri` (which the caller must have permission to read) and adds them `fb`. Any previously-existing events during that range are removed.

`fb` : | an E2kFreebusy
`uri` : | the URI of a calendar folder
`start_tt` : | start of the range to add
`end_tt` : | end of the range to add
Returns : | an HTTP status code.

### e2k_freebusy_save ()

    E2kHTTPStatus       e2k_freebusy_save                   (E2kFreebusy *fb);

Saves the data in `fb` back to the server.

`fb` : | an E2kFreebusy
Returns : | a libsoup or HTTP status code

### e2k_freebusy_destroy ()

    void                e2k_freebusy_destroy                (E2kFreebusy *fb);

Frees `fb` and all associated data.

`fb` : | the E2kFreebusy