Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-folder-thread.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Copyright (C) 2000 Ximian Inc.
4  *
5  *  Authors: Michael Zucchi <notzed@ximian.com>
6  *
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.
10  *
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.
15  *
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.
20  */
21
22 #ifndef _CAMEL_FOLDER_THREAD_H
23 #define _CAMEL_FOLDER_THREAD_H
24
25 #include <camel/camel-folder-summary.h>
26 #include <camel/camel-folder.h>
27
28 G_BEGIN_DECLS
29
30 typedef struct _CamelFolderThreadNode {
31         struct _CamelFolderThreadNode *next, *parent, *child;
32         const CamelMessageInfo *message;
33         char *root_subject;     /* cached root equivalent subject */
34         guint32 order:31;
35         guint32 re:1;                   /* re version of subject? */
36 } CamelFolderThreadNode;
37
38 typedef struct _CamelFolderThread {
39         guint32 refcount  : 31;
40         guint32 subject   : 1;
41         
42         struct _CamelFolderThreadNode *tree;
43         struct _EMemChunk *node_chunks;
44         CamelFolder *folder;
45         GPtrArray *summary;
46 } CamelFolderThread;
47
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);
51
52 /* interface 2: using messageinfo's.  Currently disabled. */
53 #if 0
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);
58 #endif
59
60 void camel_folder_thread_messages_ref(CamelFolderThread *threads);
61 void camel_folder_thread_messages_unref(CamelFolderThread *threads);
62
63 /* debugging function only */
64 int camel_folder_threaded_messages_dump(CamelFolderThreadNode *c);
65
66 G_END_DECLS
67
68 #endif /* !_CAMEL_FOLDER_THREAD_H */