[evolution-data-server/imap-pop-mobile: 3/12] Add flags to the Provider and code for mobile mode in settings.



commit 995c445d127b97afd20e2967a011bfbe61bc4a8a
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Tue Jan 10 16:51:30 2012 +0530

    Add flags to the Provider and code for mobile mode in settings.

 camel/providers/imapx/camel-imapx-provider.c |    5 ++-
 camel/providers/imapx/camel-imapx-settings.c |   65 ++++++++++++++++++++++++++
 camel/providers/imapx/camel-imapx-settings.h |    5 ++
 3 files changed, 74 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-provider.c b/camel/providers/imapx/camel-imapx-provider.c
index 116ff13..6179e84 100644
--- a/camel/providers/imapx/camel-imapx-provider.c
+++ b/camel/providers/imapx/camel-imapx-provider.c
@@ -98,7 +98,10 @@ static CamelProvider imapx_provider = {
 	"mail",
 
 	CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE |
-	CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL,
+	CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_SUPPORTS_SSL|
+	CAMEL_PROVIDER_SUPPORTS_MOBILE_DEVICES | 
+	CAMEL_PROVIDER_SUPPORTS_BATCH_FETCH |
+	CAMEL_PROVIDER_SUPPORTS_PURGE_MESSAGE_CACHE,
 
 	CAMEL_URL_NEED_USER | CAMEL_URL_NEED_HOST | CAMEL_URL_ALLOW_AUTH,
 
diff --git a/camel/providers/imapx/camel-imapx-settings.c b/camel/providers/imapx/camel-imapx-settings.c
index 0ffdc46..2b4c333 100644
--- a/camel/providers/imapx/camel-imapx-settings.c
+++ b/camel/providers/imapx/camel-imapx-settings.c
@@ -38,6 +38,7 @@ struct _CamelIMAPXSettingsPrivate {
 	gboolean filter_junk;
 	gboolean filter_junk_inbox;
 	gboolean use_idle;
+	gboolean use_mobile_mode;
 	gboolean use_namespace;
 	gboolean use_qresync;
 	gboolean use_shell_command;
@@ -57,6 +58,7 @@ enum {
 	PROP_FILTER_JUNK,
 	PROP_FILTER_JUNK_INBOX,
 	PROP_HOST,
+	PROP_MOBILE_MODE,
 	PROP_NAMESPACE,
 	PROP_PORT,
 	PROP_SECURITY_METHOD,
@@ -137,6 +139,12 @@ imapx_settings_set_property (GObject *object,
 				g_value_get_string (value));
 			return;
 
+		case PROP_MOBILE_MODE:
+			camel_imapx_settings_set_mobile_mode (
+				CAMEL_IMAPX_SETTINGS (object),
+				g_value_get_boolean (value));
+			return;
+
 		case PROP_NAMESPACE:
 			camel_imapx_settings_set_namespace (
 				CAMEL_IMAPX_SETTINGS (object),
@@ -271,6 +279,13 @@ imapx_settings_get_property (GObject *object,
 				CAMEL_NETWORK_SETTINGS (object)));
 			return;
 
+		case PROP_MOBILE_MODE:
+			g_value_set_boolean (
+				value,
+				camel_imapx_settings_get_mobile_mode (
+				CAMEL_IMAPX_SETTINGS (object)));
+			return;
+
 		case PROP_NAMESPACE:
 			g_value_take_string (
 				value,
@@ -468,6 +483,18 @@ camel_imapx_settings_class_init (CamelIMAPXSettingsClass *class)
 			G_PARAM_CONSTRUCT |
 			G_PARAM_STATIC_STRINGS));
 
+	g_object_class_install_property (
+		object_class,
+		PROP_MOBILE_MODE,
+		g_param_spec_boolean (
+			"mobile-mode",
+			"Mobile Mode",
+			"Mobile mode which adjusts the IMAPX for Mobile clients",
+			FALSE,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT |
+			G_PARAM_STATIC_STRINGS));
+
 	/* Inherited from CamelNetworkSettings. */
 	g_object_class_override_property (
 		object_class,
@@ -877,6 +904,44 @@ camel_imapx_settings_set_filter_junk_inbox (CamelIMAPXSettings *settings,
 }
 
 /**
+ * camel_imapx_settings_get_mobile_mode:
+ * @settings: a #CamelIMAPXSettings
+ *
+ * Returns whether the backend is operating in mobile mode.
+ *
+ * Since: 3.2
+ **/
+gboolean
+camel_imapx_settings_get_mobile_mode (CamelIMAPXSettings *settings)
+{
+	g_return_val_if_fail (
+		CAMEL_IS_IMAPX_SETTINGS (settings),
+		CAMEL_SORT_ASCENDING);
+
+	return settings->priv->use_mobile_mode;
+}
+
+/**
+ * camel_imapx_settings_set_mobile_mode:
+ * @settings: a #CamelIMAPXSettings
+ * @mobile_mode: whether to operate in mobile mode.
+ *
+ * Sets the mode of operation as mobile or not for the backend.
+ *
+ * Since: 3.2
+ **/
+void
+camel_imapx_settings_set_mobile_mode (CamelIMAPXSettings *settings,
+                                      gboolean mobile_mode)
+{
+	g_return_if_fail (CAMEL_IS_IMAPX_SETTINGS (settings));
+
+	settings->priv->use_mobile_mode = mobile_mode;
+
+	g_object_notify (G_OBJECT (settings), "mobile-mode");
+}
+
+/**
  * camel_imapx_settings_get_namespace:
  * @settings: a #CamelIMAPXSettings
  *
diff --git a/camel/providers/imapx/camel-imapx-settings.h b/camel/providers/imapx/camel-imapx-settings.h
index 54f810c..bffa560 100644
--- a/camel/providers/imapx/camel-imapx-settings.h
+++ b/camel/providers/imapx/camel-imapx-settings.h
@@ -91,6 +91,11 @@ gboolean	camel_imapx_settings_get_filter_junk_inbox
 void		camel_imapx_settings_set_filter_junk_inbox
 						(CamelIMAPXSettings *settings,
 						 gboolean filter_junk_inbox);
+gboolean	camel_imapx_settings_get_mobile_mode
+						(CamelIMAPXSettings *settings);
+void		camel_imapx_settings_set_mobile_mode
+						(CamelIMAPXSettings *settings,
+						 gboolean mobile);
 const gchar *	camel_imapx_settings_get_namespace
 						(CamelIMAPXSettings *settings);
 gchar *		camel_imapx_settings_dup_namespace



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