Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-imapx-store-summary.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
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 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
23 #error "Only <camel/camel.h> can be included directly."
24 #endif
25
26 #ifndef CAMEL_IMAPX_STORE_SUMMARY_H
27 #define CAMEL_IMAPX_STORE_SUMMARY_H
28
29 #include <camel/camel-store-summary.h>
30
31 /* Standard GObject macros */
32 #define CAMEL_TYPE_IMAPX_STORE_SUMMARY \
33         (camel_imapx_store_summary_get_type ())
34 #define CAMEL_IMAPX_STORE_SUMMARY(obj) \
35         (G_TYPE_CHECK_INSTANCE_CAST \
36         ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummary))
37 #define CAMEL_IMAPX_STORE_SUMMARY_CLASS(cls) \
38         (G_TYPE_CHECK_CLASS_CAST \
39         ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
40 #define CAMEL_IS_IMAPX_STORE_SUMMARY(obj) \
41         (G_TYPE_CHECK_INSTANCE_TYPE \
42         ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
43 #define CAMEL_IS_IMAPX_STORE_SUMMARY_CLASS(cls) \
44         (G_TYPE_CHECK_CLASS_TYPE \
45         ((cls), CAMEL_TYPE_IMAPX_STORE_SUMMARY))
46 #define CAMEL_IMAPX_STORE_SUMMARY_GET_CLASS(obj) \
47         (G_TYPE_INSTANCE_GET_CLASS \
48         ((obj), CAMEL_TYPE_IMAPX_STORE_SUMMARY, CamelIMAPXStoreSummaryClass))
49
50 G_BEGIN_DECLS
51
52 typedef struct _CamelIMAPXStoreSummary CamelIMAPXStoreSummary;
53 typedef struct _CamelIMAPXStoreSummaryClass CamelIMAPXStoreSummaryClass;
54
55 typedef struct _CamelIMAPXStoreInfo CamelIMAPXStoreInfo;
56
57 enum {
58         CAMEL_IMAPX_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
59         CAMEL_IMAPX_STORE_INFO_LAST
60 };
61
62 struct _CamelIMAPXStoreInfo {
63         CamelStoreInfo info;
64         gchar *full_name;
65 };
66
67 typedef struct _CamelIMAPXStoreNamespace CamelIMAPXStoreNamespace;
68
69 struct _CamelIMAPXStoreNamespace {
70         CamelIMAPXStoreNamespace *next;
71         gchar *path;            /* display path */
72         gchar *full_name;       /* real name */
73         gchar sep;              /* directory separator */
74 };
75
76 typedef struct _CamelIMAPXNamespaceList {
77         CamelIMAPXStoreNamespace *personal;
78         CamelIMAPXStoreNamespace *other;
79         CamelIMAPXStoreNamespace *shared;
80 } CamelIMAPXNamespaceList;
81
82 struct _CamelIMAPXStoreSummary {
83         CamelStoreSummary parent;
84
85         /* header info */
86         guint32 version;        /* version of base part of file */
87         guint32 capabilities;
88         CamelIMAPXNamespaceList *namespaces; /* eventually to be a list */
89 };
90
91 struct _CamelIMAPXStoreSummaryClass {
92         CamelStoreSummaryClass parent_class;
93 };
94
95 GType           camel_imapx_store_summary_get_type (void);
96 CamelIMAPXStoreSummary *
97                 camel_imapx_store_summary_new   (void);
98
99 /* TODO: this api needs some more work, needs to support lists */
100 CamelIMAPXStoreNamespace *
101                 camel_imapx_store_summary_namespace_new
102                                                 (CamelIMAPXStoreSummary *s,
103                                                  const gchar *full_name,
104                                                  gchar dir_sep);
105 void            camel_imapx_store_summary_namespace_set
106                                                 (CamelIMAPXStoreSummary *s,
107                                                  CamelIMAPXStoreNamespace *ns);
108 CamelIMAPXStoreNamespace *
109                 camel_imapx_store_summary_namespace_find_path
110                                                 (CamelIMAPXStoreSummary *s,
111                                                  const gchar *path);
112 CamelIMAPXStoreNamespace *
113                 camel_imapx_store_summary_namespace_find_full
114                                                 (CamelIMAPXStoreSummary *s,
115                                                  const gchar *full_name);
116
117 /* converts to/from utf8 canonical nasmes */
118 gchar *         camel_imapx_store_summary_full_to_path
119                                                 (CamelIMAPXStoreSummary *s,
120                                                  const gchar *full_name,
121                                                  gchar dir_sep);
122 gchar *         camel_imapx_store_summary_path_to_full
123                                                 (CamelIMAPXStoreSummary *s,
124                                                  const gchar *path,
125                                                  gchar dir_sep);
126
127 CamelIMAPXStoreInfo *
128                 camel_imapx_store_summary_full_name
129                                                 (CamelIMAPXStoreSummary *s,
130                                                  const gchar *full_name);
131 CamelIMAPXStoreInfo *
132                 camel_imapx_store_summary_add_from_full
133                                                 (CamelIMAPXStoreSummary *s,
134                                                  const gchar *full_name,
135                                                  gchar dir_sep);
136
137 /* a convenience lookup function. always use this if path known */
138 gchar *         camel_imapx_store_summary_full_from_path
139                                                 (CamelIMAPXStoreSummary *s,
140                                                  const gchar *path);
141
142 void            camel_imapx_store_summary_set_namespaces
143                                                 (CamelIMAPXStoreSummary *summary,
144                                                  const CamelIMAPXNamespaceList *nsl);
145
146 /* helpe macro's */
147 #define camel_imapx_store_info_full_name(s, i) \
148         (camel_store_info_string ( \
149                 (CamelStoreSummary *) s, (const CamelStoreInfo *) i, \
150                 CAMEL_IMAPX_STORE_INFO_FULL_NAME))
151
152 G_END_DECLS
153
154 #endif /* CAMEL_IMAP_STORE_SUMMARY_H */