[evolution-kolab/ek-wip-porting-imapx] CamelKolabIMAPXFolder: created initial GObject class
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting-imapx] CamelKolabIMAPXFolder: created initial GObject class
- Date: Fri, 2 Dec 2011 18:36:08 +0000 (UTC)
commit 2a1010acb9f7b69189c36715361b669c53ade665
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Fri Dec 2 16:54:13 2011 +0100
CamelKolabIMAPXFolder: created initial GObject class
* made CamelKolabIMAPXFolder a descendant of
CamelIMAPXExtdFolder
* class functions now require a CamelKolabIMAPXFolder
instance instead of the CamelFolder instance in
gnome-2-30
src/camel/camel-kolab-imapx-folder.c | 55 +++++++++++++++++++++++++++----
src/camel/camel-kolab-imapx-folder.h | 60 ++++++++++++++++++++++++++++++---
2 files changed, 102 insertions(+), 13 deletions(-)
---
diff --git a/src/camel/camel-kolab-imapx-folder.c b/src/camel/camel-kolab-imapx-folder.c
index 8895f49..0f9055f 100644
--- a/src/camel/camel-kolab-imapx-folder.c
+++ b/src/camel/camel-kolab-imapx-folder.c
@@ -25,10 +25,10 @@
/*----------------------------------------------------------------------------*/
-#include "providers/imapx/camel-imapx-folder-extn.h"
#include "camel-kolab-imapx-folder.h"
/*----------------------------------------------------------------------------*/
+/* Folder metadata */
CamelKolabImapxFolderMetadata*
camel_kolab_imapx_folder_metadata_new (void)
@@ -57,24 +57,65 @@ camel_kolab_imapx_folder_metadata_gdestroy (gpointer data)
/*----------------------------------------------------------------------------*/
+G_DEFINE_TYPE (CamelKolabIMAPXFolder, camel_kolab_imapx_folder, CAMEL_TYPE_IMAPX_EXTD_FOLDER)
+
+/*----------------------------------------------------------------------------*/
+/* object/class init */
+
+static void
+camel_kolab_imapx_folder_init (CamelKolabIMAPXFolder *object)
+{
+ g_assert (CAMEL_IS_KOLAB_IMAPX_FOLDER (object));
+}
+
+static void
+camel_kolab_imapx_folder_dispose (GObject *object)
+{
+ g_assert (CAMEL_IS_KOLAB_IMAPX_FOLDER (object));
+
+ G_OBJECT_CLASS (camel_kolab_imapx_folder_parent_class)->dispose (object);
+}
+
+static void
+camel_kolab_imapx_folder_finalize (GObject *object)
+{
+ g_assert (CAMEL_IS_KOLAB_IMAPX_FOLDER (object));
+
+ G_OBJECT_CLASS (camel_kolab_imapx_folder_parent_class)->finalize (object);
+}
+
+static void
+camel_kolab_imapx_folder_class_init (CamelKolabIMAPXFolderClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ /* g_type_class_add_private (klass, sizeof (CamelKolabIMAPXFolderPrivate)); */
+
+ object_class->dispose = camel_kolab_imapx_folder_dispose;
+ object_class->finalize = camel_kolab_imapx_folder_finalize;
+}
+
+/*----------------------------------------------------------------------------*/
+/* API functions */
+
guint64
-camel_kolab_imapx_folder_get_uidvalidity (CamelFolder *folder,
+camel_kolab_imapx_folder_get_uidvalidity (CamelKolabIMAPXFolder *folder,
GError **err)
{
- guint64 uidvalidity;
+ guint64 uval = 0;
GError *tmp_err = NULL;
- g_assert (CAMEL_IS_FOLDER (folder));
+ g_assert (CAMEL_IS_KOLAB_IMAPX_FOLDER (folder));
g_return_val_if_fail (err == NULL || *err == NULL, 0);
- uidvalidity = camel_imapx_folder_extn_get_uidvalidity (folder,
- &tmp_err);
+ uval = camel_imapx_extd_folder_get_uidvalidity (CAMEL_IMAPX_EXTD_FOLDER (folder),
+ &tmp_err);
if (tmp_err != NULL) {
g_propagate_error (err, tmp_err);
return 0;
}
- return uidvalidity;
+ return uval;
}
/*----------------------------------------------------------------------------*/
diff --git a/src/camel/camel-kolab-imapx-folder.h b/src/camel/camel-kolab-imapx-folder.h
index 6858b5d..2d2205c 100644
--- a/src/camel/camel-kolab-imapx-folder.h
+++ b/src/camel/camel-kolab-imapx-folder.h
@@ -33,22 +33,70 @@
#include <glib.h>
#include <camel/camel.h>
+#include <camel/providers/imapx/camel-imapx-extd-folder.h>
+
#include <libekolabutil/kolab-util-folder.h>
/*----------------------------------------------------------------------------*/
+/* Folder metadata */
-typedef struct _CamelKolabImapxFolderMetadata {
+typedef struct _CamelKolabImapxFolderMetadata CamelKolabImapxFolderMetadata;
+struct _CamelKolabImapxFolderMetadata {
/* folder name kept as key in CamelKolabImapxMetadata kolab_metadata */
KolabFolderTypeID folder_type;
-} CamelKolabImapxFolderMetadata;
+};
+
+CamelKolabImapxFolderMetadata*
+camel_kolab_imapx_folder_metadata_new (void);
+
+gboolean
+camel_kolab_imapx_folder_metadata_free (CamelKolabImapxFolderMetadata *kfmd);
+
+void
+camel_kolab_imapx_folder_metadata_gdestroy (gpointer data);
/*----------------------------------------------------------------------------*/
+/* Standard GObject macros */
+
+#define CAMEL_TYPE_KOLAB_IMAPX_FOLDER \
+ (camel_kolab_imapx_folder_get_type ())
+#define CAMEL_KOLAB_IMAPX_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), CAMEL_TYPE_KOLAB_IMAPX_FOLDER, CamelKolabIMAPXFolder))
+#define CAMEL_KOLAB_IMAPX_FOLDER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((klass), CAMEL_TYPE_KOLAB_IMAPX_FOLDER, CamelKolabIMAPXFolderClass))
+#define CAMEL_IS_KOLAB_IMAPX_FOLDER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), CAMEL_TYPE_KOLAB_IMAPX_FOLDER))
+#define CAMEL_IS_KOLAB_IMAPX_FOLDER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((klass), CAMEL_TYPE_KOLAB_IMAPX_FOLDER))
+#define CAMEL_KOLAB_IMAPX_FOLDER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), CAMEL_TYPE_KOLAB_IMAPX_FOLDER, CamelKolabIMAPXFolderClass))
+
+G_BEGIN_DECLS
+
+typedef struct _CamelKolabIMAPXFolder CamelKolabIMAPXFolder;
+typedef struct _CamelKolabIMAPXFolderClass CamelKolabIMAPXFolderClass;
+
+struct _CamelKolabIMAPXFolder {
+ CamelIMAPXExtdFolder parent;
+};
+
+struct _CamelKolabIMAPXFolderClass {
+ CamelIMAPXExtdFolderClass parent_class;
+};
+
+GType
+camel_kolab_imapx_folder_get_type (void);
-CamelKolabImapxFolderMetadata *camel_kolab_imapx_folder_metadata_new (void);
-gboolean camel_kolab_imapx_folder_metadata_free (CamelKolabImapxFolderMetadata *kfmd);
-void camel_kolab_imapx_folder_metadata_gdestroy (gpointer data);
+guint64
+camel_kolab_imapx_folder_get_uidvalidity (CamelKolabIMAPXFolder *folder,
+ GError **err);
-guint64 camel_kolab_imapx_folder_get_uidvalidity (CamelFolder *folder, GError **err);
+G_END_DECLS
/*----------------------------------------------------------------------------*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]