[evolution-data-server/meego-eds: 21/47] Add API & Signal for Send Receive init & complete signal.



commit dd22d736786b3138bf3c074d1da030ab9864f4b4
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Mon May 9 12:36:02 2011 +0530

    Add API & Signal for Send Receive init & complete signal.

 mail/daemon/e-mail-data-session.xml   |    5 +
 mail/libegdbus/e-gdbus-emailsession.c |  132 +++++++++++++++++++++++++++++++++
 mail/libegdbus/e-gdbus-emailsession.h |   30 ++++++++
 3 files changed, 167 insertions(+), 0 deletions(-)
---
diff --git a/mail/daemon/e-mail-data-session.xml b/mail/daemon/e-mail-data-session.xml
index d963bf6..42dc199 100644
--- a/mail/daemon/e-mail-data-session.xml
+++ b/mail/daemon/e-mail-data-session.xml
@@ -40,6 +40,11 @@
       <arg name="folder" type="o" direction="out"/>
     </method>
 
+    <method name="sendReceive">
+    </method>
+    <signal name="sendReceiveComplete">
+    </signal>
+
     <signal name="GetPassword">
       <arg name="title" type="s"/>
       <arg name="prompt" type="s"/>
diff --git a/mail/libegdbus/e-gdbus-emailsession.c b/mail/libegdbus/e-gdbus-emailsession.c
index 57b4c47..d0552dc 100644
--- a/mail/libegdbus/e-gdbus-emailsession.c
+++ b/mail/libegdbus/e-gdbus-emailsession.c
@@ -550,6 +550,18 @@ static const _ExtendedGDBusMethodInfo _egdbus_session_cs_method_info_get_folder_
   "handle-get-folder-from-uri"
 };
 
+static const _ExtendedGDBusMethodInfo _egdbus_session_cs_method_info_send_receive =
+{
+  {
+    -1,
+    "sendReceive",
+    NULL,
+    NULL,
+    NULL
+  },
+  "handle-send-receive"
+};
+
 static const _ExtendedGDBusMethodInfo * const _egdbus_session_cs_method_info_pointers[] =
 {
   &_egdbus_session_cs_method_info_get_store,
@@ -557,9 +569,21 @@ static const _ExtendedGDBusMethodInfo * const _egdbus_session_cs_method_info_poi
   &_egdbus_session_cs_method_info_add_password,
   &_egdbus_session_cs_method_info_get_local_folder,
   &_egdbus_session_cs_method_info_get_folder_from_uri,
+  &_egdbus_session_cs_method_info_send_receive,
   NULL
 };
 
+static const _ExtendedGDBusSignalInfo _egdbus_session_cs_signal_info_send_receive_complete =
+{
+  {
+    -1,
+    "sendReceiveComplete",
+    NULL,
+    NULL
+  },
+  "send-receive-complete"
+};
+
 static const _ExtendedGDBusArgInfo _egdbus_session_cs_signal_info_get_password_ARG_title =
 {
   {
@@ -614,6 +638,7 @@ static const _ExtendedGDBusSignalInfo _egdbus_session_cs_signal_info_get_passwor
 
 static const _ExtendedGDBusSignalInfo * const _egdbus_session_cs_signal_info_pointers[] =
 {
+  &_egdbus_session_cs_signal_info_send_receive_complete,
   &_egdbus_session_cs_signal_info_get_password,
   NULL
 };
@@ -710,7 +735,28 @@ egdbus_session_cs_default_init (EGdbusSessionCSIface *iface)
     2,
     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
 
+  g_signal_new ("handle-send-receive",
+    G_TYPE_FROM_INTERFACE (iface),
+    G_SIGNAL_RUN_LAST,
+    G_STRUCT_OFFSET (EGdbusSessionCSIface, handle_send_receive),
+    g_signal_accumulator_true_handled,
+    NULL,
+    _cclosure_marshal_generic,
+    G_TYPE_BOOLEAN,
+    1,
+    G_TYPE_DBUS_METHOD_INVOCATION);
+
   /* GObject signals for received D-Bus signals: */
+  g_signal_new ("send-receive-complete",
+    G_TYPE_FROM_INTERFACE (iface),
+    G_SIGNAL_RUN_LAST,
+    G_STRUCT_OFFSET (EGdbusSessionCSIface, send_receive_complete),
+    NULL,
+    NULL,
+    _cclosure_marshal_generic,
+    G_TYPE_NONE,
+    0);
+
   g_signal_new ("get-password",
     G_TYPE_FROM_INTERFACE (iface),
     G_SIGNAL_RUN_LAST,
@@ -729,6 +775,13 @@ G_DEFINE_INTERFACE (EGdbusSessionCS, egdbus_session_cs, G_TYPE_OBJECT);
 #undef egdbus_session_cs_get_type
 
 void
+egdbus_session_cs_emit_send_receive_complete (
+    EGdbusSessionCS *object)
+{
+  g_signal_emit_by_name (object, "send-receive-complete");
+}
+
+void
 egdbus_session_cs_emit_get_password (
     EGdbusSessionCS *object,
     const gchar *title,
@@ -1064,6 +1117,63 @@ _out:
 }
 
 void
+egdbus_session_cs_call_send_receive (
+    EGdbusSessionCS *proxy,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data)
+{
+  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
+    "sendReceive",
+    g_variant_new ("()"),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    callback,
+    user_data);
+}
+
+gboolean
+egdbus_session_cs_call_send_receive_finish (
+    EGdbusSessionCS *proxy,
+    GAsyncResult *res,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+gboolean
+egdbus_session_cs_call_send_receive_sync (
+    EGdbusSessionCS *proxy,
+    GCancellable *cancellable,
+    GError **error)
+{
+  GVariant *_ret;
+  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
+    "sendReceive",
+    g_variant_new ("()"),
+    G_DBUS_CALL_FLAGS_NONE,
+    -1,
+    cancellable,
+    error);
+  if (_ret == NULL)
+    goto _out;
+  g_variant_get (_ret,
+                 "()");
+  g_variant_unref (_ret);
+_out:
+  return _ret != NULL;
+}
+
+void
 egdbus_session_cs_complete_get_store (
     EGdbusSessionCS *object,
     GDBusMethodInvocation *invocation,
@@ -1116,6 +1226,15 @@ egdbus_session_cs_complete_get_folder_from_uri (
                    folder));
 }
 
+void
+egdbus_session_cs_complete_send_receive (
+    EGdbusSessionCS *object,
+    GDBusMethodInvocation *invocation)
+{
+  g_dbus_method_invocation_return_value (invocation,
+    g_variant_new ("()"));
+}
+
 /* ------------------------------------------------------------------------ */
 
 static void
@@ -1563,6 +1682,18 @@ egdbus_session_cs_stub_dbus_interface_set_flags (GDBusInterface *interface,  GDB
 }
 
 static void
+_egdbus_session_cs_on_signal_send_receive_complete (
+    EGdbusSessionCS *object)
+{
+  EGdbusSessionCSStub *stub = EGDBUS_SESSION_CS_STUB (object);
+  if (stub->priv->connection == NULL)
+    return;
+  g_dbus_connection_emit_signal (stub->priv->connection,
+    NULL, stub->priv->object_path, "org.gnome.evolution.dataserver.mail.Session", "sendReceiveComplete",
+    g_variant_new ("()"), NULL);
+}
+
+static void
 _egdbus_session_cs_on_signal_get_password (
     EGdbusSessionCS *object,
     const gchar *title,
@@ -1583,6 +1714,7 @@ _egdbus_session_cs_on_signal_get_password (
 static void
 egdbus_session_cs_stub_iface_init (EGdbusSessionCSIface *iface)
 {
+  iface->send_receive_complete = _egdbus_session_cs_on_signal_send_receive_complete;
   iface->get_password = _egdbus_session_cs_on_signal_get_password;
 }
 
diff --git a/mail/libegdbus/e-gdbus-emailsession.h b/mail/libegdbus/e-gdbus-emailsession.h
index 4adf845..1238fff 100644
--- a/mail/libegdbus/e-gdbus-emailsession.h
+++ b/mail/libegdbus/e-gdbus-emailsession.h
@@ -59,8 +59,15 @@ struct _EGdbusSessionCSIface
     GDBusMethodInvocation *invocation,
     const gchar *uri);
 
+  gboolean (*handle_send_receive) (
+    EGdbusSessionCS *object,
+    GDBusMethodInvocation *invocation);
+
 
   /* GObject signal class handlers for received D-Bus signals: */
+  void (*send_receive_complete) (
+    EGdbusSessionCS *object);
+
   void (*get_password) (
     EGdbusSessionCS *object,
     const gchar *title,
@@ -99,9 +106,16 @@ void egdbus_session_cs_complete_get_folder_from_uri (
     GDBusMethodInvocation *invocation,
     const gchar *folder);
 
+void egdbus_session_cs_complete_send_receive (
+    EGdbusSessionCS *object,
+    GDBusMethodInvocation *invocation);
+
 
 
 /* D-Bus signal emissions functions: */
+void egdbus_session_cs_emit_send_receive_complete (
+    EGdbusSessionCS *object);
+
 void egdbus_session_cs_emit_get_password (
     EGdbusSessionCS *object,
     const gchar *title,
@@ -211,6 +225,22 @@ gboolean egdbus_session_cs_call_get_folder_from_uri_sync (
     GCancellable *cancellable,
     GError **error);
 
+void egdbus_session_cs_call_send_receive (
+    EGdbusSessionCS *proxy,
+    GCancellable *cancellable,
+    GAsyncReadyCallback callback,
+    gpointer user_data);
+
+gboolean egdbus_session_cs_call_send_receive_finish (
+    EGdbusSessionCS *proxy,
+    GAsyncResult *res,
+    GError **error);
+
+gboolean egdbus_session_cs_call_send_receive_sync (
+    EGdbusSessionCS *proxy,
+    GCancellable *cancellable,
+    GError **error);
+
 
 
 /* ---- */



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