CamelFolder
3
CAMEL Library

# CamelFolder

## Synopsis

    struct              CamelFolder;
                        CamelFolderChangeInfo;
                        CamelFolderQuotaInfo;
    #define             CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY
    #define             CAMEL_FOLDER_HAS_SEARCH_CAPABILITY
    #define             CAMEL_FOLDER_FILTER_RECENT
    #define             CAMEL_FOLDER_HAS_BEEN_DELETED
    #define             CAMEL_FOLDER_IS_TRASH
    #define             CAMEL_FOLDER_IS_JUNK
    #define             CAMEL_FOLDER_FILTER_JUNK
    void                camel_folder_construct              (CamelFolder *folder,
                                                             CamelStore *parent_store,
                                                             const char *full_name,
                                                             const char *name);
    void                camel_folder_refresh_info           (CamelFolder *folder,
                                                             CamelException *ex);
    void                camel_folder_sync                   (CamelFolder *folder,
                                                             gboolean expunge,
                                                             CamelException *ex);
    CamelStore*         camel_folder_get_parent_store       (CamelFolder *folder);
    void                camel_folder_expunge                (CamelFolder *folder,
                                                             CamelException *ex);
    const char*         camel_folder_get_name               (CamelFolder *folder);
    const char*         camel_folder_get_full_name          (CamelFolder *folder);
    guint32             camel_folder_get_permanent_flags    (CamelFolder *folder);
    guint32             camel_folder_get_message_flags      (CamelFolder *folder,
                                                             const char *uid);
    gboolean            camel_folder_set_message_flags      (CamelFolder *folder,
                                                             const char *uid,
                                                             guint32 flags,
                                                             guint32 set);
    gboolean            camel_folder_get_message_user_flag  (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name);
    void                camel_folder_set_message_user_flag  (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name,
                                                             gboolean value);
    const char*         camel_folder_get_message_user_tag   (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name);
    void                camel_folder_set_message_user_tag   (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name,
                                                             const char *value);
    void                camel_folder_append_message         (CamelFolder *folder,
                                                             CamelMimeMessage *message,
                                                             const CamelMessageInfo *info,
                                                             char **appended_uid,
                                                             CamelException *ex);
    gboolean            camel_folder_has_summary_capability (CamelFolder *folder);
    int                 camel_folder_get_message_count      (CamelFolder *folder);
    int                 camel_folder_get_unread_message_count
                                                            (CamelFolder *folder);
    int                 camel_folder_get_deleted_message_count
                                                            (CamelFolder *folder);
    GPtrArray*          camel_folder_get_summary            (CamelFolder *folder);
    void                camel_folder_free_summary           (CamelFolder *folder,
                                                             GPtrArray *array);
    CamelMimeMessage*   camel_folder_get_message            (CamelFolder *folder,
                                                             const char *uid,
                                                             CamelException *ex);
    #define             camel_folder_delete_message         (folder, uid)
    GPtrArray*          camel_folder_get_uids               (CamelFolder *folder);
    void                camel_folder_free_uids              (CamelFolder *folder,
                                                             GPtrArray *array);
    gboolean            camel_folder_has_search_capability  (CamelFolder *folder);
    GPtrArray*          camel_folder_search_by_expression   (CamelFolder *folder,
                                                             const char *expr,
                                                             CamelException *ex);
    GPtrArray*          camel_folder_search_by_uids         (CamelFolder *folder,
                                                             const char *expr,
                                                             GPtrArray *uids,
                                                             CamelException *ex);
    void                camel_folder_search_free            (CamelFolder *folder,
                                                             GPtrArray *result);
    CamelMessageInfo*   camel_folder_get_message_info       (CamelFolder *folder,
                                                             const char *uid);
    void                camel_folder_free_message_info      (CamelFolder *folder,
                                                             CamelMessageInfo *info);
    void                camel_folder_ref_message_info       (CamelFolder *folder,
                                                             CamelMessageInfo *info);
    void                camel_folder_transfer_messages_to   (CamelFolder *source,
                                                             GPtrArray *uids,
                                                             CamelFolder *dest,
                                                             GPtrArray **transferred_uids,
                                                             gboolean delete_originals,
                                                             CamelException *ex);
    void                camel_folder_delete                 (CamelFolder *folder);
    void                camel_folder_rename                 (CamelFolder *folder,
                                                             const char *new);
    void                camel_folder_freeze                 (CamelFolder *folder);
    void                camel_folder_thaw                   (CamelFolder *folder);
    gboolean            camel_folder_is_frozen              (CamelFolder *folder);
    CamelFolderQuotaInfo* camel_folder_get_quota_info       (CamelFolder *folder);
    CamelFolderQuotaInfo* camel_folder_quota_info_new       (const char *name,
                                                             guint64 used,
                                                             guint64 total);
    CamelFolderQuotaInfo* camel_folder_quota_info_clone     (const CamelFolderQuotaInfo *info);
    void                camel_folder_quota_info_free        (CamelFolderQuotaInfo *info);
    void                camel_folder_free_nop               (CamelFolder *folder,
                                                             GPtrArray *array);
    void                camel_folder_free_shallow           (CamelFolder *folder,
                                                             GPtrArray *array);
    void                camel_folder_free_deep              (CamelFolder *folder,
                                                             GPtrArray *array);
    CamelFolderChangeInfo* camel_folder_change_info_new     (void);
    void                camel_folder_change_info_clear      (CamelFolderChangeInfo *info);
    void                camel_folder_change_info_free       (CamelFolderChangeInfo *info);
    gboolean            camel_folder_change_info_changed    (CamelFolderChangeInfo *info);
    void                camel_folder_change_info_add_source (CamelFolderChangeInfo *info,
                                                             const char *uid);
    void                camel_folder_change_info_add_source_list
                                                            (CamelFolderChangeInfo *info,
                                                             const GPtrArray *list);
    void                camel_folder_change_info_add_update (CamelFolderChangeInfo *info,
                                                             const char *uid);
    void                camel_folder_change_info_add_update_list
                                                            (CamelFolderChangeInfo *info,
                                                             const GPtrArray *list);
    void                camel_folder_change_info_build_diff (CamelFolderChangeInfo *info);
    void                camel_folder_change_info_cat        (CamelFolderChangeInfo *info,
                                                             CamelFolderChangeInfo *src);
    void                camel_folder_change_info_add_uid    (CamelFolderChangeInfo *info,
                                                             const char *uid);
    void                camel_folder_change_info_remove_uid (CamelFolderChangeInfo *info,
                                                             const char *uid);
    void                camel_folder_change_info_change_uid (CamelFolderChangeInfo *info,
                                                             const char *uid);
    void                camel_folder_change_info_recent_uid (CamelFolderChangeInfo *info,
                                                             const char *uid);

## Description

## Details

### struct CamelFolder

    struct CamelFolder {
    	CamelObject parent_object;

    	struct _CamelFolderPrivate *priv;

    	/* get these via the :get() method, they might not be set otherwise */
    	char *name;
    	char *full_name;
    	char *description;

    	CamelStore *parent_store;
    	CamelFolderSummary *summary;

    	guint32 folder_flags;
    	guint32 permanent_flags;
    };

### CamelFolderChangeInfo

    typedef struct {
    	GPtrArray *uid_added;
    	GPtrArray *uid_removed;
    	GPtrArray *uid_changed;
    	GPtrArray *uid_recent;

    	struct _CamelFolderChangeInfoPrivate *priv;
    } CamelFolderChangeInfo;

### CamelFolderQuotaInfo

    typedef struct {
    	char *name;
    	guint64 used;
    	guint64 total;

    	struct _CamelFolderQuotaInfo *next;
    } CamelFolderQuotaInfo;

### CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY

    #define CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY (1<<0)

### CAMEL_FOLDER_HAS_SEARCH_CAPABILITY

    #define CAMEL_FOLDER_HAS_SEARCH_CAPABILITY  (1<<1)

### CAMEL_FOLDER_FILTER_RECENT

    #define CAMEL_FOLDER_FILTER_RECENT          (1<<2)

### CAMEL_FOLDER_HAS_BEEN_DELETED

    #define CAMEL_FOLDER_HAS_BEEN_DELETED       (1<<3)

### CAMEL_FOLDER_IS_TRASH

    #define CAMEL_FOLDER_IS_TRASH               (1<<4)

### CAMEL_FOLDER_IS_JUNK

    #define CAMEL_FOLDER_IS_JUNK                (1<<5)

### CAMEL_FOLDER_FILTER_JUNK

    #define CAMEL_FOLDER_FILTER_JUNK	    (1<<6)

### camel_folder_construct ()

    void                camel_folder_construct              (CamelFolder *folder,
                                                             CamelStore *parent_store,
                                                             const char *full_name,
                                                             const char *name);

`folder` :

`parent_store` :

`full_name` :

`name` :

### camel_folder_refresh_info ()

    void                camel_folder_refresh_info           (CamelFolder *folder,
                                                             CamelException *ex);

`folder` :

`ex` :

### camel_folder_sync ()

    void                camel_folder_sync                   (CamelFolder *folder,
                                                             gboolean expunge,
                                                             CamelException *ex);

`folder` :

`expunge` :

`ex` :

### camel_folder_get_parent_store ()

    CamelStore*         camel_folder_get_parent_store       (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_expunge ()

    void                camel_folder_expunge                (CamelFolder *folder,
                                                             CamelException *ex);

`folder` :

`ex` :

### camel_folder_get_name ()

    const char*         camel_folder_get_name               (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_get_full_name ()

    const char*         camel_folder_get_full_name          (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_get_permanent_flags ()

    guint32             camel_folder_get_permanent_flags    (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_get_message_flags ()

    guint32             camel_folder_get_message_flags      (CamelFolder *folder,
                                                             const char *uid);

`camel_folder_get_message_flags` is deprecated and should not be used in newly-written code. Use camel_folder_get_message_info instead.

`folder` :

`uid` :

Returns :

### camel_folder_set_message_flags ()

    gboolean            camel_folder_set_message_flags      (CamelFolder *folder,
                                                             const char *uid,
                                                             guint32 flags,
                                                             guint32 set);

`camel_folder_set_message_flags` is deprecated and should not be used in newly-written code. Use camel_message_info_set_flags on the message info directly (when it works)

`folder` :

`uid` :

`flags` :

`set` :

Returns :

### camel_folder_get_message_user_flag ()

    gboolean            camel_folder_get_message_user_flag  (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name);

`camel_folder_get_message_user_flag` is deprecated and should not be used in newly-written code. Use camel_message_info_get_user_flag on the message info directly

`folder` :

`uid` :

`name` :

Returns :

### camel_folder_set_message_user_flag ()

    void                camel_folder_set_message_user_flag  (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name,
                                                             gboolean value);

`camel_folder_set_message_user_flag` is deprecated and should not be used in newly-written code. Use camel_message_info_set_user_flag on the CamelMessageInfo directly (when it works)

Sets the user flag specified by `name` to the value specified by `value` on the indicated message. (This may or may not persist after the folder or store is closed. See camel_folder_get_permanent_flags)

`folder` :

`uid` :

`name` :

`value` :

### camel_folder_get_message_user_tag ()

    const char*         camel_folder_get_message_user_tag   (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name);

`camel_folder_get_message_user_tag` is deprecated and should not be used in newly-written code. Use camel_message_info_get_user_tag on the CamelMessageInfo directly.

`folder` :

`uid` :

`name` :

Returns :

### camel_folder_set_message_user_tag ()

    void                camel_folder_set_message_user_tag   (CamelFolder *folder,
                                                             const char *uid,
                                                             const char *name,
                                                             const char *value);

`camel_folder_set_message_user_tag` is deprecated and should not be used in newly-written code. Use camel_message_info_set_user_tag on the CamelMessageInfo directly (when it works).

Sets the user tag specified by `name` to the value specified by `value` on the indicated message. (This may or may not persist after the folder or store is closed. See camel_folder_get_permanent_flags)

`folder` :

`uid` :

`name` :

`value` :

### camel_folder_append_message ()

    void                camel_folder_append_message         (CamelFolder *folder,
                                                             CamelMimeMessage *message,
                                                             const CamelMessageInfo *info,
                                                             char **appended_uid,
                                                             CamelException *ex);

`folder` :

`message` :

`info` :

`appended_uid` :

`ex` :

### camel_folder_has_summary_capability ()

    gboolean            camel_folder_has_summary_capability (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_get_message_count ()

    int                 camel_folder_get_message_count      (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_get_unread_message_count ()

    int                 camel_folder_get_unread_message_count
                                                            (CamelFolder *folder);

`camel_folder_get_unread_message_count` is deprecated and should not be used in newly-written code. use camel_object_get instead.

`folder` :

Returns :

### camel_folder_get_deleted_message_count ()

    int                 camel_folder_get_deleted_message_count
                                                            (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_get_summary ()

    GPtrArray*          camel_folder_get_summary            (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_free_summary ()

    void                camel_folder_free_summary           (CamelFolder *folder,
                                                             GPtrArray *array);

`folder` :

`array` :

### camel_folder_get_message ()

    CamelMimeMessage*   camel_folder_get_message            (CamelFolder *folder,
                                                             const char *uid,
                                                             CamelException *ex);

`folder` :

`uid` :

`ex` :

Returns :

### camel_folder_delete_message()

    #define             camel_folder_delete_message(folder, uid)

`folder` :

`uid` :

### camel_folder_get_uids ()

    GPtrArray*          camel_folder_get_uids               (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_free_uids ()

    void                camel_folder_free_uids              (CamelFolder *folder,
                                                             GPtrArray *array);

`folder` :

`array` :

### camel_folder_has_search_capability ()

    gboolean            camel_folder_has_search_capability  (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_search_by_expression ()

    GPtrArray*          camel_folder_search_by_expression   (CamelFolder *folder,
                                                             const char *expr,
                                                             CamelException *ex);

`folder` :

`expr` :

`ex` :

Returns :

### camel_folder_search_by_uids ()

    GPtrArray*          camel_folder_search_by_uids         (CamelFolder *folder,
                                                             const char *expr,
                                                             GPtrArray *uids,
                                                             CamelException *ex);

`folder` :

`expr` :

`uids` :

`ex` :

Returns :

### camel_folder_search_free ()

    void                camel_folder_search_free            (CamelFolder *folder,
                                                             GPtrArray *result);

`folder` :

`result` :

### camel_folder_get_message_info ()

    CamelMessageInfo*   camel_folder_get_message_info       (CamelFolder *folder,
                                                             const char *uid);

`folder` :

`uid` :

Returns :

### camel_folder_free_message_info ()

    void                camel_folder_free_message_info      (CamelFolder *folder,
                                                             CamelMessageInfo *info);

`folder` :

`info` :

### camel_folder_ref_message_info ()

    void                camel_folder_ref_message_info       (CamelFolder *folder,
                                                             CamelMessageInfo *info);

`camel_folder_ref_message_info` is deprecated and should not be used in newly-written code. Use camel_message_info_ref directly.

Ref a CamelMessageInfo, previously obtained with camel_folder_get_message_info.

`folder` :

`info` :

### camel_folder_transfer_messages_to ()

    void                camel_folder_transfer_messages_to   (CamelFolder *source,
                                                             GPtrArray *uids,
                                                             CamelFolder *dest,
                                                             GPtrArray **transferred_uids,
                                                             gboolean delete_originals,
                                                             CamelException *ex);

`source` :

`uids` :

`dest` :

`transferred_uids` :

`delete_originals` :

`ex` :

### camel_folder_delete ()

    void                camel_folder_delete                 (CamelFolder *folder);

`folder` :

### camel_folder_rename ()

    void                camel_folder_rename                 (CamelFolder *folder,
                                                             const char *new);

`folder` :

`new` :

### camel_folder_freeze ()

    void                camel_folder_freeze                 (CamelFolder *folder);

`folder` :

### camel_folder_thaw ()

    void                camel_folder_thaw                   (CamelFolder *folder);

`folder` :

### camel_folder_is_frozen ()

    gboolean            camel_folder_is_frozen              (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_get_quota_info ()

    CamelFolderQuotaInfo* camel_folder_get_quota_info       (CamelFolder *folder);

`folder` :

Returns :

### camel_folder_quota_info_new ()

    CamelFolderQuotaInfo* camel_folder_quota_info_new       (const char *name,
                                                             guint64 used,
                                                             guint64 total);

`name` :

`used` :

`total` :

Returns :

### camel_folder_quota_info_clone ()

    CamelFolderQuotaInfo* camel_folder_quota_info_clone     (const CamelFolderQuotaInfo *info);

`info` :

Returns :

### camel_folder_quota_info_free ()

    void                camel_folder_quota_info_free        (CamelFolderQuotaInfo *info);

`info` :

### camel_folder_free_nop ()

    void                camel_folder_free_nop               (CamelFolder *folder,
                                                             GPtrArray *array);

`folder` :

`array` :

### camel_folder_free_shallow ()

    void                camel_folder_free_shallow           (CamelFolder *folder,
                                                             GPtrArray *array);

`folder` :

`array` :

### camel_folder_free_deep ()

    void                camel_folder_free_deep              (CamelFolder *folder,
                                                             GPtrArray *array);

`folder` :

`array` :

### camel_folder_change_info_new ()

    CamelFolderChangeInfo* camel_folder_change_info_new     (void);

Returns :

### camel_folder_change_info_clear ()

    void                camel_folder_change_info_clear      (CamelFolderChangeInfo *info);

`info` :

### camel_folder_change_info_free ()

    void                camel_folder_change_info_free       (CamelFolderChangeInfo *info);

`info` :

### camel_folder_change_info_changed ()

    gboolean            camel_folder_change_info_changed    (CamelFolderChangeInfo *info);

`info` :

Returns :

### camel_folder_change_info_add_source ()

    void                camel_folder_change_info_add_source (CamelFolderChangeInfo *info,
                                                             const char *uid);

`info` :

`uid` :

### camel_folder_change_info_add_source_list ()

    void                camel_folder_change_info_add_source_list
                                                            (CamelFolderChangeInfo *info,
                                                             const GPtrArray *list);

`info` :

`list` :

### camel_folder_change_info_add_update ()

    void                camel_folder_change_info_add_update (CamelFolderChangeInfo *info,
                                                             const char *uid);

`info` :

`uid` :

### camel_folder_change_info_add_update_list ()

    void                camel_folder_change_info_add_update_list
                                                            (CamelFolderChangeInfo *info,
                                                             const GPtrArray *list);

`info` :

`list` :

### camel_folder_change_info_build_diff ()

    void                camel_folder_change_info_build_diff (CamelFolderChangeInfo *info);

`info` :

### camel_folder_change_info_cat ()

    void                camel_folder_change_info_cat        (CamelFolderChangeInfo *info,
                                                             CamelFolderChangeInfo *src);

`info` :

`src` :

### camel_folder_change_info_add_uid ()

    void                camel_folder_change_info_add_uid    (CamelFolderChangeInfo *info,
                                                             const char *uid);

`info` :

`uid` :

### camel_folder_change_info_remove_uid ()

    void                camel_folder_change_info_remove_uid (CamelFolderChangeInfo *info,
                                                             const char *uid);

`info` :

`uid` :

### camel_folder_change_info_change_uid ()

    void                camel_folder_change_info_change_uid (CamelFolderChangeInfo *info,
                                                             const char *uid);

`info` :

`uid` :

### camel_folder_change_info_recent_uid ()

    void                camel_folder_change_info_recent_uid (CamelFolderChangeInfo *info,
                                                             const char *uid);

`info` :

`uid` :