## camel-folder-thread

camel-folder-thread

## Functions

CamelFolderThread * | camel_folder_thread_messages_new ()
void | camel_folder_thread_messages_apply ()
CamelFolderThread * | camel_folder_thread_messages_ref ()
void | camel_folder_thread_messages_unref ()
gint | camel_folder_threaded_messages_dump ()

## Types and Values

| CamelFolderThreadNode
| CamelFolderThread

## Object Hierarchy

        GBoxed
        ╰── CamelFolderThread

## Description

## Functions

### camel_folder_thread_messages_new ()

    CamelFolderThread *
    camel_folder_thread_messages_new (CamelFolder *folder,
                                      GPtrArray *uids,
                                      gboolean thread_subject);

Thread a (subset) of the messages in a folder. And sort the result in summary order.

If `thread_subject` is `TRUE`, messages with related subjects will also be threaded. The default behaviour is to only thread based on message-id.

This function is probably to be removed soon.

#### Parameters

folder | a CamelFolder |
uids | The subset of uid's to thread. If `NULL`, then thread all UID-s in the `folder` . | [element-type utf8]
thread_subject | thread based on subject also |

#### Returns

A CamelFolderThread contianing a tree of CamelFolderThreadNode's which represent the threaded structure of the messages.

### camel_folder_thread_messages_apply ()

    void
    camel_folder_thread_messages_apply (CamelFolderThread *thread,
                                        GPtrArray *uids);

Adds new `uids` into the threaded tree.

#### Parameters

thread | a CamelFolderThread |
uids | a GPtrArray array of UID-s. | [element-type utf8][transfer none]

### camel_folder_thread_messages_ref ()

    CamelFolderThread *
    camel_folder_thread_messages_ref (CamelFolderThread *thread);

Increase the reference of `thread`

#### Parameters

thread | a CamelFolderThread |

#### Returns

the referenced `thread`

### camel_folder_thread_messages_unref ()

    void
    camel_folder_thread_messages_unref (CamelFolderThread *thread);

Free all memory associated with the thread descriptor `thread` .

#### Parameters

thread | a CamelFolderThread |

### camel_folder_threaded_messages_dump ()

    gint
    camel_folder_threaded_messages_dump (CamelFolderThreadNode *c);

## Types and Values

### CamelFolderThreadNode

    typedef struct {
    	struct _CamelFolderThreadNode *next, *parent, *child;
    	const CamelMessageInfo *message;
    	gchar *root_subject; /* cached root equivalent subject */
    	guint32 order : 31;
    	guint32 re:1;			/* re version of subject? */
    } CamelFolderThreadNode;

### CamelFolderThread

    typedef struct {
    	guint32 refcount : 31;
    	guint32 subject : 1;

    	struct _CamelFolderThreadNode *tree;
    	CamelMemChunk *node_chunks;
    	CamelFolder *folder;
    	GPtrArray *summary;
    } CamelFolderThread;