[evolution-kolab/ek-wip-porting-imapx] CamelKolabIMAPXServer: added new GObject
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting-imapx] CamelKolabIMAPXServer: added new GObject
- Date: Fri, 2 Dec 2011 18:36:13 +0000 (UTC)
commit 28fb92d5a7d6f9583bb023f826604f4192d9e435
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Fri Dec 2 18:59:13 2011 +0100
CamelKolabIMAPXServer: added new GObject
* added CamelKolabIMAPXServer as a descendant of
CamelIMAPXExtdServer
* some stuff from camel-kolab-imapx-metadata.[hc]
needs to be moved there (that is, the functions
which in gnome-2-30 take a CamelService* and a
CamelSession* arg)
src/camel/Makefile.am | 94 ++++++++++++-----------
src/camel/camel-kolab-imapx-server.c | 137 ++++++++++++++++++++++++++++++++++
src/camel/camel-kolab-imapx-server.h | 95 +++++++++++++++++++++++
3 files changed, 280 insertions(+), 46 deletions(-)
---
diff --git a/src/camel/Makefile.am b/src/camel/Makefile.am
index 84ff024..b211fd7 100644
--- a/src/camel/Makefile.am
+++ b/src/camel/Makefile.am
@@ -4,69 +4,71 @@ camel_provider_DATA = libcamelkolab.urls
#lib_LTLIBRARIES = \
# libcamelkolab.la
-libcamelkolab_la_SOURCES = \
- camel-kolab-stream.c \
- camel-kolab-imapx-provider.c \
- camel-kolab-imapx-store.c \
- camel-kolab-imapx-transport.c \
- camel-kolab-imapx-folder.c \
- camel-kolab-session.c \
- camel-kolab-imapx-metadata.c \
- camel-kolab-imapx-metadata-db.c
+libcamelkolab_la_SOURCES = \
+ camel-kolab-imapx-folder.c \
+ camel-kolab-imapx-metadata-db.c \
+ camel-kolab-imapx-metadata.c \
+ camel-kolab-imapx-provider.c \
+ camel-kolab-imapx-server.c \
+ camel-kolab-imapx-store.c \
+ camel-kolab-imapx-transport.c \
+ camel-kolab-session.c \
+ camel-kolab-stream.c
-libcamelkolab_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- $(SQLITE_CFLAGS) \
- $(KOLAB_INCLUDE) \
+libcamelkolab_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ $(SQLITE_CFLAGS) \
+ $(KOLAB_INCLUDE) \
-DG_LOG_DOMAIN=\"camel-kolab\"
-libcamelkolab_la_CFLAGS = \
- $(CFLAGS) \
- $(ADD_CFLAGS) \
- $(SQLITE_CFLAGS) \
+libcamelkolab_la_CFLAGS = \
+ $(CFLAGS) \
+ $(ADD_CFLAGS) \
+ $(SQLITE_CFLAGS) \
-Wno-missing-field-initializers
-libcamelkolab_la_LDFLAGS = \
- -module \
+libcamelkolab_la_LDFLAGS = \
+ -module \
-avoid-version
-libcamelkolab_la_LIBADD = \
- $(SQLITE_LIBS) \
- $(CAMEL_LIBS) \
- $(GLIB_LIBS) \
- $(EDS_LIBS) \
- $(NSS_LIBS) \
- $(KOLAB_LIB_CAMEL_IMAPX) \
+libcamelkolab_la_LIBADD = \
+ $(SQLITE_LIBS) \
+ $(CAMEL_LIBS) \
+ $(GLIB_LIBS) \
+ $(EDS_LIBS) \
+ $(NSS_LIBS) \
+ $(KOLAB_LIB_CAMEL_IMAPX) \
$(KOLAB_LIB_EKOLABUTIL)
-EXTRA_DIST = \
+EXTRA_DIST = \
$(camel_provider_DATA)
-AM_CPPFLAGS = \
- $(CAMEL_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(EDS_CFLAGS) \
+AM_CPPFLAGS = \
+ $(CAMEL_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ $(EDS_CFLAGS) \
$(NSS_CFLAGS)
-SUBDIRS = \
- tests\
- providers \
+SUBDIRS = \
+ tests \
+ providers \
tests
-AM_CFLAGS = \
- $(CFLAGS)\
- $(ADD_CFLAGS)\
+AM_CFLAGS = \
+ $(CFLAGS) \
+ $(ADD_CFLAGS) \
$(KOLAB_INCLUDE)
-noinst_HEADERS = \
- camel-kolab-stream.h \
- camel-kolab-imapx-provider.h \
- camel-kolab-imapx-store.h \
- camel-kolab-imapx-transport.h \
- camel-kolab-imapx-folder.h \
- camel-kolab-session.h \
- camel-kolab-imapx-metadata.h \
- camel-kolab-imapx-metadata-db.h
+noinst_HEADERS = \
+ camel-kolab-imapx-folder.h \
+ camel-kolab-imapx-metadata-db.h \
+ camel-kolab-imapx-metadata.h \
+ camel-kolab-imapx-provider.h \
+ camel-kolab-imapx-server.h \
+ camel-kolab-imapx-store.h \
+ camel-kolab-imapx-transport.h \
+ camel-kolab-session.h \
+ camel-kolab-stream.h
noinstdir = \
$(pkgincludedir)
diff --git a/src/camel/camel-kolab-imapx-server.c b/src/camel/camel-kolab-imapx-server.c
new file mode 100644
index 0000000..8f51f6f
--- /dev/null
+++ b/src/camel/camel-kolab-imapx-server.c
@@ -0,0 +1,137 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/***************************************************************************
+* camel-kolab-imapx-server.c
+*
+* 2011-12-02, 17:05:41
+* 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
+*/
+
+/*----------------------------------------------------------------------------*/
+
+#include "camel-kolab-imapx-server.h"
+
+/*----------------------------------------------------------------------------*/
+
+typedef struct _CamelKolabIMAPXServerPrivate CamelKolabIMAPXServerPrivate;
+struct _CamelKolabIMAPXServerPrivate {
+ CamelKolabImapxMetadata *metadata;
+};
+
+#define CAMEL_KOLAB_IMAPX_SERVER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CAMEL_TYPE_KOLAB_IMAPX_SERVER, CamelKolabIMAPXServerPrivate))
+
+G_DEFINE_TYPE (CamelKolabIMAPXServer, camel_kolab_imapx_server, CAMEL_TYPE_IMAPX_EXTD_SERVER)
+
+/*----------------------------------------------------------------------------*/
+/* object/class init */
+
+static void
+camel_kolab_imapx_server_init (CamelKolabIMAPXServer *object)
+{
+ CamelKolabIMAPXServer *self = NULL;
+ CamelKolabIMAPXServerPrivate *priv = NULL;
+
+ g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (object));
+
+ self = object;
+ priv = CAMEL_KOLAB_IMAPX_SERVER_PRIVATE (self);
+
+ priv->metadata = NULL;
+}
+
+static void
+camel_kolab_imapx_server_dispose (GObject *object)
+{
+ g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (object));
+
+ G_OBJECT_CLASS (camel_kolab_imapx_server_parent_class)->dispose (object);
+}
+
+static void
+camel_kolab_imapx_server_finalize (GObject *object)
+{
+ CamelKolabIMAPXServer *self = NULL;
+ CamelKolabIMAPXServerPrivate *priv = NULL;
+
+ g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (object));
+
+ self = object;
+ priv = CAMEL_KOLAB_IMAPX_SERVER_PRIVATE (self);
+
+ camel_kolab_imapx_metadata_free (priv->metadata);
+
+ G_OBJECT_CLASS (camel_kolab_imapx_server_parent_class)->finalize (object);
+}
+
+static void
+camel_kolab_imapx_server_class_init (CamelKolabIMAPXServerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (CamelKolabIMAPXServerPrivate));
+
+ object_class->dispose = camel_kolab_imapx_server_dispose;
+ object_class->finalize = camel_kolab_imapx_server_finalize;
+}
+
+/*----------------------------------------------------------------------------*/
+/* API functions */
+
+CamelKolabImapxMetadata*
+camel_kolab_imapx_server_get_metadata (CamelKolabIMAPXServer *server,
+ gboolean do_resect,
+ GError **err)
+{
+ CamelKolabIMAPXServer *self = NULL;
+ CamelKolabIMAPXServerPrivate *priv = NULL;
+
+ g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (server));
+ (void)do_resect; /* FIXME */
+ g_return_val_if_fail (err == NULL || *err == NULL, NULL);
+
+ self = server;
+ priv = CAMEL_KOLAB_IMAPX_SERVER_PRIVATE (self);
+
+ /* FIXME */
+ g_error ("%s: FIXME: implement me", __func__);
+
+ return NULL;
+}
+
+gboolean
+camel_kolab_imapx_server_set_metadata (CamelKolabIMAPXServer *server,
+ CamelKolabImapxMetadata *kmd,
+ GError **err)
+{
+ CamelKolabIMAPXServer *self = NULL;
+ CamelKolabIMAPXServerPrivate *priv = NULL;
+
+ g_assert (CAMEL_IS_KOLAB_IMAPX_SERVER (server));
+ g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+
+ self = server;
+ priv = CAMEL_KOLAB_IMAPX_SERVER_PRIVATE (self);
+
+ /* FIXME */
+ g_error ("%s: FIXME: implement me", __func__);
+
+ return FALSE;
+}
+
+/*----------------------------------------------------------------------------*/
diff --git a/src/camel/camel-kolab-imapx-server.h b/src/camel/camel-kolab-imapx-server.h
new file mode 100644
index 0000000..4fd4b4c
--- /dev/null
+++ b/src/camel/camel-kolab-imapx-server.h
@@ -0,0 +1,95 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/***************************************************************************
+* camel-kolab-imapx-server.h
+*
+* 2011-12-02, 17:05:40
+* 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_KOLAB_IMAPX_SERVER_H_
+#define _CAMEL_KOLAB_IMAPX_SERVER_H_
+
+/*----------------------------------------------------------------------------*/
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <camel/providers/imapx/camel-imapx-extd-server.h>
+
+#include "camel-kolab-imapx-metadata.h"
+
+/*----------------------------------------------------------------------------*/
+
+/*----------------------------------------------------------------------------*/
+/* Standard GObject macros */
+
+#define CAMEL_TYPE_KOLAB_IMAPX_SERVER \
+ (camel_kolab_imapx_server_get_type ())
+#define CAMEL_KOLAB_IMAPX_SERVER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_KOLAB_IMAPX_SERVER, CamelKolabIMAPXServer))
+#define CAMEL_KOLAB_IMAPX_SERVER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((klass), CAMEL_TYPE_KOLAB_IMAPX_SERVER, CamelKolabIMAPXServerClass))
+#define CAMEL_IS_KOLAB_IMAPX_SERVER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_KOLAB_IMAPX_SERVER))
+#define CAMEL_IS_KOLAB_IMAPX_SERVER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((klass), CAMEL_TYPE_KOLAB_IMAPX_SERVER))
+#define CAMEL_KOLAB_IMAPX_SERVER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_KOLAB_IMAPX_SERVER, CamelKolabIMAPXServerClass))
+
+G_BEGIN_DECLS
+
+typedef struct _CamelKolabIMAPXServer CamelKolabIMAPXServer;
+typedef struct _CamelKolabIMAPXServerClass CamelKolabIMAPXServerClass;
+
+struct _CamelKolabIMAPXServer {
+ CamelIMAPXExtdServer parent;
+};
+
+struct _CamelKolabIMAPXServerClass {
+ CamelIMAPXExtdServerClass parent_class;
+};
+
+GType
+camel_kolab_imapx_server_get_type (void);
+
+CamelKolabImapxMetadata*
+camel_kolab_imapx_server_get_metadata (CamelKolabIMAPXServer *server,
+ gboolean do_resect,
+ GError **err);
+
+gboolean
+camel_kolab_imapx_server_set_metadata (CamelKolabIMAPXServer *server,
+ CamelKolabImapxMetadata *kmd,
+ GError **err);
+
+G_END_DECLS
+
+/*----------------------------------------------------------------------------*/
+
+#endif /* CAMEL_IMAPX_SERVER_EXTN_H_ */
+
+/*----------------------------------------------------------------------------*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]