Split camel-imapx library and merge into camel so that providers can be written on...
[platform/upstream/evolution-data-server.git] / camel / camel-imapx-folder.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-imap-folder.h : Class for a IMAP folder */
3
4 /*
5  * Authors: Michael Zucchi <notzed@ximian.com>
6  *
7  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of version 2 of the GNU Lesser General Public
11  * License as published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23
24 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
25 #error "Only <camel/camel.h> can be included directly."
26 #endif
27
28 #ifndef CAMEL_IMAPX_FOLDER_H
29 #define CAMEL_IMAPX_FOLDER_H
30
31 #include <camel/camel-offline-folder.h>
32 #include <camel/camel-data-cache.h>
33 #include <camel/camel-folder-search.h>
34 #include <camel/camel-store.h>
35
36 /* Standard GObject macros */
37 #define CAMEL_TYPE_IMAPX_FOLDER \
38         (camel_imapx_folder_get_type ())
39 #define CAMEL_IMAPX_FOLDER(obj) \
40         (G_TYPE_CHECK_INSTANCE_CAST \
41         ((obj), CAMEL_TYPE_IMAPX_FOLDER, CamelIMAPXFolder))
42 #define CAMEL_IMAPX_FOLDER_CLASS(cls) \
43         (G_TYPE_CHECK_CLASS_CAST \
44         ((cls), CAMEL_TYPE_IMAPX_FOLDER, CamelIMAPXFolderClass))
45 #define CAMEL_IS_IMAPX_FOLDER(obj) \
46         (G_TYPE_CHECK_INSTANCE_TYPE \
47         ((obj), CAMEL_TYPE_IMAPX_FOLDER))
48 #define CAMEL_IS_IMAPX_FOLDER_CLASS(cls) \
49         (G_TYPE_CHECK_CLASS_TYPE \
50         ((cls), CAMEL_TYPE_IMAPX_FOLDER))
51 #define CAMEL_IMAPX_FOLDER_GET_CLASS(obj) \
52         (G_TYPE_INSTANCE_GET_CLASS \
53         ((obj), CAMEL_TYPE_IMAPX_FOLDER, CamelIMAPXFolderClass))
54
55 G_BEGIN_DECLS
56
57 typedef struct _CamelIMAPXFolder CamelIMAPXFolder;
58 typedef struct _CamelIMAPXFolderClass CamelIMAPXFolderClass;
59
60 struct _CamelIMAPXFolder {
61         CamelOfflineFolder parent;
62
63         gchar *raw_name;
64         CamelDataCache *cache;
65         CamelFolderSearch *search;
66
67         guint32 exists_on_server;
68         guint32 unread_on_server;
69         guint64 modseq_on_server;
70         guint64 uidvalidity_on_server;
71         guint32 uidnext_on_server;
72
73         /* hash table of UIDs to ignore as recent when updating folder */
74         GHashTable *ignore_recent;
75
76         GMutex *search_lock;
77         GMutex *stream_lock;
78
79         gboolean apply_filters;         /* persistent property */
80 };
81
82 struct _CamelIMAPXFolderClass {
83         CamelOfflineFolderClass parent_class;
84 };
85
86 GType           camel_imapx_folder_get_type     (void);
87 CamelFolder *   camel_imapx_folder_new          (CamelStore *parent,
88                                                  const gchar *path,
89                                                  const gchar *raw,
90                                                  GError **error);
91 gchar *         imapx_get_filename              (CamelFolder *folder,
92                                                  const gchar *uid,
93                                                  GError **error);
94
95 G_END_DECLS
96
97 #endif /* CAMEL_IMAPX_FOLDER_H */