[evolution-data-server/wip/camel-more-gobject: 50/62] Add Maildir and MBox CamelMessageInfoBase descendants
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/wip/camel-more-gobject: 50/62] Add Maildir and MBox CamelMessageInfoBase descendants
- Date: Mon, 19 Sep 2016 11:13:07 +0000 (UTC)
commit 06f10a9cace2481a843cb59f390f2239f4cee639
Author: Milan Crha <mcrha redhat com>
Date: Mon Sep 5 20:36:56 2016 +0200
Add Maildir and MBox CamelMessageInfoBase descendants
camel/providers/imapx/camel-imapx-message-info.c | 1 -
camel/providers/local/Makefile.am | 4 +
camel/providers/local/camel-maildir-message-info.c | 217 ++++++++++++++++++++
camel/providers/local/camel-maildir-message-info.h | 71 +++++++
camel/providers/local/camel-maildir-summary.c | 2 +
camel/providers/local/camel-mbox-message-info.c | 180 ++++++++++++++++
camel/providers/local/camel-mbox-message-info.h | 67 ++++++
camel/providers/local/camel-mbox-summary.c | 2 +
8 files changed, 543 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-message-info.c
b/camel/providers/imapx/camel-imapx-message-info.c
index 316d69a..c000f14 100644
--- a/camel/providers/imapx/camel-imapx-message-info.c
+++ b/camel/providers/imapx/camel-imapx-message-info.c
@@ -200,7 +200,6 @@ xcamel_imapx_message_info_class_init (xCamelIMAPXMessageInfoClass *class)
NULL,
CAMEL_TYPE_NAME_VALUE_ARRAY,
G_PARAM_READWRITE));
-
}
static void
diff --git a/camel/providers/local/Makefile.am b/camel/providers/local/Makefile.am
index c78b912..7df29f5 100644
--- a/camel/providers/local/Makefile.am
+++ b/camel/providers/local/Makefile.am
@@ -31,12 +31,14 @@ libcamellocal_la_SOURCES = \
camel-local-provider.c \
camel-mbox-folder.c \
camel-mbox-store.c \
+ camel-mbox-message-info.c \
camel-mbox-summary.c \
camel-mh-folder.c \
camel-mh-settings.c \
camel-mh-store.c \
camel-mh-summary.c \
camel-maildir-folder.c \
+ camel-maildir-message-info.c \
camel-maildir-store.c \
camel-maildir-summary.c \
$(SYSDEP_PROVIDER_SOURCES) \
@@ -51,9 +53,11 @@ noinst_HEADERS = \
camel-mh-store.h \
camel-mh-summary.h \
camel-mbox-folder.h \
+ camel-mbox-message-info.h \
camel-mbox-store.h \
camel-mbox-summary.h \
camel-maildir-folder.h \
+ camel-maildir-message-info.h \
camel-maildir-store.h \
camel-maildir-summary.h \
camel-spool-folder.h \
diff --git a/camel/providers/local/camel-maildir-message-info.c
b/camel/providers/local/camel-maildir-message-info.c
new file mode 100644
index 0000000..d833f41
--- /dev/null
+++ b/camel/providers/local/camel-maildir-message-info.c
@@ -0,0 +1,217 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2016 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library 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.
+ *
+ * This library 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 library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include "camel/camel.h"
+#include "camel-maildir-summary.h"
+
+#include "camel-maildir-message-info.h"
+
+struct _xCamelMaildirMessageInfoPrivate {
+ gchar *filename;
+};
+
+enum {
+ PROP_0,
+ PROP_FILENAME
+};
+
+G_DEFINE_TYPE (xCamelMaildirMessageInfo, xcamel_maildir_message_info, XCAMEL_TYPE_MESSAGE_INFO_BASE)
+
+static xCamelMessageInfo *
+maildir_message_info_clone (const xCamelMessageInfo *mi,
+ CamelFolderSummary *assign_summary)
+{
+ xCamelMessageInfo *result;
+
+ g_return_val_if_fail (XCAMEL_IS_MAILDIR_MESSAGE_INFO (mi), NULL);
+
+ result = XCAMEL_MESSAGE_INFO_CLASS (xcamel_maildir_message_info_parent_class)->clone (mi,
assign_summary);
+ if (!result)
+ return NULL;
+
+ if (XCAMEL_IS_MAILDIR_MESSAGE_INFO (result)) {
+ xCamelMaildirMessageInfo *mmi, *mmi_result;
+
+ mmi = XCAMEL_MAILDIR_MESSAGE_INFO (mi);
+ mmi_result = XCAMEL_MAILDIR_MESSAGE_INFO (result);
+
+ /* safe-guard that the mmi's filename doesn't change before it's copied to mmi_result */
+ xcamel_message_info_property_lock (mi);
+
+ xcamel_maildir_message_info_set_filename (mmi_result,
xcamel_maildir_message_info_get_filename (mmi));
+
+ xcamel_message_info_property_unlock (mi);
+ }
+
+ return result;
+}
+
+static void
+maildir_message_info_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ xCamelMaildirMessageInfo *mmi = XCAMEL_MAILDIR_MESSAGE_INFO (object);
+
+ switch (property_id) {
+ case PROP_FILENAME:
+ xcamel_maildir_message_info_set_filename (mmi, g_value_get_string (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+maildir_message_info_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ xCamelMaildirMessageInfo *mmi = XCAMEL_MAILDIR_MESSAGE_INFO (object);
+
+ switch (property_id) {
+ case PROP_FILENAME:
+ g_value_set_string (value, xcamel_maildir_message_info_get_filename (mmi));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+maildir_message_info_dispose (GObject *object)
+{
+ xCamelMaildirMessageInfo *mmi = XCAMEL_MAILDIR_MESSAGE_INFO (object);
+
+ g_free (mmi->priv->filename);
+ mmi->priv->filename = NULL;
+
+ /* Chain up to parent's method. */
+ G_OBJECT_CLASS (xcamel_maildir_message_info_parent_class)->dispose (object);
+}
+
+static void
+xcamel_maildir_message_info_class_init (xCamelMaildirMessageInfoClass *class)
+{
+ xCamelMessageInfoClass *mi_class;
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (xCamelMaildirMessageInfoPrivate));
+
+ mi_class = XCAMEL_MESSAGE_INFO_CLASS (class);
+ mi_class->clone = maildir_message_info_clone;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = maildir_message_info_set_property;
+ object_class->get_property = maildir_message_info_get_property;
+ object_class->dispose = maildir_message_info_dispose;
+
+ /**
+ * xCamelMaildirMessageInfo:filename
+ *
+ * File name of the message on the disk.
+ *
+ * Since: 3.24
+ **/
+ g_object_class_install_property (
+ object_class,
+ PROP_FILENAME,
+ g_param_spec_string (
+ "filename",
+ "Filename",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+}
+
+static void
+xcamel_maildir_message_info_init (xCamelMaildirMessageInfo *vmi)
+{
+ vmi->priv = G_TYPE_INSTANCE_GET_PRIVATE (vmi, XCAMEL_TYPE_MAILDIR_MESSAGE_INFO,
xCamelMaildirMessageInfoPrivate);
+}
+
+const gchar *
+xcamel_maildir_message_info_get_filename (const xCamelMaildirMessageInfo *mmi)
+{
+ xCamelMessageInfo *mi;
+ const gchar *result;
+
+ g_return_val_if_fail (XCAMEL_IS_MAILDIR_MESSAGE_INFO (mmi), NULL);
+
+ mi = XCAMEL_MESSAGE_INFO (mmi);
+
+ xcamel_message_info_property_lock (mi);
+ result = mmi->priv->filename;
+ xcamel_message_info_property_unlock (mi);
+
+ return result;
+}
+
+gchar *
+xcamel_maildir_message_info_dup_filename (const xCamelMaildirMessageInfo *mmi)
+{
+ xCamelMessageInfo *mi;
+ gchar *result;
+
+ g_return_val_if_fail (XCAMEL_IS_MAILDIR_MESSAGE_INFO (mmi), NULL);
+
+ mi = XCAMEL_MESSAGE_INFO (mmi);
+
+ xcamel_message_info_property_lock (mi);
+ result = g_strdup (mmi->priv->filename);
+ xcamel_message_info_property_unlock (mi);
+
+ return result;
+}
+
+gboolean
+xcamel_maildir_message_info_set_filename (xCamelMaildirMessageInfo *mmi,
+ const gchar *filename)
+{
+ xCamelMessageInfo *mi;
+ gboolean changed;
+
+ g_return_val_if_fail (XCAMEL_IS_MAILDIR_MESSAGE_INFO (mmi), FALSE);
+
+ mi = XCAMEL_MESSAGE_INFO (mmi);
+
+ xcamel_message_info_property_lock (mi);
+
+ changed = g_strcmp0 (mmi->priv->filename, filename) != 0;
+
+ if (changed) {
+ g_free (mmi->priv->filename);
+ mmi->priv->filename = g_strdup (filename);
+ }
+
+ xcamel_message_info_property_unlock (mi);
+
+ if (changed) {
+ g_object_notify (G_OBJECT (mmi), "filename");
+ xcamel_message_info_set_dirty (mi, TRUE);
+ }
+
+ return changed;
+}
diff --git a/camel/providers/local/camel-maildir-message-info.h
b/camel/providers/local/camel-maildir-message-info.h
new file mode 100644
index 0000000..efba5b0
--- /dev/null
+++ b/camel/providers/local/camel-maildir-message-info.h
@@ -0,0 +1,71 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2016 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library 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.
+ *
+ * This library 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 library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef XCAMEL_MAILDIR_MESSAGE_INFO_H
+#define XCAMEL_MAILDIR_MESSAGE_INFO_H
+
+#include <glib-object.h>
+
+#include <camel/camel.h>
+
+/* Standard GObject macros */
+#define XCAMEL_TYPE_MAILDIR_MESSAGE_INFO \
+ (xcamel_maildir_message_info_get_type ())
+#define XCAMEL_MAILDIR_MESSAGE_INFO(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), XCAMEL_TYPE_MAILDIR_MESSAGE_INFO, xCamelMaildirMessageInfo))
+#define XCAMEL_MAILDIR_MESSAGE_INFO_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), XCAMEL_TYPE_MAILDIR_MESSAGE_INFO, xCamelMaildirMessageInfoClass))
+#define XCAMEL_IS_MAILDIR_MESSAGE_INFO(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), XCAMEL_TYPE_MAILDIR_MESSAGE_INFO))
+#define XCAMEL_IS_MAILDIR_MESSAGE_INFO_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), XCAMEL_TYPE_MAILDIR_MESSAGE_INFO))
+#define XCAMEL_MAILDIR_MESSAGE_INFO_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), XCAMEL_TYPE_MAILDIR_MESSAGE_INFO, xCamelMaildirMessageInfoClass))
+
+G_BEGIN_DECLS
+
+typedef struct _xCamelMaildirMessageInfo xCamelMaildirMessageInfo;
+typedef struct _xCamelMaildirMessageInfoClass xCamelMaildirMessageInfoClass;
+typedef struct _xCamelMaildirMessageInfoPrivate xCamelMaildirMessageInfoPrivate;
+
+struct _xCamelMaildirMessageInfo {
+ xCamelMessageInfoBase parent;
+ xCamelMaildirMessageInfoPrivate *priv;
+};
+
+struct _xCamelMaildirMessageInfoClass {
+ xCamelMessageInfoBaseClass parent_class;
+};
+
+GType xcamel_maildir_message_info_get_type (void);
+
+const gchar * xcamel_maildir_message_info_get_filename
+ (const xCamelMaildirMessageInfo *mmi);
+gchar * xcamel_maildir_message_info_dup_filename
+ (const xCamelMaildirMessageInfo *mmi);
+gboolean xcamel_maildir_message_info_set_filename
+ (xCamelMaildirMessageInfo *mmi,
+ const gchar *filename);
+
+G_END_DECLS
+
+#endif /* XCAMEL_MAILDIR_MESSAGE_INFO_H */
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index ca5fb94..25e0729 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -38,6 +38,7 @@
#include <glib/gstdio.h>
#include <glib/gi18n-lib.h>
+#include "camel-maildir-message-info.h"
#include "camel-maildir-summary.h"
#define CAMEL_MAILDIR_SUMMARY_GET_PRIVATE(obj) \
@@ -131,6 +132,7 @@ camel_maildir_summary_class_init (CamelMaildirSummaryClass *class)
object_class->finalize = maildir_summary_finalize;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
+ folder_summary_class->message_info_type = XCAMEL_TYPE_MAILDIR_MESSAGE_INFO;
folder_summary_class->message_info_size = sizeof (CamelMaildirMessageInfo);
folder_summary_class->content_info_size = sizeof (CamelMaildirMessageContentInfo);
folder_summary_class->message_info_new_from_header = message_info_new_from_header;
diff --git a/camel/providers/local/camel-mbox-message-info.c b/camel/providers/local/camel-mbox-message-info.c
new file mode 100644
index 0000000..be330b9
--- /dev/null
+++ b/camel/providers/local/camel-mbox-message-info.c
@@ -0,0 +1,180 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2016 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library 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.
+ *
+ * This library 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 library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include "camel/camel.h"
+#include "camel-mbox-summary.h"
+
+#include "camel-mbox-message-info.h"
+
+struct _xCamelMboxMessageInfoPrivate {
+ goffset offset;
+};
+
+enum {
+ PROP_0,
+ PROP_OFFSET
+};
+
+G_DEFINE_TYPE (xCamelMboxMessageInfo, xcamel_mbox_message_info, XCAMEL_TYPE_MESSAGE_INFO_BASE)
+
+static xCamelMessageInfo *
+mbox_message_info_clone (const xCamelMessageInfo *mi,
+ CamelFolderSummary *assign_summary)
+{
+ xCamelMessageInfo *result;
+
+ g_return_val_if_fail (XCAMEL_IS_MBOX_MESSAGE_INFO (mi), NULL);
+
+ result = XCAMEL_MESSAGE_INFO_CLASS (xcamel_mbox_message_info_parent_class)->clone (mi,
assign_summary);
+ if (!result)
+ return NULL;
+
+ if (XCAMEL_IS_MBOX_MESSAGE_INFO (result)) {
+ xCamelMboxMessageInfo *mmi, *mmi_result;
+
+ mmi = XCAMEL_MBOX_MESSAGE_INFO (mi);
+ mmi_result = XCAMEL_MBOX_MESSAGE_INFO (result);
+
+ xcamel_mbox_message_info_set_offset (mmi_result, xcamel_mbox_message_info_get_offset (mmi));
+ }
+
+ return result;
+}
+
+static void
+mbox_message_info_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ xCamelMboxMessageInfo *mmi = XCAMEL_MBOX_MESSAGE_INFO (object);
+
+ switch (property_id) {
+ case PROP_OFFSET:
+ xcamel_mbox_message_info_set_offset (mmi, g_value_get_int64 (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+mbox_message_info_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ xCamelMboxMessageInfo *mmi = XCAMEL_MBOX_MESSAGE_INFO (object);
+
+ switch (property_id) {
+ case PROP_OFFSET:
+ g_value_set_int64 (value, xcamel_mbox_message_info_get_offset (mmi));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+xcamel_mbox_message_info_class_init (xCamelMboxMessageInfoClass *class)
+{
+ xCamelMessageInfoClass *mi_class;
+ GObjectClass *object_class;
+
+ g_type_class_add_private (class, sizeof (xCamelMboxMessageInfoPrivate));
+
+ mi_class = XCAMEL_MESSAGE_INFO_CLASS (class);
+ mi_class->clone = mbox_message_info_clone;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = mbox_message_info_set_property;
+ object_class->get_property = mbox_message_info_get_property;
+
+ /**
+ * xCamelMboxMessageInfo:offset
+ *
+ * Offset in the file to the related message.
+ *
+ * Since: 3.24
+ **/
+ g_object_class_install_property (
+ object_class,
+ PROP_OFFSET,
+ g_param_spec_int64 (
+ "offset",
+ "Offset",
+ NULL,
+ 0, G_MAXINT64, 0,
+ G_PARAM_READWRITE));
+}
+
+static void
+xcamel_mbox_message_info_init (xCamelMboxMessageInfo *vmi)
+{
+ vmi->priv = G_TYPE_INSTANCE_GET_PRIVATE (vmi, XCAMEL_TYPE_MBOX_MESSAGE_INFO,
xCamelMboxMessageInfoPrivate);
+}
+
+goffset
+xcamel_mbox_message_info_get_offset (const xCamelMboxMessageInfo *mmi)
+{
+ xCamelMessageInfo *mi;
+ goffset result;
+
+ g_return_val_if_fail (XCAMEL_IS_MBOX_MESSAGE_INFO (mmi), 0);
+
+ mi = XCAMEL_MESSAGE_INFO (mmi);
+
+ xcamel_message_info_property_lock (mi);
+ result = mmi->priv->offset;
+ xcamel_message_info_property_unlock (mi);
+
+ return result;
+}
+
+gboolean
+xcamel_mbox_message_info_set_offset (xCamelMboxMessageInfo *mmi,
+ goffset offset)
+{
+ xCamelMessageInfo *mi;
+ gboolean changed;
+
+ g_return_val_if_fail (XCAMEL_IS_MBOX_MESSAGE_INFO (mmi), FALSE);
+
+ mi = XCAMEL_MESSAGE_INFO (mmi);
+
+ xcamel_message_info_property_lock (mi);
+
+ changed = mmi->priv->offset != offset;
+
+ if (changed)
+ mmi->priv->offset = offset;
+
+ xcamel_message_info_property_unlock (mi);
+
+ if (changed) {
+ g_object_notify (G_OBJECT (mmi), "offset");
+ xcamel_message_info_set_dirty (mi, TRUE);
+ }
+
+ return changed;
+}
diff --git a/camel/providers/local/camel-mbox-message-info.h b/camel/providers/local/camel-mbox-message-info.h
new file mode 100644
index 0000000..1f86958
--- /dev/null
+++ b/camel/providers/local/camel-mbox-message-info.h
@@ -0,0 +1,67 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2016 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library 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.
+ *
+ * This library 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 library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef XCAMEL_MBOX_MESSAGE_INFO_H
+#define XCAMEL_MBOX_MESSAGE_INFO_H
+
+#include <glib-object.h>
+
+#include <camel/camel.h>
+
+/* Standard GObject macros */
+#define XCAMEL_TYPE_MBOX_MESSAGE_INFO \
+ (xcamel_mbox_message_info_get_type ())
+#define XCAMEL_MBOX_MESSAGE_INFO(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), XCAMEL_TYPE_MBOX_MESSAGE_INFO, xCamelMboxMessageInfo))
+#define XCAMEL_MBOX_MESSAGE_INFO_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_CAST \
+ ((cls), XCAMEL_TYPE_MBOX_MESSAGE_INFO, xCamelMboxMessageInfoClass))
+#define XCAMEL_IS_MBOX_MESSAGE_INFO(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), XCAMEL_TYPE_MBOX_MESSAGE_INFO))
+#define XCAMEL_IS_MBOX_MESSAGE_INFO_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), XCAMEL_TYPE_MBOX_MESSAGE_INFO))
+#define XCAMEL_MBOX_MESSAGE_INFO_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), XCAMEL_TYPE_MBOX_MESSAGE_INFO, xCamelMboxMessageInfoClass))
+
+G_BEGIN_DECLS
+
+typedef struct _xCamelMboxMessageInfo xCamelMboxMessageInfo;
+typedef struct _xCamelMboxMessageInfoClass xCamelMboxMessageInfoClass;
+typedef struct _xCamelMboxMessageInfoPrivate xCamelMboxMessageInfoPrivate;
+
+struct _xCamelMboxMessageInfo {
+ xCamelMessageInfoBase parent;
+ xCamelMboxMessageInfoPrivate *priv;
+};
+
+struct _xCamelMboxMessageInfoClass {
+ xCamelMessageInfoBaseClass parent_class;
+};
+
+GType xcamel_mbox_message_info_get_type (void);
+
+goffset xcamel_mbox_message_info_get_offset (const xCamelMboxMessageInfo *mmi);
+gboolean xcamel_mbox_message_info_set_offset (xCamelMboxMessageInfo *mmi,
+ goffset offset);
+
+G_END_DECLS
+
+#endif /* XCAMEL_MBOX_MESSAGE_INFO_H */
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index b169a74..5bdafd9 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -33,6 +33,7 @@
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
+#include "camel-mbox-message-info.h"
#include "camel-mbox-summary.h"
#include "camel-local-private.h"
@@ -175,6 +176,7 @@ camel_mbox_summary_class_init (CamelMboxSummaryClass *class)
CamelLocalSummaryClass *local_summary_class;
folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (class);
+ folder_summary_class->message_info_type = XCAMEL_TYPE_MBOX_MESSAGE_INFO;
folder_summary_class->message_info_size = sizeof (CamelMboxMessageInfo);
folder_summary_class->content_info_size = sizeof (CamelMboxMessageContentInfo);
folder_summary_class->summary_header_from_db = summary_header_from_db;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]