[IMAPx] Do not open each folder on LIST/LSUB responses
[platform/upstream/evolution-data-server.git] / camel / providers / imapx / camel-imapx-conn-manager.h
1 /*-*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-imap-conn-manager.h
3  *
4  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
5  *
6  * Authors: Chenthill Palanisamy <pchenthill@novell.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of version 2 of the GNU Lesser General Public
10  * License as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21
22 #ifndef _CAMEL_IMAPX_CONN_MANAGER_H
23 #define _CAMEL_IMAPX_CONN_MANAGER_H
24
25 #include "camel-imapx-server.h"
26
27 G_BEGIN_DECLS
28
29 /* Standard GObject macros */
30 #define CAMEL_TYPE_IMAPX_CONN_MANAGER \
31         (camel_imapx_conn_manager_get_type ())
32 #define CAMEL_IMAPX_CONN_MANAGER(obj) \
33         (G_TYPE_CHECK_INSTANCE_CAST \
34         ((obj), CAMEL_TYPE_IMAPX_CONN_MANAGER, CamelIMAPXConnManager))
35 #define CAMEL_IMAPX_CONN_MANAGER_CLASS(cls) \
36         (G_TYPE_CHECK_CLASS_CAST \
37         ((cls), CAMEL_TYPE_IMAPX_CONN_MANAGER, CamelIMAPXConnManagerClass))
38 #define CAMEL_IS_IMAPX_CONN_MANAGER(obj) \
39         (G_TYPE_CHECK_INSTANCE_TYPE \
40         ((obj), CAMEL_TYPE_IMAPX_CONN_MANAGER))
41 #define CAMEL_IS_IMAPX_CONN_MANAGER_CLASS(cls) \
42         (G_TYPE_CHECK_CLASS_TYPE \
43         ((cls), CAMEL_TYPE_IMAPX_CONN_MANAGER))
44 #define CAMEL_IMAPX_CONN_MANAGER_GET_CLASS(obj) \
45         (G_TYPE_INSTANCE_GET_CLASS \
46         ((obj), CAMEL_TYPE_IMAPX_CONN_MANAGER, CamelIMAPXConnManagerClass))
47
48 typedef struct _CamelIMAPXConnManager CamelIMAPXConnManager;
49 typedef struct _CamelIMAPXConnManagerClass CamelIMAPXConnManagerClass;
50 typedef struct _CamelIMAPXConnManagerPrivate CamelIMAPXConnManagerPrivate;
51
52 struct _CamelIMAPXConnManager {
53         GObject parent;
54
55         CamelIMAPXConnManagerPrivate *priv;
56 };
57
58 struct _CamelIMAPXConnManagerClass {
59         GObjectClass parent_class;
60
61         /* Signals */
62         void            (*mailbox_created)      (CamelIMAPXConnManager *con_man,
63                                                  CamelIMAPXMailbox *mailbox);
64         void            (*mailbox_renamed)      (CamelIMAPXConnManager *con_man,
65                                                  CamelIMAPXMailbox *mailbox,
66                                                  const gchar *oldname);
67         void            (*mailbox_updated)      (CamelIMAPXConnManager *con_man,
68                                                  CamelIMAPXMailbox *mailbox);
69 };
70
71 GType           camel_imapx_conn_manager_get_type (void);
72 CamelIMAPXConnManager *
73                 camel_imapx_conn_manager_new    (CamelStore *store);
74 CamelStore *    camel_imapx_conn_manager_ref_store
75                                                 (CamelIMAPXConnManager *con_man);
76 CamelIMAPXServer *
77                 camel_imapx_conn_manager_get_connection
78                                                 (CamelIMAPXConnManager *con_man,
79                                                  const gchar *folder_name,
80                                                  gboolean for_expensive_job,
81                                                  GCancellable *cancellable,
82                                                  GError **error);
83 void            camel_imapx_conn_manager_close_connections
84                                                 (CamelIMAPXConnManager *con_man);
85 GList *         camel_imapx_conn_manager_get_connections
86                                                 (CamelIMAPXConnManager *con_man);
87 void            camel_imapx_conn_manager_update_con_info
88                                                 (CamelIMAPXConnManager *con_man,
89                                                  CamelIMAPXServer *server,
90                                                  const gchar *folder_name);
91 CamelIMAPXMailbox *
92                 camel_imapx_conn_manager_ref_mailbox
93                                                 (CamelIMAPXConnManager *con_man,
94                                                  const gchar *mailbox_name);
95
96 G_END_DECLS
97
98 #endif /* _CAMEL_IMAPX_SERVER_H */