1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2000 Ximian Inc.
5 * Authors: Michael Zucchi <notzed@ximian.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU Lesser General Public
9 * License as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef _CAMEL_FOLDER_THREAD_H
23 #define _CAMEL_FOLDER_THREAD_H
25 #include <camel/camel-folder-summary.h>
26 #include <camel/camel-folder.h>
30 typedef struct _CamelFolderThreadNode {
31 struct _CamelFolderThreadNode *next, *parent, *child;
32 const CamelMessageInfo *message;
33 char *root_subject; /* cached root equivalent subject */
35 guint32 re:1; /* re version of subject? */
36 } CamelFolderThreadNode;
38 typedef struct _CamelFolderThread {
39 guint32 refcount : 31;
42 struct _CamelFolderThreadNode *tree;
43 struct _EMemChunk *node_chunks;
48 /* interface 1: using uid's */
49 CamelFolderThread *camel_folder_thread_messages_new(CamelFolder *folder, GPtrArray *uids, gboolean thread_subject);
50 void camel_folder_thread_messages_apply(CamelFolderThread *thread, GPtrArray *uids);
52 /* interface 2: using messageinfo's. Currently disabled. */
54 /* new improved interface */
55 CamelFolderThread *camel_folder_thread_messages_new_summary(GPtrArray *summary);
56 void camel_folder_thread_messages_add(CamelFolderThread *thread, GPtrArray *summary);
57 void camel_folder_thread_messages_remove(CamelFolderThread *thread, GPtrArray *uids);
60 void camel_folder_thread_messages_ref(CamelFolderThread *threads);
61 void camel_folder_thread_messages_unref(CamelFolderThread *threads);
63 /* debugging function only */
64 int camel_folder_threaded_messages_dump(CamelFolderThreadNode *c);
68 #endif /* !_CAMEL_FOLDER_THREAD_H */