## EMailSession EMailSession |

## Synopsis

    struct              EMailSession;
    #define             E_MAIL_SESSION_LOCAL_UID
    #define             E_MAIL_SESSION_VFOLDER_UID
    EMailSession *      e_mail_session_new                  (ESourceRegistry *registry);
    ESourceRegistry *   e_mail_session_get_registry         (EMailSession *session);
    MailFolderCache *   e_mail_session_get_folder_cache     (EMailSession *session);
    CamelStore *        e_mail_session_get_local_store      (EMailSession *session);
    CamelStore *        e_mail_session_get_vfolder_store    (EMailSession *session);
    enum                EMailLocalFolder;
    CamelFolder *       e_mail_session_get_local_folder     (EMailSession *session,
                                                             EMailLocalFolder type);
    const gchar *       e_mail_session_get_local_folder_uri (EMailSession *session,
                                                             EMailLocalFolder type);
    GList *             e_mail_session_get_available_junk_filters
                                                            (EMailSession *session);
    EMailJunkFilter *   e_mail_session_get_junk_filter_by_name
                                                            (EMailSession *session,
                                                             const gchar *filter_name);
    CamelFolder *       e_mail_session_get_inbox_sync       (EMailSession *session,
                                                             const gchar *service_uid,
                                                             GCancellable *cancellable,
                                                             GError **error);
    void                e_mail_session_get_inbox            (EMailSession *session,
                                                             const gchar *service_uid,
                                                             gint io_priority,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CamelFolder *       e_mail_session_get_inbox_finish     (EMailSession *session,
                                                             GAsyncResult *result,
                                                             GError **error);
    CamelFolder *       e_mail_session_get_trash_sync       (EMailSession *session,
                                                             const gchar *service_uid,
                                                             GCancellable *cancellable,
                                                             GError **error);
    void                e_mail_session_get_trash            (EMailSession *session,
                                                             const gchar *service_uid,
                                                             gint io_priority,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CamelFolder *       e_mail_session_get_trash_finish     (EMailSession *session,
                                                             GAsyncResult *result,
                                                             GError **error);
    CamelFolder *       e_mail_session_uri_to_folder_sync   (EMailSession *session,
                                                             const gchar *folder_uri,
                                                             CamelStoreGetFolderFlags flags,
                                                             GCancellable *cancellable,
                                                             GError **error);
    void                e_mail_session_uri_to_folder        (EMailSession *session,
                                                             const gchar *folder_uri,
                                                             CamelStoreGetFolderFlags flags,
                                                             gint io_priority,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);
    CamelFolder *       e_mail_session_uri_to_folder_finish (EMailSession *session,
                                                             GAsyncResult *result,
                                                             GError **error);
    EMVFolderContext *  e_mail_session_create_vfolder_context
                                                            (EMailSession *session);
    gboolean            e_binding_transform_service_to_source
                                                            (GBinding *binding,
                                                             const GValue *source_value,
                                                             GValue *target_value,
                                                             gpointer session);
    gboolean            e_binding_transform_source_to_service
                                                            (GBinding *binding,
                                                             const GValue *source_value,
                                                             GValue *target_value,
                                                             gpointer session);
    void                mail_session_flush_filter_log       (EMailSession *session);
    const gchar *       mail_session_get_data_dir           (void);
    const gchar *       mail_session_get_cache_dir          (void);
    const gchar *       mail_session_get_config_dir         (void);

## Object Hierarchy

      GObject
       +----CamelSession
             +----EMailSession

## Implemented Interfaces

EMailSession implements EExtensible.

## Properties

      "folder-cache"             MailFolderCache*      : Read
      "local-store"              CamelStore*           : Read
      "registry"                 ESourceRegistry*      : Read / Write / Construct Only
      "vfolder-store"            CamelStore*           : Read

## Signals

      "flush-outbox"                                   : Run First
      "refresh-service"                                : Run Last
      "store-added"                                    : Run First
      "store-removed"                                  : Run First

## Description

## Details

### struct EMailSession

    struct EMailSession;

### E_MAIL_SESSION_LOCAL_UID

    #define E_MAIL_SESSION_LOCAL_UID   "local" /* "On This Computer" */

### E_MAIL_SESSION_VFOLDER_UID

    #define E_MAIL_SESSION_VFOLDER_UID "vfolder" /* "Search Folders" */

### e_mail_session_new ()

    EMailSession *      e_mail_session_new                  (ESourceRegistry *registry);

### e_mail_session_get_registry ()

    ESourceRegistry *   e_mail_session_get_registry         (EMailSession *session);

### e_mail_session_get_folder_cache ()

    MailFolderCache *   e_mail_session_get_folder_cache     (EMailSession *session);

### e_mail_session_get_local_store ()

    CamelStore *        e_mail_session_get_local_store      (EMailSession *session);

### e_mail_session_get_vfolder_store ()

    CamelStore *        e_mail_session_get_vfolder_store    (EMailSession *session);

### enum EMailLocalFolder

    typedef enum {
    	E_MAIL_LOCAL_FOLDER_INBOX,
    	E_MAIL_LOCAL_FOLDER_DRAFTS,
    	E_MAIL_LOCAL_FOLDER_OUTBOX,
    	E_MAIL_LOCAL_FOLDER_SENT,
    	E_MAIL_LOCAL_FOLDER_TEMPLATES,
    	E_MAIL_LOCAL_FOLDER_LOCAL_INBOX,
    	E_MAIL_NUM_LOCAL_FOLDERS
    } EMailLocalFolder;

`E_MAIL_LOCAL_FOLDER_INBOX` |
`E_MAIL_LOCAL_FOLDER_DRAFTS` |
`E_MAIL_LOCAL_FOLDER_OUTBOX` |
`E_MAIL_LOCAL_FOLDER_SENT` |
`E_MAIL_LOCAL_FOLDER_TEMPLATES` |
`E_MAIL_LOCAL_FOLDER_LOCAL_INBOX` |
`E_MAIL_NUM_LOCAL_FOLDERS` |

### e_mail_session_get_local_folder ()

    CamelFolder *       e_mail_session_get_local_folder     (EMailSession *session,
                                                             EMailLocalFolder type);

### e_mail_session_get_local_folder_uri ()

    const gchar *       e_mail_session_get_local_folder_uri (EMailSession *session,
                                                             EMailLocalFolder type);

### e_mail_session_get_available_junk_filters ()

    GList *             e_mail_session_get_available_junk_filters
                                                            (EMailSession *session);

### e_mail_session_get_junk_filter_by_name ()

    EMailJunkFilter *   e_mail_session_get_junk_filter_by_name
                                                            (EMailSession *session,
                                                             const gchar *filter_name);

Looks up an EMailJunkFilter extension by its filter name, as specified in its class structure. If no match is found, the function returns `NULL`.

`session` : | an EMailSession
`filter_name` : | a junk filter name
Returns : | an EMailJunkFilter, or `NULL`

### e_mail_session_get_inbox_sync ()

    CamelFolder *       e_mail_session_get_inbox_sync       (EMailSession *session,
                                                             const gchar *service_uid,
                                                             GCancellable *cancellable,
                                                             GError **error);

### e_mail_session_get_inbox ()

    void                e_mail_session_get_inbox            (EMailSession *session,
                                                             const gchar *service_uid,
                                                             gint io_priority,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

### e_mail_session_get_inbox_finish ()

    CamelFolder *       e_mail_session_get_inbox_finish     (EMailSession *session,
                                                             GAsyncResult *result,
                                                             GError **error);

### e_mail_session_get_trash_sync ()

    CamelFolder *       e_mail_session_get_trash_sync       (EMailSession *session,
                                                             const gchar *service_uid,
                                                             GCancellable *cancellable,
                                                             GError **error);

### e_mail_session_get_trash ()

    void                e_mail_session_get_trash            (EMailSession *session,
                                                             const gchar *service_uid,
                                                             gint io_priority,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

### e_mail_session_get_trash_finish ()

    CamelFolder *       e_mail_session_get_trash_finish     (EMailSession *session,
                                                             GAsyncResult *result,
                                                             GError **error);

### e_mail_session_uri_to_folder_sync ()

    CamelFolder *       e_mail_session_uri_to_folder_sync   (EMailSession *session,
                                                             const gchar *folder_uri,
                                                             CamelStoreGetFolderFlags flags,
                                                             GCancellable *cancellable,
                                                             GError **error);

### e_mail_session_uri_to_folder ()

    void                e_mail_session_uri_to_folder        (EMailSession *session,
                                                             const gchar *folder_uri,
                                                             CamelStoreGetFolderFlags flags,
                                                             gint io_priority,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,
                                                             gpointer user_data);

### e_mail_session_uri_to_folder_finish ()

    CamelFolder *       e_mail_session_uri_to_folder_finish (EMailSession *session,
                                                             GAsyncResult *result,
                                                             GError **error);

### e_mail_session_create_vfolder_context ()

    EMVFolderContext *  e_mail_session_create_vfolder_context
                                                            (EMailSession *session);

### e_binding_transform_service_to_source ()

    gboolean            e_binding_transform_service_to_source
                                                            (GBinding *binding,
                                                             const GValue *source_value,
                                                             GValue *target_value,
                                                             gpointer session);

### e_binding_transform_source_to_service ()

    gboolean            e_binding_transform_source_to_service
                                                            (GBinding *binding,
                                                             const GValue *source_value,
                                                             GValue *target_value,
                                                             gpointer session);

### mail_session_flush_filter_log ()

    void                mail_session_flush_filter_log       (EMailSession *session);

### mail_session_get_data_dir ()

    const gchar *       mail_session_get_data_dir           (void);

### mail_session_get_cache_dir ()

    const gchar *       mail_session_get_cache_dir          (void);

### mail_session_get_config_dir ()

    const gchar *       mail_session_get_config_dir         (void);

## Property Details

### The `"folder-cache"` property

      "folder-cache"             MailFolderCache*      : Read

### The `"local-store"` property

      "local-store"              CamelStore*           : Read

Built-in local store.

### The `"registry"` property

      "registry"                 ESourceRegistry*      : Read / Write / Construct Only

Data source registry.

### The `"vfolder-store"` property

      "vfolder-store"            CamelStore*           : Read

Built-in search folder store.

## Signal Details

### The `"flush-outbox"` signal

    void                user_function                      (EMailSession *session,
                                                            gpointer      user_data)      : Run First

Emitted if the send folder should be flushed.

`session` : | the email session
`user_data` : | user data set when the signal handler was connected.

### The `"refresh-service"` signal

    void                user_function                      (EMailSession *session,
                                                            CamelService *service,
                                                            gpointer      user_data)      : Run Last

Emitted when `service` should be refreshed.

`session` : | the EMailSession that emitted the signal
`service` : | a CamelService
`user_data` : | user data set when the signal handler was connected.

### The `"store-added"` signal

    void                user_function                      (EMailSession *session,
                                                            CamelStore   *store,
                                                            gpointer      user_data)      : Run First

Emitted when a store is added

`session` : | the EMailSession that emitted the signal
`store` : | a CamelStore
`user_data` : | user data set when the signal handler was connected.

### The `"store-removed"` signal

    void                user_function                      (EMailSession *session,
                                                            CamelStore   *store,
                                                            gpointer      user_data)      : Run First

Emitted when a store is removed

`session` : | the EMailSession that emitted the signal
`store` : | a CamelStore
`user_data` : | user data set when the signal handler was connected.