[evolution-kolab/ek-wip-porting-imapx] IMAPX: initial subclassing of CamelIMAPXStore



commit 5752ac330ccab3480c332aca2baa17d5bc4acc69
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Dec 5 19:38:23 2011 +0100

    IMAPX: initial subclassing of CamelIMAPXStore
    
    * added CamelIMAPXExtdStore GObject class, deriving from
      CamelIMAPXStore

 src/camel/providers/imapx/Makefile.am              |    2 +
 src/camel/providers/imapx/camel-imapx-extd-store.c |  115 ++++++++++++++++++++
 src/camel/providers/imapx/camel-imapx-extd-store.h |   81 ++++++++++++++
 3 files changed, 198 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/providers/imapx/Makefile.am b/src/camel/providers/imapx/Makefile.am
index 2948c53..4be7947 100644
--- a/src/camel/providers/imapx/Makefile.am
+++ b/src/camel/providers/imapx/Makefile.am
@@ -31,6 +31,7 @@ libcamelimapx_la_SOURCES =			\
 	camel-imapx-settings.c			\
 	camel-imapx-store-summary.c		\
 	camel-imapx-store.c			\
+	camel-imapx-extd-store.c		\
 	camel-imapx-stream.c			\
 	camel-imapx-summary.c			\
 	camel-imapx-utils.c
@@ -45,6 +46,7 @@ noinst_HEADERS =				\
 	camel-imapx-settings.h			\
 	camel-imapx-store-summary.h		\
 	camel-imapx-store.h			\
+	camel-imapx-extd-store.h		\
 	camel-imapx-stream.h			\
 	camel-imapx-summary.h			\
 	camel-imapx-utils.h
diff --git a/src/camel/providers/imapx/camel-imapx-extd-store.c b/src/camel/providers/imapx/camel-imapx-extd-store.c
new file mode 100644
index 0000000..99cd39b
--- /dev/null
+++ b/src/camel/providers/imapx/camel-imapx-extd-store.c
@@ -0,0 +1,115 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/***************************************************************************
+ *            camel-imapx-extd-store.c
+ *
+ *  2011-12-05, 19:11:27
+ *  Copyright 2011, Christian Hilberg
+ *  <hilberg unix-ag org>
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with main.c; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
+ */
+
+/*----------------------------------------------------------------------------*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <libekolabutil/camel-system-headers.h>
+
+#include "camel-imapx-extd-store.h"
+
+/*----------------------------------------------------------------------------*/
+
+/* Forward Declarations */
+static void camel_imapx_extd_store_initable_init (GInitableIface *interface);
+static void camel_imapx_extd_store_network_service_init (CamelNetworkServiceInterface *interface);
+static void camel_imapx_extd_store_subscribable_init (CamelSubscribableInterface *interface);
+
+G_DEFINE_TYPE_WITH_CODE (
+	CamelIMAPXExtdStore,
+	camel_imapx_extd_store,
+	CAMEL_TYPE_IMAPX_STORE,
+	G_IMPLEMENT_INTERFACE (
+		G_TYPE_INITABLE,
+		camel_imapx_extd_store_initable_init)
+	G_IMPLEMENT_INTERFACE (
+		CAMEL_TYPE_NETWORK_SERVICE,
+		camel_imapx_extd_store_network_service_init)
+	G_IMPLEMENT_INTERFACE (
+		CAMEL_TYPE_SUBSCRIBABLE,
+		camel_imapx_extd_store_subscribable_init))
+
+/*----------------------------------------------------------------------------*/
+/* object/class init */
+
+static void
+camel_imapx_extd_store_init (CamelIMAPXExtdStore *object)
+{
+	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (object));
+}
+
+static void
+camel_imapx_extd_store_dispose (GObject *object)
+{
+	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (object));
+
+	G_OBJECT_CLASS (camel_imapx_extd_store_parent_class)->dispose (object);
+}
+
+static void
+camel_imapx_extd_store_finalize (GObject *object)
+{
+	g_assert (CAMEL_IS_IMAPX_EXTD_STORE (object));
+
+	G_OBJECT_CLASS (camel_imapx_extd_store_parent_class)->finalize (object);
+}
+
+static void
+camel_imapx_extd_store_initable_init (GInitableIface *interface)
+{
+	g_assert (interface != NULL);
+}
+
+static void
+camel_imapx_extd_store_network_service_init (CamelNetworkServiceInterface *interface)
+{
+	g_assert (CAMEL_IS_NETWORK_SERVICE_INTERFACE (interface));
+}
+
+static void
+camel_imapx_extd_store_subscribable_init (CamelSubscribableInterface *interface)
+{
+	g_assert (CAMEL_IS_SUBSCRIBABLE_INTERFACE (interface));
+}
+
+static void
+camel_imapx_extd_store_class_init (CamelIMAPXExtdStoreClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	/* g_type_class_add_private (klass, sizeof (CamelIMAPXExtdStorePrivate)); */
+
+	object_class->dispose = camel_imapx_extd_store_dispose;
+	object_class->finalize = camel_imapx_extd_store_finalize;
+}
+
+/*----------------------------------------------------------------------------*/
+/* API functions */
+
+
+/*----------------------------------------------------------------------------*/
diff --git a/src/camel/providers/imapx/camel-imapx-extd-store.h b/src/camel/providers/imapx/camel-imapx-extd-store.h
new file mode 100644
index 0000000..97308f1
--- /dev/null
+++ b/src/camel/providers/imapx/camel-imapx-extd-store.h
@@ -0,0 +1,81 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/***************************************************************************
+ *            camel-imapx-extd-store.h
+ *
+ *  2011-12-05, 19:05:30
+ *  Copyright 2011, Christian Hilberg
+ *  <hilberg unix-ag org>
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with main.c; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
+ */
+
+/*----------------------------------------------------------------------------*/
+
+#ifndef _CAMEL_IMAPX_EXTD_STORE_H_
+#define _CAMEL_IMAPX_EXTD_STORE_H_
+
+/*----------------------------------------------------------------------------*/
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "camel-imapx-store.h"
+
+/*----------------------------------------------------------------------------*/
+/* Standard GObject macros */
+
+#define CAMEL_TYPE_IMAPX_EXTD_STORE	  \
+	(camel_imapx_extd_store_get_type ())
+#define CAMEL_IMAPX_EXTD_STORE(obj)	  \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	 ((obj), CAMEL_TYPE_IMAPX_EXTD_STORE, CamelIMAPXExtdStore))
+#define CAMEL_IMAPX_EXTD_STORE_CLASS(klass)	  \
+	(G_TYPE_CHECK_CLASS_CAST \
+	 ((klass), CAMEL_TYPE_IMAPX_EXTD_STORE, CamelIMAPXExtdStoreClass))
+#define CAMEL_IS_IMAPX_EXTD_STORE(obj)	  \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	 ((obj), CAMEL_TYPE_IMAPX_EXTD_STORE))
+#define CAMEL_IS_IMAPX_EXTD_STORE_CLASS(klass)	  \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	 ((klass), CAMEL_TYPE_IMAPX_EXTD_STORE))
+#define CAMEL_IMAPX_EXTD_STORE_GET_CLASS(obj)	  \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	 ((obj), CAMEL_TYPE_IMAPX_EXTD_STORE, CamelIMAPXExtdStoreClass))
+
+G_BEGIN_DECLS
+
+typedef struct _CamelIMAPXExtdStore CamelIMAPXExtdStore;
+typedef struct _CamelIMAPXExtdStoreClass CamelIMAPXExtdStoreClass;
+
+struct _CamelIMAPXExtdStore {
+	CamelIMAPXStore parent;
+};
+
+struct _CamelIMAPXExtdStoreClass {
+	CamelIMAPXStoreClass parent_class;
+};
+
+GType
+camel_imapx_extd_store_get_type (void);
+
+G_END_DECLS
+
+/*----------------------------------------------------------------------------*/
+
+#endif /* _CAMEL_IMAPX_EXTD_STORE_H_ */
+
+/*----------------------------------------------------------------------------*/



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