[evolution-kolab/ek-wip-porting] CamelIMAPXExtdStore: added public API functions



commit 8382fe5d225b0c9b520d9f04f9499c308c6bc11e
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Jan 10 17:56:57 2012 +0100

    CamelIMAPXExtdStore: added public API functions
    
    * added camel_imapx_extd_store_get_server()
    * added camel_imapx_extd_store_op_done()
    * this is analogous to the CamelIMAPXStore API

 src/camel/providers/imapx/camel-imapx-extd-store.c |   49 ++++++++++++++++++++
 src/camel/providers/imapx/camel-imapx-extd-store.h |   11 ++++
 2 files changed, 60 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-extd-store.c b/src/camel/providers/imapx/camel-imapx-extd-store.c
index 92a85ec..f135352 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-store.c
+++ b/src/camel/providers/imapx/camel-imapx-extd-store.c
@@ -301,5 +301,54 @@ camel_imapx_extd_store_class_init (CamelIMAPXExtdStoreClass *klass)
 /*----------------------------------------------------------------------------*/
 /* API functions */
 
+CamelIMAPXExtdServer*
+camel_imapx_extd_store_get_server (CamelIMAPXExtdStore *self,
+                                   const gchar *foldername,
+                                   GCancellable *cancellable,
+                                   GError **err)
+{
+	CamelIMAPXServer *is = NULL;
+	CamelIMAPXExtdServer *es = NULL;
+	CamelIMAPXStore *istore = NULL;
+	GError *tmp_err = NULL;
+
+	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (self));
+	/* foldername may be NULL */
+	/* cancellable may be NULL */
+	g_return_val_if_fail (err == NULL || *err == NULL, NULL);
+
+	istore = CAMEL_IMAPX_STORE (self);
+	is = camel_imapx_store_get_server (istore,
+	                                   foldername,
+	                                   cancellable,
+	                                   &tmp_err);
+	if (is == NULL) {
+		g_propagate_error (err, tmp_err);
+		return NULL;
+	}
+
+	es = CAMEL_IMAPX_EXTD_SERVER (is);
+	return es;
+}
+
+void
+camel_imapx_extd_store_op_done (CamelIMAPXExtdStore *self,
+                                CamelIMAPXExtdServer *server,
+                                const gchar *foldername)
+{
+	CamelIMAPXServer *is = NULL;
+	CamelIMAPXStore *istore = NULL;
+
+	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (self));
+	g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (server));
+	g_assert (foldername != NULL);
+
+	istore = CAMEL_IMAPX_STORE (self);
+	is = CAMEL_IMAPX_SERVER (server);
+
+	camel_imapx_store_op_done (istore,
+	                           is,
+	                           foldername);
+}
 
 /*----------------------------------------------------------------------------*/
diff --git a/src/camel/providers/imapx/camel-imapx-extd-store.h b/src/camel/providers/imapx/camel-imapx-extd-store.h
index a8c3fd4..0289b4a 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-store.h
+++ b/src/camel/providers/imapx/camel-imapx-extd-store.h
@@ -35,6 +35,7 @@
 #include <gio/gio.h>
 
 #include "camel-imapx-store.h"
+#include "camel-imapx-extd-server.h"
 
 /*----------------------------------------------------------------------------*/
 /* Standard GObject macros */
@@ -73,6 +74,16 @@ struct _CamelIMAPXExtdStoreClass {
 GType
 camel_imapx_extd_store_get_type (void);
 
+CamelIMAPXExtdServer*
+camel_imapx_extd_store_get_server (CamelIMAPXExtdStore *self,
+                                   const gchar *foldername,
+                                   GCancellable *cancellable,
+                                   GError **err);
+void
+camel_imapx_extd_store_op_done (CamelIMAPXExtdStore *self,
+                                CamelIMAPXExtdServer *server,
+                                const gchar *foldername);
+
 G_END_DECLS
 
 /*----------------------------------------------------------------------------*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]