## CamelSession

CamelSession

## Synopsis

    struct              CamelSession;
    gboolean            (*CamelTimeoutCallback)             (gpointer data);
    enum                CamelSessionAlertType;
                        CamelSessionThreadOps;
                        CamelSessionThreadMsg;
    void                camel_session_construct             (CamelSession *session,
                                                             const char *storage_path);
    CamelService*       camel_session_get_service           (CamelSession *session,
                                                             const char *url_string,
                                                             CamelProviderType type,
                                                             CamelException *ex);
    CamelService*       camel_session_get_service_connected (CamelSession *session,
                                                             const char *url_string,
                                                             CamelProviderType type,
                                                             CamelException *ex);
    #define             camel_session_get_store             (session, url_string, ex)
    #define             camel_session_get_transport         (session, url_string, ex)
    char*               camel_session_get_storage_path      (CamelSession *session,
                                                             CamelService *service,
                                                             CamelException *ex);
    char*               camel_session_get_password          (CamelSession *session,
                                                             CamelService *service,
                                                             const char *domain,
                                                             const char *prompt,
                                                             const char *item,
                                                             guint32 flags,
                                                             CamelException *ex);
    void                camel_session_forget_password       (CamelSession *session,
                                                             CamelService *service,
                                                             const char *domain,
                                                             const char *item,
                                                             CamelException *ex);
    gboolean            camel_session_alert_user            (CamelSession *session,
                                                             CamelSessionAlertType type,
                                                             const char *prompt,
                                                             gboolean cancel);
    char*               camel_session_build_password_prompt (const char *type,
                                                             const char *user,
                                                             const char *host);
    gboolean            camel_session_is_online             (CamelSession *session);
    void                camel_session_set_online            (CamelSession *session,
                                                             gboolean online);
    CamelFilterDriver*  camel_session_get_filter_driver     (CamelSession *session,
                                                             const char *type,
                                                             CamelException *ex);
    gboolean            camel_session_check_junk            (CamelSession *session);
    void                camel_session_set_check_junk        (CamelSession *session,
                                                             gboolean check_junk);
    void*               camel_session_thread_msg_new        (CamelSession *session,
                                                             CamelSessionThreadOps *ops,
                                                             unsigned int size);
    void                camel_session_thread_msg_free       (CamelSession *session,
                                                             CamelSessionThreadMsg *msg);
    int                 camel_session_thread_queue          (CamelSession *session,
                                                             CamelSessionThreadMsg *msg,
                                                             int flags);
    void                camel_session_thread_wait           (CamelSession *session,
                                                             int id);
    gboolean            camel_session_get_network_state     (CamelSession *session);
    void                camel_session_set_network_state     (CamelSession *session,
                                                             gboolean network_state);
    const GHashTable*   camel_session_get_junk_headers      (CamelSession *session);
    void                camel_session_set_junk_headers      (CamelSession *session,
                                                             const char **headers,
                                                             const char **values,
                                                             int len);
    gboolean            camel_session_lookup_addressbook    (CamelSession *session,
                                                             const char *name);

## Description

## Details

### struct CamelSession

    struct CamelSession {
    	CamelObject parent_object;
    	struct _CamelSessionPrivate *priv;

    	char *storage_path;
    	CamelJunkPlugin *junk_plugin;

    	guint online:1;
    	guint check_junk:1;
    	guint network_state:1;
    };

### CamelTimeoutCallback ()

    gboolean            (*CamelTimeoutCallback)             (gpointer data);

`data` : |
Returns : |

### enum CamelSessionAlertType

    typedef enum {
    	CAMEL_SESSION_ALERT_INFO,
    	CAMEL_SESSION_ALERT_WARNING,
    	CAMEL_SESSION_ALERT_ERROR
    } CamelSessionAlertType;

### CamelSessionThreadOps

    typedef struct {
    	void (*receive)(CamelSession *session, struct _CamelSessionThreadMsg *m);
    	void (*free)(CamelSession *session, struct _CamelSessionThreadMsg *m);
    } CamelSessionThreadOps;

### CamelSessionThreadMsg

    typedef struct {
    	EMsg msg;

    	int id;

    	CamelException ex;
    	CamelSessionThreadOps *ops;
    	struct _CamelOperation *op;
    	CamelSession *session;

    	void *data; /* free for implementation to define, not used by camel, do not use in client code */
    	/* user fields follow */
    } CamelSessionThreadMsg;

### camel_session_construct ()

    void                camel_session_construct             (CamelSession *session,
                                                             const char *storage_path);

`session` : |
`storage_path` : |

### camel_session_get_service ()

    CamelService*       camel_session_get_service           (CamelSession *session,
                                                             const char *url_string,
                                                             CamelProviderType type,
                                                             CamelException *ex);

`session` : |
`url_string` : |
`type` : |
`ex` : |
Returns : |

### camel_session_get_service_connected ()

    CamelService*       camel_session_get_service_connected (CamelSession *session,
                                                             const char *url_string,
                                                             CamelProviderType type,
                                                             CamelException *ex);

`session` : |
`url_string` : |
`type` : |
`ex` : |
Returns : |

### camel_session_get_store()

    #define             camel_session_get_store(session, url_string, ex)

`session` : |
`url_string` : |
`ex` : |

### camel_session_get_transport()

    #define             camel_session_get_transport(session, url_string, ex)

`session` : |
`url_string` : |
`ex` : |

### camel_session_get_storage_path ()

    char*               camel_session_get_storage_path      (CamelSession *session,
                                                             CamelService *service,
                                                             CamelException *ex);

`session` : |
`service` : |
`ex` : |
Returns : |

### camel_session_get_password ()

    char*               camel_session_get_password          (CamelSession *session,
                                                             CamelService *service,
                                                             const char *domain,
                                                             const char *prompt,
                                                             const char *item,
                                                             guint32 flags,
                                                             CamelException *ex);

`session` : |
`service` : |
`domain` : |
`prompt` : |
`item` : |
`flags` : |
`ex` : |
Returns : |

### camel_session_forget_password ()

    void                camel_session_forget_password       (CamelSession *session,
                                                             CamelService *service,
                                                             const char *domain,
                                                             const char *item,
                                                             CamelException *ex);

`session` : |
`service` : |
`domain` : |
`item` : |
`ex` : |

### camel_session_alert_user ()

    gboolean            camel_session_alert_user            (CamelSession *session,
                                                             CamelSessionAlertType type,
                                                             const char *prompt,
                                                             gboolean cancel);

`session` : |
`type` : |
`prompt` : |
`cancel` : |
Returns : |

### camel_session_build_password_prompt ()

    char*               camel_session_build_password_prompt (const char *type,
                                                             const char *user,
                                                             const char *host);

`type` : |
`user` : |
`host` : |
Returns : |

### camel_session_is_online ()

    gboolean            camel_session_is_online             (CamelSession *session);

`session` : |
Returns : |

### camel_session_set_online ()

    void                camel_session_set_online            (CamelSession *session,
                                                             gboolean online);

`session` : |
`online` : |

### camel_session_get_filter_driver ()

    CamelFilterDriver*  camel_session_get_filter_driver     (CamelSession *session,
                                                             const char *type,
                                                             CamelException *ex);

`session` : |
`type` : |
`ex` : |
Returns : |

### camel_session_check_junk ()

    gboolean            camel_session_check_junk            (CamelSession *session);

`session` : |
Returns : |

### camel_session_set_check_junk ()

    void                camel_session_set_check_junk        (CamelSession *session,
                                                             gboolean check_junk);

`session` : |
`check_junk` : |

### camel_session_thread_msg_new ()

    void*               camel_session_thread_msg_new        (CamelSession *session,
                                                             CamelSessionThreadOps *ops,
                                                             unsigned int size);

`session` : |
`ops` : |
`size` : |
Returns : |

### camel_session_thread_msg_free ()

    void                camel_session_thread_msg_free       (CamelSession *session,
                                                             CamelSessionThreadMsg *msg);

`session` : |
`msg` : |

### camel_session_thread_queue ()

    int                 camel_session_thread_queue          (CamelSession *session,
                                                             CamelSessionThreadMsg *msg,
                                                             int flags);

`session` : |
`msg` : |
`flags` : |
Returns : |

### camel_session_thread_wait ()

    void                camel_session_thread_wait           (CamelSession *session,
                                                             int id);

`session` : |
`id` : |

### camel_session_get_network_state ()

    gboolean            camel_session_get_network_state     (CamelSession *session);

`session` : |
Returns : |

### camel_session_set_network_state ()

    void                camel_session_set_network_state     (CamelSession *session,
                                                             gboolean network_state);

`session` : |
`network_state` : |

### camel_session_get_junk_headers ()

    const GHashTable*   camel_session_get_junk_headers      (CamelSession *session);

`session` : |
Returns : |

### camel_session_set_junk_headers ()

    void                camel_session_set_junk_headers      (CamelSession *session,
                                                             const char **headers,
                                                             const char **values,
                                                             int len);

`session` : |
`headers` : |
`values` : |
`len` : |

### camel_session_lookup_addressbook ()

    gboolean            camel_session_lookup_addressbook    (CamelSession *session,
                                                             const char *name);

`session` : |
`name` : |
Returns : |