[evolution-kolab/ek-wip-porting] ECalBackendKolabFactory: rewrite to 3.x E-D-S API (started)



commit 9200d4b3f4ff5727910ea0aba89eea1a6755fb25
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Mon Dec 12 11:47:54 2011 +0100

    ECalBackendKolabFactory: rewrite to 3.x E-D-S API (started)
    
    * added implementation for ECalBackendFactory
      virtual functions
    * removed obsolete header file
    * commented out old code, need to move KolabMailAccess
      table handling into ECalBackendKolab

 src/calendar/e-cal-backend-kolab-factory.c |  123 ++++++++++++++++++++++++++-
 src/calendar/e-cal-backend-kolab-factory.h |   59 -------------
 2 files changed, 118 insertions(+), 64 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-kolab-factory.c b/src/calendar/e-cal-backend-kolab-factory.c
index a56ae6c..f5d63b4 100644
--- a/src/calendar/e-cal-backend-kolab-factory.c
+++ b/src/calendar/e-cal-backend-kolab-factory.c
@@ -13,12 +13,12 @@
  * 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 this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
@@ -26,14 +26,126 @@
 
 /*----------------------------------------------------------------------------*/
 
-#include "e-cal-backend-kolab-factory.h"
+#include <glib.h>
+#include <glib-object.h>
+#include <libedata-cal/e-cal-backend-factory.h>
+
 #include "e-cal-backend-kolab.h"
 
-#include <libekolabutil/kolab-util-camel.h>
+/*----------------------------------------------------------------------------*/
+
+#define FACTORY_NAME "kolab2"
+
+typedef ECalBackendFactory ECalBackendKolabEventsFactory;
+typedef ECalBackendFactoryClass ECalBackendKolabEventsFactoryClass;
+
+typedef ECalBackendFactory ECalBackendKolabJournalFactory;
+typedef ECalBackendFactoryClass ECalBackendKolabJournalFactoryClass;
+
+typedef ECalBackendFactory ECalBackendKolabTodosFactory;
+typedef ECalBackendFactoryClass ECalBackendKolabTodosFactoryClass;
+
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
+
+/* Forward Declarations */
+GType e_cal_backend_kolab_events_factory_get_type (void);
+GType e_cal_backend_kolab_journal_factory_get_type (void);
+GType e_cal_backend_kolab_todos_factory_get_type (void);
+
+G_DEFINE_DYNAMIC_TYPE (
+                       ECalBackendKolabEventsFactory,
+                       e_cal_backend_kolab_events_factory,
+                       E_TYPE_CAL_BACKEND_FACTORY)
+
+G_DEFINE_DYNAMIC_TYPE (
+                       ECalBackendKolabJournalFactory,
+                       e_cal_backend_kolab_journal_factory,
+                       E_TYPE_CAL_BACKEND_FACTORY)
+
+G_DEFINE_DYNAMIC_TYPE (
+                       ECalBackendKolabTodosFactory,
+                       e_cal_backend_kolab_todos_factory,
+                       E_TYPE_CAL_BACKEND_FACTORY)
+
+static void
+e_cal_backend_kolab_events_factory_class_init (ECalBackendFactoryClass *klass)
+{
+	klass->factory_name = FACTORY_NAME;
+	klass->component_kind = ICAL_VEVENT_COMPONENT;
+	klass->backend_type = E_TYPE_CAL_BACKEND_KOLAB;
+}
+
+static void
+e_cal_backend_kolab_events_factory_class_finalize (ECalBackendFactoryClass *klass)
+{
+	(void)klass;
+}
+
+static void
+e_cal_backend_kolab_events_factory_init (ECalBackendFactory *factory)
+{
+	(void)factory;
+}
+
+static void
+e_cal_backend_kolab_journal_factory_class_init (ECalBackendFactoryClass *klass)
+{
+	klass->factory_name = FACTORY_NAME;
+	klass->component_kind = ICAL_VJOURNAL_COMPONENT;
+	klass->backend_type = E_TYPE_CAL_BACKEND_KOLAB;
+}
+
+static void
+e_cal_backend_kolab_journal_factory_class_finalize (ECalBackendFactoryClass *klass)
+{
+	(void)klass;
+}
+
+static void
+e_cal_backend_kolab_journal_factory_init (ECalBackendFactory *factory)
+{
+	(void)factory;
+}
+
+static void
+e_cal_backend_kolab_todos_factory_class_init (ECalBackendFactoryClass *klass)
+{
+	klass->factory_name = FACTORY_NAME;
+	klass->component_kind = ICAL_VTODO_COMPONENT;
+	klass->backend_type = E_TYPE_CAL_BACKEND_KOLAB;
+}
+
+static void
+e_cal_backend_kolab_todos_factory_class_finalize (ECalBackendFactoryClass *klass)
+{
+	(void)klass;
+}
+
+static void
+e_cal_backend_kolab_todos_factory_init (ECalBackendFactory *factory)
+{
+	(void)factory;
+}
+
+G_MODULE_EXPORT void
+e_module_load (GTypeModule *type_module)
+{
+	e_cal_backend_kolab_events_factory_register_type (type_module);
+	e_cal_backend_kolab_journal_factory_register_type (type_module);
+	e_cal_backend_kolab_todos_factory_register_type (type_module);
+}
+
+G_MODULE_EXPORT void
+e_module_unload (GTypeModule *type_module)
+{
+	(void)type_module;
+}
 
 /*----------------------------------------------------------------------------*/
 
-static GHashTable *koma_objects = NULL;
+#if 0 /* FIXME old */
 
 static void
 e_cal_backend_kolab_factory_instance_init (ECalBackendKolabFactory *factory)
@@ -243,5 +355,6 @@ eds_module_list_types (const GType **types, gint *num_types)
 	*types = kolab_cal_types;
 	*num_types = 3;
 }
+#endif
 
 /*----------------------------------------------------------------------------*/



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