Split camel-imapx library and merge into camel so that providers can be written on...
[platform/upstream/evolution-data-server.git] / camel / camel-imapx-store.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-imap-store.h : class for an imap store */
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
29 #ifndef CAMEL_IMAPX_STORE_H
30 #define CAMEL_IMAPX_STORE_H
31
32 #include <camel/camel.h>
33
34 #include "camel-imapx-server.h"
35 #include "camel-imapx-store-summary.h"
36 #include "camel-imapx-conn-manager.h"
37
38 /* Standard GObject macros */
39 #define CAMEL_TYPE_IMAPX_STORE \
40         (camel_imapx_store_get_type ())
41 #define CAMEL_IMAPX_STORE(obj) \
42         (G_TYPE_CHECK_INSTANCE_CAST \
43         ((obj), CAMEL_TYPE_IMAPX_STORE, CamelIMAPXStore))
44 #define CAMEL_IMAPX_STORE_CLASS(cls) \
45         (G_TYPE_CHECK_CLASS_CAST \
46         ((cls), CAMEL_TYPE_IMAPX_STORE, CamelIMAPXStoreClass))
47 #define CAMEL_IS_IMAPX_STORE(obj) \
48         (G_TYPE_CHECK_INSTANCE_TYPE \
49         ((obj), CAMEL_TYPE_IMAPX_STORE))
50 #define CAMEL_IS_IMAPX_STORE_CLASS(cls) \
51         (G_TYPE_CHECK_CLASS_TYPE \
52         ((cls), CAMEL_TYPE_IMAPX_STORE))
53 #define CAMEL_IMAPX_GET_CLASS(obj) \
54         (G_TYPE_INSTANCE_GET_CLASS \
55         ((obj), CAMEL_TYPE_IMAPX_STORE, CamelIMAPXStoreClass))
56
57 G_BEGIN_DECLS
58
59 typedef struct _CamelIMAPXStore CamelIMAPXStore;
60 typedef struct _CamelIMAPXStoreClass CamelIMAPXStoreClass;
61 typedef struct _CamelIMAPXStorePrivate CamelIMAPXStorePrivate;
62
63 struct _CamelIMAPXStore {
64         CamelOfflineStore parent;
65         CamelIMAPXStorePrivate *priv;
66
67         CamelIMAPXConnManager *con_man;
68         CamelIMAPXServer *authenticating_server;
69
70         CamelIMAPXStoreSummary *summary; /* in-memory list of folders */
71         gchar dir_sep;
72
73         guint32 rec_options;
74
75         /* Used for syncronizing get_folder_info. Check for re-use of any other lock. At the
76          * moment, could not find anything suitable for this */
77         GMutex *get_finfo_lock;
78         time_t last_refresh_time;
79
80         /* hash table of UIDs to ignore as recent when updating folder */
81         GHashTable *ignore_recent;
82
83         /* if we had a login error, what to show to user */
84         gchar *login_error;
85
86         GPtrArray *pending_list;
87 };
88
89 struct _CamelIMAPXStoreClass {
90         CamelOfflineStoreClass parent_class;
91 };
92
93 GType           camel_imapx_store_get_type      (void);
94 CamelIMAPXServer *
95                 camel_imapx_store_get_server    (CamelIMAPXStore *store,
96                                                 const gchar *folder_name,
97                                                 GCancellable *cancellable,
98                                                 GError **error);
99 void            camel_imapx_store_op_done       (CamelIMAPXStore *istore,
100                                                 CamelIMAPXServer *server,
101                                                 const gchar *folder_name);
102
103 G_END_DECLS
104
105 #endif /* CAMEL_IMAPX_STORE_H */
106