[gnome-online-accounts] all: add a Documents account type



commit ba516330ef9e8883d21197dac8f286b4a47fbd19
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jul 14 17:50:03 2011 -0400

    all: add a Documents account type
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654932

 data/dbus-interfaces.xml           |    9 ++++++++
 doc/goa-docs.xml                   |    2 +
 doc/goa-sections.txt               |   40 ++++++++++++++++++++++++++++++++++++
 src/goabackend/goagoogleprovider.c |   33 +++++++++++++++++++++++++++-
 4 files changed, 82 insertions(+), 2 deletions(-)
---
diff --git a/data/dbus-interfaces.xml b/data/dbus-interfaces.xml
index 8e078f2..584481a 100644
--- a/data/dbus-interfaces.xml
+++ b/data/dbus-interfaces.xml
@@ -353,4 +353,13 @@
   <interface name="org.gnome.OnlineAccounts.Chat">
   </interface>
 
+  <!--
+      org.gnome.OnlineAccounts.Documents:
+
+      An account object implements this interface if it provides
+      documents-like capabilities.
+  -->
+  <interface name="org.gnome.OnlineAccounts.Documents">
+  </interface>
+
 </node>
diff --git a/doc/goa-docs.xml b/doc/goa-docs.xml
index 1d0922c..a2d1da9 100644
--- a/doc/goa-docs.xml
+++ b/doc/goa-docs.xml
@@ -110,6 +110,7 @@
       <xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Calendar.xml"/>
       <xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Contacts.xml"/>
       <xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Chat.xml"/>
+      <xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Documents.xml"/>
     </chapter>
   </part>
 
@@ -129,6 +130,7 @@
       <xi:include href="xml/GoaCalendar.xml"/>
       <xi:include href="xml/GoaContacts.xml"/>
       <xi:include href="xml/GoaChat.xml"/>
+      <xi:include href="xml/GoaDocuments.xml"/>
     </chapter>
   </part>
 
diff --git a/doc/goa-sections.txt b/doc/goa-sections.txt
index ca5416d..20bee0e 100644
--- a/doc/goa-sections.txt
+++ b/doc/goa-sections.txt
@@ -607,6 +607,46 @@ goa_chat_skeleton_get_type
 </SECTION>
 
 <SECTION>
+<FILE>GoaDocuments</FILE>
+GoaDocuments
+GoaDocumentsIface
+goa_documents_interface_info
+GoaDocumentsProxy
+GoaDocumentsProxyClass
+goa_documents_proxy_new
+goa_documents_proxy_new_finish
+goa_documents_proxy_new_sync
+goa_documents_proxy_new_for_bus
+goa_documents_proxy_new_for_bus_finish
+goa_documents_proxy_new_for_bus_sync
+GoaDocumentsSkeleton
+GoaDocumentsSkeletonClass
+goa_documents_skeleton_new
+<SUBSECTION Standard>
+GOA_TYPE_DOCUMENTS
+GOA_IS_DOCUMENTS
+GOA_DOCUMENTS
+GOA_DOCUMENTS_GET_IFACE
+GOA_TYPE_DOCUMENTS_PROXY
+GOA_IS_DOCUMENTS_PROXY
+GOA_IS_DOCUMENTS_PROXY_CLASS
+GOA_DOCUMENTS_PROXY
+GOA_DOCUMENTS_PROXY_CLASS
+GOA_DOCUMENTS_PROXY_GET_CLASS
+GOA_TYPE_DOCUMENTS_SKELETON
+GOA_IS_DOCUMENTS_SKELETON
+GOA_IS_DOCUMENTS_SKELETON_CLASS
+GOA_DOCUMENTS_SKELETON
+GOA_DOCUMENTS_SKELETON_CLASS
+GOA_DOCUMENTS_SKELETON_GET_CLASS
+GoaDocumentsProxyPrivate
+GoaDocumentsSkeletonPrivate
+goa_documents_get_type
+goa_documents_proxy_get_type
+goa_documents_skeleton_get_type
+</SECTION>
+
+<SECTION>
 <FILE>goalog</FILE>
 GoaLogLevel
 goa_log
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index d59860d..4047cce 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -113,7 +113,11 @@ get_request_uri_params (GoaOAuthProvider *provider)
     /* Calendar data API: http://code.google.com/apis/calendar/data/2.0/developers_guide.html */
     "https://www.google.com/calendar/feeds "
     /* Contacts API: http://code.google.com/apis/contacts/docs/3.0/developers_guide.html */
-    "https://www.google.com/m8/feeds/";));
+    "https://www.google.com/m8/feeds/ "
+    /* Documents API: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html */
+    "https://docs.google.com/feeds/ "
+    "https://spreadsheets.google.com/feeds/ "
+    "https://docs.googleusercontent.com/";));
   g_ptr_array_add (p, NULL);
 
   /* NOTE: Increase the number returned in get_crededentials_generation if adding scopes */
@@ -124,7 +128,7 @@ get_request_uri_params (GoaOAuthProvider *provider)
 static guint
 get_credentials_generation (GoaProvider *provider)
 {
-  return 1;
+  return 2;
 }
 
 static const gchar *
@@ -254,17 +258,20 @@ build_object (GoaProvider         *provider,
   GoaCalendar *calendar;
   GoaContacts *contacts;
   GoaChat *chat;
+  GoaDocuments *documents;
   gboolean ret;
   gboolean mail_enabled;
   gboolean calendar_enabled;
   gboolean contacts_enabled;
   gboolean chat_enabled;
+  gboolean documents_enabled;
 
   account = NULL;
   mail = NULL;
   calendar = NULL;
   contacts = NULL;
   chat = NULL;
+  documents = NULL;
   ret = FALSE;
 
   /* Chain up */
@@ -358,10 +365,30 @@ build_object (GoaProvider         *provider,
         goa_object_skeleton_set_chat (object, NULL);
     }
 
+  /* Documents */
+  documents = goa_object_get_documents (GOA_OBJECT (object));
+  documents_enabled = g_key_file_get_boolean (key_file, group, "DocumentsEnabled", NULL);
+
+  if (documents_enabled)
+    {
+      if (documents == NULL)
+        {
+          documents = goa_documents_skeleton_new ();
+          goa_object_skeleton_set_documents (object, documents);
+        }
+    }
+  else
+    {
+      if (documents != NULL)
+        goa_object_skeleton_set_documents (object, NULL);
+    }
+
 
   ret = TRUE;
 
  out:
+  if (documents != NULL)
+    g_object_unref (documents);
   if (chat != NULL)
     g_object_unref (chat);
   if (contacts != NULL)
@@ -401,6 +428,7 @@ show_account (GoaProvider         *provider,
   goa_util_add_row_switch_from_keyfile (table, object, _("Calendar"), "CalendarEnabled");
   goa_util_add_row_switch_from_keyfile (table, object, _("Contacts"), "ContactsEnabled");
   goa_util_add_row_switch_from_keyfile (table, object, _("Chat"), "ChatEnabled");
+  goa_util_add_row_switch_from_keyfile (table, object, _("Documents"), "DocumentsEnabled");
 }
 
 /* ---------------------------------------------------------------------------------------------------- */
@@ -413,6 +441,7 @@ add_account_key_values (GoaOAuthProvider  *provider,
   g_variant_builder_add (builder, "{ss}", "CalendarEnabled", "true");
   g_variant_builder_add (builder, "{ss}", "ContactsEnabled", "true");
   g_variant_builder_add (builder, "{ss}", "ChatEnabled", "true");
+  g_variant_builder_add (builder, "{ss}", "DocumentsEnabled", "true");
 }
 
 /* ---------------------------------------------------------------------------------------------------- */



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