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