[libgdata] [documents] Add GDataDocumentsDocument below GDataDocumentsEntry



commit e7b9b03f19bbd3b6c07aa9fe19932c8b24771a5b
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Aug 21 23:48:31 2010 +0100

    [documents] Add GDataDocumentsDocument below GDataDocumentsEntry
    
    It's the new parent class of GDataDocumentsPresentation,
    GDataDocumentsSpreadsheet and GDataDocumentsText. This breaks API.
    Helps: bgo#607616

 Makefile.am                                        |    2 +
 docs/reference/gdata-docs.xml                      |    1 +
 docs/reference/gdata-sections.txt                  |   17 +++
 gdata/gdata-private.h                              |   10 +-
 gdata/gdata.h                                      |    1 +
 gdata/gdata.symbols                                |    1 +
 .../services/documents/gdata-documents-document.c  |  151 ++++++++++++++++++++
 .../services/documents/gdata-documents-document.h  |   68 +++++++++
 gdata/services/documents/gdata-documents-entry.c   |   94 ------------
 .../documents/gdata-documents-presentation.c       |   10 +-
 .../documents/gdata-documents-presentation.h       |    6 +-
 .../documents/gdata-documents-spreadsheet.c        |   10 +-
 .../documents/gdata-documents-spreadsheet.h        |    6 +-
 gdata/services/documents/gdata-documents-text.c    |   10 +-
 gdata/services/documents/gdata-documents-text.h    |    6 +-
 15 files changed, 271 insertions(+), 122 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e86dd55..fa6dd43 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -238,6 +238,7 @@ gdata_documents_headers = \
 	gdata/services/documents/gdata-documents-feed.h		\
 	gdata/services/documents/gdata-documents-entry.h	\
 	gdata/services/documents/gdata-documents-query.h	\
+	gdata/services/documents/gdata-documents-document.h	\
 	gdata/services/documents/gdata-documents-text.h		\
 	gdata/services/documents/gdata-documents-presentation.h	\
 	gdata/services/documents/gdata-documents-folder.h	\
@@ -341,6 +342,7 @@ gdata_sources = \
 	gdata/services/documents/gdata-documents-service.c	\
 	gdata/services/documents/gdata-documents-feed.c		\
 	gdata/services/documents/gdata-documents-entry.c	\
+	gdata/services/documents/gdata-documents-document.c	\
 	gdata/services/documents/gdata-documents-text.c		\
 	gdata/services/documents/gdata-documents-presentation.c	\
 	gdata/services/documents/gdata-documents-spreadsheet.c	\
diff --git a/docs/reference/gdata-docs.xml b/docs/reference/gdata-docs.xml
index 5f776fe..7bc4a5d 100644
--- a/docs/reference/gdata-docs.xml
+++ b/docs/reference/gdata-docs.xml
@@ -137,6 +137,7 @@
 			<xi:include href="xml/gdata-documents-feed.xml"/>
 			<xi:include href="xml/gdata-documents-query.xml"/>
 			<xi:include href="xml/gdata-documents-entry.xml"/>
+			<xi:include href="xml/gdata-documents-document.xml"/>
 			<xi:include href="xml/gdata-documents-folder.xml"/>
 			<xi:include href="xml/gdata-documents-presentation.xml"/>
 			<xi:include href="xml/gdata-documents-spreadsheet.xml"/>
diff --git a/docs/reference/gdata-sections.txt b/docs/reference/gdata-sections.txt
index eda1a82..8d00502 100644
--- a/docs/reference/gdata-sections.txt
+++ b/docs/reference/gdata-sections.txt
@@ -1581,6 +1581,23 @@ GDataDocumentsFolderPrivate
 </SECTION>
 
 <SECTION>
+<FILE>gdata-documents-document</FILE>
+<TITLE>GDataDocumentsDocument</TITLE>
+GDataDocumentsDocument
+GDataDocumentsDocumentClass
+<SUBSECTION Standard>
+gdata_documents_document_get_type
+GDATA_DOCUMENTS_DOCUMENT
+GDATA_DOCUMENTS_DOCUMENT_CLASS
+GDATA_DOCUMENTS_DOCUMENT_GET_CLASS
+GDATA_IS_DOCUMENTS_DOCUMENT
+GDATA_IS_DOCUMENTS_DOCUMENT_CLASS
+GDATA_TYPE_DOCUMENTS_DOCUMENT
+<SUBSECTION Private>
+GDataDocumentsDocumentPrivate
+</SECTION>
+
+<SECTION>
 <FILE>gdata-documents-presentation</FILE>
 <TITLE>GDataDocumentsPresentation</TITLE>
 GDATA_DOCUMENTS_PRESENTATION_PDF
diff --git a/gdata/gdata-private.h b/gdata/gdata-private.h
index faec36f..6ee0387 100644
--- a/gdata/gdata-private.h
+++ b/gdata/gdata-private.h
@@ -82,10 +82,12 @@ G_GNUC_INTERNAL void _gdata_feed_call_progress_callback (GDataFeed *self, gpoint
 G_GNUC_INTERNAL void _gdata_entry_set_updated (GDataEntry *self, GTimeVal *updated);
 G_GNUC_INTERNAL void _gdata_entry_set_batch_data (GDataEntry *self, guint id, GDataBatchOperationType type);
 
-#include "gdata/services/documents/gdata-documents-entry.h"
-G_GNUC_INTERNAL GFile *_gdata_documents_entry_download_document (GDataDocumentsEntry *self, GDataService *service, gchar **content_type, const gchar *download_uri,
-                                                                 GFile *destination_directory, const gchar *file_extension, gboolean replace_file_if_exists,
-                                                                 GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
+#include "gdata/services/documents/gdata-documents-document.h"
+G_GNUC_INTERNAL GFile *_gdata_documents_document_download_document (GDataDocumentsDocument *self, GDataService *service, gchar **content_type,
+                                                                    const gchar *download_uri, GFile *destination_directory,
+                                                                    const gchar *file_extension, gboolean replace_file_if_exists,
+                                                                    GCancellable *cancellable,
+                                                                    GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
 
 #include "gdata/services/documents/gdata-documents-service.h"
 
diff --git a/gdata/gdata.h b/gdata/gdata.h
index c6d252d..e785d05 100644
--- a/gdata/gdata.h
+++ b/gdata/gdata.h
@@ -110,6 +110,7 @@
 
 /* Google Documents*/
 #include <gdata/services/documents/gdata-documents-entry.h>
+#include <gdata/services/documents/gdata-documents-document.h>
 #include <gdata/services/documents/gdata-documents-text.h>
 #include <gdata/services/documents/gdata-documents-spreadsheet.h>
 #include <gdata/services/documents/gdata-documents-presentation.h>
diff --git a/gdata/gdata.symbols b/gdata/gdata.symbols
index a11bf05..1068a67 100644
--- a/gdata/gdata.symbols
+++ b/gdata/gdata.symbols
@@ -845,3 +845,4 @@ gdata_batch_operation_type_get_type
 gdata_batchable_get_type
 gdata_batchable_create_operation
 gdata_upload_stream_get_method
+gdata_documents_document_get_type
diff --git a/gdata/services/documents/gdata-documents-document.c b/gdata/services/documents/gdata-documents-document.c
new file mode 100644
index 0000000..6d8840d
--- /dev/null
+++ b/gdata/services/documents/gdata-documents-document.c
@@ -0,0 +1,151 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * GData Client
+ * Copyright (C) Philip Withnall 2010 <philip tecnocode co uk>
+ *
+ * GData Client 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; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GData Client 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 GData Client.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * SECTION:gdata-documents-document
+ * @short_description: GData documents document object
+ * @stability: Unstable
+ * @include: gdata/services/documents/gdata-documents-document.h
+ *
+ * #GDataDocumentsDocument is an abstract subclass of #GDataDocumentsEntry to represent a Google Documents document. It is subclassed by
+ * #GDataDocumentsPresentation, #GDataDocumentsText and #GDataDocumentsSpreadsheet, which are instantiable.
+ *
+ * For more details of Google Documents' GData API, see the
+ * <ulink type="http://code.google.com/apis/document/docs/2.0/developers_guide_protocol.html";>online documentation</ulink>.
+ *
+ * Since: 0.7.0
+ **/
+
+#include <config.h>
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+
+#include "gdata-documents-document.h"
+#include "gdata-documents-entry.h"
+#include "gdata-download-stream.h"
+#include "gdata-private.h"
+#include "gdata-service.h"
+
+G_DEFINE_ABSTRACT_TYPE (GDataDocumentsDocument, gdata_documents_document, GDATA_TYPE_DOCUMENTS_ENTRY)
+
+static void
+gdata_documents_document_class_init (GDataDocumentsDocumentClass *klass)
+{
+	/* Nothing to see here. */
+}
+
+static void
+gdata_documents_document_init (GDataDocumentsDocument *self)
+{
+	/* Nothing to see here. */
+}
+
+static void
+notify_content_type_cb (GDataDownloadStream *download_stream, GParamSpec *pspec, gchar **content_type)
+{
+	*content_type = g_strdup (gdata_download_stream_get_content_type (download_stream));
+}
+
+/*
+ * _gdata_documents_document_download_document:
+ * @self: a #GDataDocumentsDocument
+ * @service: an authenticated #GDataDocumentsService
+ * @content_type: (out callee-allocates) (transfer full) (allow-none): return location for the document's content type, or %NULL; free with g_free()
+ * @download_uri: the URI to download the document
+ * @destination_file: the #GFile into which the document file should be saved
+ * @file_extension: the extension with which to save the downloaded file
+ * @replace_file_if_exists: %TRUE if you want to replace the file if it exists, %FALSE otherwise
+ * @cancellable: optional #GCancellable object, or %NULL
+ * @error: a #GError, or %NULL
+ *
+ * Downloads and returns the actual file which comprises the document here. If the document doesn't exist, the downloaded document will be an HTML
+ * file containing the error explanation.
+ * TODO: Is that still true?
+ *
+ * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread.  If the operation was
+ * cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
+ *
+ * If @replace_file_if_exists is set to %FALSE and the destination file already exists, a %G_IO_ERROR_EXISTS will be returned.
+ *
+ * If @service isn't authenticated, a %GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED is returned.
+ *
+ * If there is an error downloading the document, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned.
+ *
+ * If @destination_file is a directory, the file will be downloaded to this directory with the #GDataEntry:title and the appropriate extension as its
+ * filename.
+ *
+ * Return value: a #GFile pointing to the downloaded document, or %NULL; unref with g_object_unref()
+ *
+ * Since: 0.4.0
+ */
+GFile *
+_gdata_documents_document_download_document (GDataDocumentsDocument *self, GDataService *service, gchar **content_type, const gchar *src_uri,
+                                             GFile *destination_file, const gchar *file_extension, gboolean replace_file_if_exists,
+                                             GCancellable *cancellable, GError **error)
+{
+	const gchar *document_title;
+	gchar *default_filename;
+	GFileOutputStream *dest_stream;
+	GInputStream *src_stream;
+	GFile *actual_file = NULL;
+	GError *child_error = NULL;
+
+	/* TODO: async version */
+	g_return_val_if_fail (GDATA_IS_DOCUMENTS_DOCUMENT (self), NULL);
+	g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL);
+	g_return_val_if_fail (src_uri != NULL, NULL);
+	g_return_val_if_fail (G_IS_FILE (destination_file), NULL);
+	g_return_val_if_fail (file_extension != NULL, NULL);
+	g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
+	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+	/* Ensure we're authenticated first */
+	if (gdata_service_is_authenticated (GDATA_SERVICE (service)) == FALSE) {
+		g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
+		                     _("You must be authenticated to download documents."));
+		return NULL;
+	}
+
+	/* Determine a default filename based on the document's title */
+	document_title = gdata_entry_get_title (GDATA_ENTRY (self));
+	default_filename = g_strdup_printf ("%s.%s", document_title, file_extension);
+
+	dest_stream = _gdata_download_stream_find_destination (default_filename, destination_file, &actual_file, replace_file_if_exists, cancellable,
+	                                                       error);
+	g_free (default_filename);
+
+	if (dest_stream == NULL)
+		return NULL;
+
+	/* Synchronously splice the data from the download stream to the file stream (network -> disk) */
+	src_stream = gdata_download_stream_new (GDATA_SERVICE (service), src_uri);
+	g_signal_connect (src_stream, "notify::content-type", (GCallback) notify_content_type_cb, content_type);
+	g_output_stream_splice (G_OUTPUT_STREAM (dest_stream), src_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
+	                        cancellable, &child_error);
+	g_object_unref (src_stream);
+	g_object_unref (dest_stream);
+
+	if (child_error != NULL) {
+		g_object_unref (actual_file);
+		g_propagate_error (error, child_error);
+		return NULL;
+	}
+
+	return actual_file;
+}
diff --git a/gdata/services/documents/gdata-documents-document.h b/gdata/services/documents/gdata-documents-document.h
new file mode 100644
index 0000000..49c7392
--- /dev/null
+++ b/gdata/services/documents/gdata-documents-document.h
@@ -0,0 +1,68 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * GData Client
+ * Copyright (C) Philip Withnall 2010 <philip tecnocode co uk>
+ *
+ * GData Client 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; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GData Client 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 GData Client.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GDATA_DOCUMENTS_DOCUMENT_H
+#define GDATA_DOCUMENTS_DOCUMENT_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <gdata/services/documents/gdata-documents-entry.h>
+#include <gdata/gdata-types.h>
+
+G_BEGIN_DECLS
+
+#define GDATA_TYPE_DOCUMENTS_DOCUMENT		(gdata_documents_document_get_type ())
+#define GDATA_DOCUMENTS_DOCUMENT(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_DOCUMENTS_DOCUMENT, GDataDocumentsDocument))
+#define GDATA_DOCUMENTS_DOCUMENT_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_DOCUMENTS_DOCUMENT, GDataDocumentsDocumentClass))
+#define GDATA_IS_DOCUMENTS_DOCUMENT(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_DOCUMENTS_DOCUMENT))
+#define GDATA_IS_DOCUMENTS_DOCUMENT_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_DOCUMENTS_DOCUMENT))
+#define GDATA_DOCUMENTS_DOCUMENT_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_DOCUMENTS_DOCUMENT, GDataDocumentsDocumentClass))
+
+typedef struct _GDataDocumentsDocumentPrivate	GDataDocumentsDocumentPrivate;
+
+/**
+ * GDataDocumentsDocument:
+ *
+ * All the fields in the #GDataDocumentsDocument structure are private and should never be accessed directly.
+ *
+ * Since: 0.7.0
+ **/
+typedef struct {
+	GDataDocumentsEntry parent;
+	GDataDocumentsDocumentPrivate *priv;
+} GDataDocumentsDocument;
+
+/**
+ * GDataDocumentsDocumentClass:
+ *
+ * All the fields in the #GDataDocumentsDocumentClass structure are private and should never be accessed directly.
+ *
+ * Since: 0.7.0
+ **/
+typedef struct {
+	/*< private >*/
+	GDataDocumentsEntryClass parent;
+} GDataDocumentsDocumentClass;
+
+GType gdata_documents_document_get_type (void) G_GNUC_CONST;
+
+G_END_DECLS
+
+#endif /* !GDATA_DOCUMENTS_DOCUMENT_H */
diff --git a/gdata/services/documents/gdata-documents-entry.c b/gdata/services/documents/gdata-documents-entry.c
index b76077d..ad3205f 100644
--- a/gdata/services/documents/gdata-documents-entry.c
+++ b/gdata/services/documents/gdata-documents-entry.c
@@ -47,7 +47,6 @@
 #include "gdata-types.h"
 #include "gdata-private.h"
 #include "gdata-access-handler.h"
-#include "gdata-download-stream.h"
 
 static void gdata_documents_entry_access_handler_init (GDataAccessHandlerIface *iface);
 static GObject *gdata_documents_entry_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params);
@@ -561,96 +560,3 @@ gdata_documents_entry_is_deleted (GDataDocumentsEntry *self)
 	g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), FALSE);
 	return self->priv->is_deleted;
 }
-
-static void
-notify_content_type_cb (GDataDownloadStream *download_stream, GParamSpec *pspec, gchar **content_type)
-{
-	*content_type = g_strdup (gdata_download_stream_get_content_type (download_stream));
-}
-
-/*
- * _gdata_documents_entry_download_document:
- * @self: a #GDataDocumentsEntry
- * @service: an authenticated #GDataDocumentsService
- * @content_type: (out callee-allocates) (transfer full) (allow-none): return location for the document's content type, or %NULL; free with g_free()
- * @download_uri: the URI to download the document
- * @destination_file: the #GFile into which the document file should be saved
- * @file_extension: the extension with which to save the downloaded file
- * @replace_file_if_exists: %TRUE if you want to replace the file if it exists, %FALSE otherwise
- * @cancellable: optional #GCancellable object, or %NULL
- * @error: a #GError, or %NULL
- *
- * Downloads and returns the actual file which comprises the document here. If the document doesn't exist,
- * the downloaded document will be an HTML file containing the error explanation.
- * TODO: Is that still true?
- *
- * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread.
- * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
- *
- * If @replace_file_if_exists is set to %FALSE and the destination file already exists, a %G_IO_ERROR_EXISTS will be returned.
- *
- * If @service isn't authenticated, a %GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED is returned.
- *
- * If there is an error downloading the document, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned.
- *
- * If @destination_file is a directory, the file will be downloaded to this directory with the #GDataEntry:title and 
- * the appropriate extension as its filename.
- *
- * Return value: a #GFile pointing to the downloaded document, or %NULL; unref with g_object_unref()
- *
- * Since: 0.4.0
- */
-GFile *
-_gdata_documents_entry_download_document (GDataDocumentsEntry *self, GDataService *service, gchar **content_type, const gchar *src_uri,
-                                          GFile *destination_file, const gchar *file_extension, gboolean replace_file_if_exists,
-                                          GCancellable *cancellable, GError **error)
-{
-	const gchar *document_title;
-	gchar *default_filename;
-	GFileOutputStream *dest_stream;
-	GInputStream *src_stream;
-	GFile *actual_file = NULL;
-	GError *child_error = NULL;
-
-	/* TODO: async version */
-	g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), NULL);
-	g_return_val_if_fail (GDATA_IS_SERVICE (service), NULL);
-	g_return_val_if_fail (src_uri != NULL, NULL);
-	g_return_val_if_fail (G_IS_FILE (destination_file), NULL);
-	g_return_val_if_fail (file_extension != NULL, NULL);
-	g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
-	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
-	/* Ensure we're authenticated first */
-	if (gdata_service_is_authenticated (GDATA_SERVICE (service)) == FALSE) {
-		g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED,
-		                     _("You must be authenticated to download documents."));
-		return NULL;
-	}
-
-	/* Determine a default filename based on the document's title */
-	document_title = gdata_entry_get_title (GDATA_ENTRY (self));
-	default_filename = g_strdup_printf ("%s.%s", document_title, file_extension);
-
-	dest_stream = _gdata_download_stream_find_destination (default_filename, destination_file, &actual_file, replace_file_if_exists,
-	                                                       cancellable, error);
-	g_free (default_filename);
-
-	if (dest_stream == NULL)
-		return NULL;
-
-	/* Synchronously splice the data from the download stream to the file stream (network -> disk) */
-	src_stream = gdata_download_stream_new (GDATA_SERVICE (service), src_uri);
-	g_signal_connect (src_stream, "notify::content-type", (GCallback) notify_content_type_cb, content_type);
-	g_output_stream_splice (G_OUTPUT_STREAM (dest_stream), src_stream,
-	                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, cancellable, &child_error);
-	g_object_unref (src_stream);
-	g_object_unref (dest_stream);
-	if (child_error != NULL) {
-		g_object_unref (actual_file);
-		g_propagate_error (error, child_error);
-		return NULL;
-	}
-
-	return actual_file;
-}
diff --git a/gdata/services/documents/gdata-documents-presentation.c b/gdata/services/documents/gdata-documents-presentation.c
index c513ddc..f986e58 100644
--- a/gdata/services/documents/gdata-documents-presentation.c
+++ b/gdata/services/documents/gdata-documents-presentation.c
@@ -24,7 +24,7 @@
  * @stability: Unstable
  * @include: gdata/services/documents/gdata-documents-presentation.h
  *
- * #GDataDocumentsPresentation is a subclass of #GDataDocumentsEntry to represent a Google Documents presentation.
+ * #GDataDocumentsPresentation is a subclass of #GDataDocumentsDocument to represent a Google Documents presentation.
  *
  * For more details of Google Documents' GData API, see the
  * <ulink type="http://code.google.com/apis/document/docs/2.0/developers_guide_protocol.html";>online documentation</ulink>.
@@ -46,7 +46,7 @@
 
 static void get_xml (GDataParsable *parsable, GString *xml_string);
 
-G_DEFINE_TYPE (GDataDocumentsPresentation, gdata_documents_presentation, GDATA_TYPE_DOCUMENTS_ENTRY)
+G_DEFINE_TYPE (GDataDocumentsPresentation, gdata_documents_presentation, GDATA_TYPE_DOCUMENTS_DOCUMENT)
 
 static void
 gdata_documents_presentation_class_init (GDataDocumentsPresentationClass *klass)
@@ -135,9 +135,9 @@ gdata_documents_presentation_download_document (GDataDocumentsPresentation *self
 
 	/* Call the common download method on the parent class */
 	link_href = gdata_documents_presentation_get_download_uri (self, export_format);
-	destination_file = _gdata_documents_entry_download_document (GDATA_DOCUMENTS_ENTRY (self), GDATA_SERVICE (service), content_type, link_href,
-	                                                             destination_file, export_format, replace_file_if_exists,
-	                                                             cancellable, error);
+	destination_file = _gdata_documents_document_download_document (GDATA_DOCUMENTS_DOCUMENT (self), GDATA_SERVICE (service), content_type,
+	                                                                link_href, destination_file, export_format, replace_file_if_exists,
+	                                                                cancellable, error);
 	g_free (link_href);
 
 	return destination_file;
diff --git a/gdata/services/documents/gdata-documents-presentation.h b/gdata/services/documents/gdata-documents-presentation.h
index ff6e102..a74f84a 100644
--- a/gdata/services/documents/gdata-documents-presentation.h
+++ b/gdata/services/documents/gdata-documents-presentation.h
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include <gdata/services/documents/gdata-documents-entry.h>
+#include <gdata/services/documents/gdata-documents-document.h>
 #include <gdata/gdata-types.h>
 
 G_BEGIN_DECLS
@@ -113,7 +113,7 @@ typedef struct _GDataDocumentsPresentationPrivate	GDataDocumentsPresentationPriv
  * Since: 0.4.0
  **/
 typedef struct {
-	GDataDocumentsEntry parent;
+	GDataDocumentsDocument parent;
 	GDataDocumentsPresentationPrivate *priv;
 } GDataDocumentsPresentation;
 
@@ -126,7 +126,7 @@ typedef struct {
  **/
 typedef struct {
 	/*< private >*/
-	GDataDocumentsEntryClass parent;
+	GDataDocumentsDocumentClass parent;
 } GDataDocumentsPresentationClass;
 
 GType gdata_documents_presentation_get_type (void) G_GNUC_CONST;
diff --git a/gdata/services/documents/gdata-documents-spreadsheet.c b/gdata/services/documents/gdata-documents-spreadsheet.c
index 3b1fcf6..845e639 100644
--- a/gdata/services/documents/gdata-documents-spreadsheet.c
+++ b/gdata/services/documents/gdata-documents-spreadsheet.c
@@ -24,7 +24,7 @@
  * @stability: Unstable
  * @include: gdata/services/documents/gdata-documents-spreadsheet.h
  *
- * #GDataDocumentsSpreadsheet is a subclass of #GDataDocumentsEntry to represent a spreadsheet from Google Documents.
+ * #GDataDocumentsSpreadsheet is a subclass of #GDataDocumentsDocument to represent a spreadsheet from Google Documents.
  *
  * For more details of Google Documents' GData API, see the
  * <ulink type="http://code.google.com/apis/document/docs/2.0/developers_guide_protocol.html";>online documentation</ulink>.
@@ -45,7 +45,7 @@
 
 static void get_xml (GDataParsable *parsable, GString *xml_string);
 
-G_DEFINE_TYPE (GDataDocumentsSpreadsheet, gdata_documents_spreadsheet, GDATA_TYPE_DOCUMENTS_ENTRY)
+G_DEFINE_TYPE (GDataDocumentsSpreadsheet, gdata_documents_spreadsheet, GDATA_TYPE_DOCUMENTS_DOCUMENT)
 
 static void
 gdata_documents_spreadsheet_class_init (GDataDocumentsSpreadsheetClass *klass)
@@ -145,9 +145,9 @@ gdata_documents_spreadsheet_download_document (GDataDocumentsSpreadsheet *self,
 
 	/* Download the document */
 	link_href = gdata_documents_spreadsheet_get_download_uri (self, export_format, gid);
-	destination_file = _gdata_documents_entry_download_document (GDATA_DOCUMENTS_ENTRY (self), spreadsheet_service, content_type,
-	                                                             link_href, destination_file, export_format, replace_file_if_exists,
-	                                                             cancellable, error);
+	destination_file = _gdata_documents_document_download_document (GDATA_DOCUMENTS_DOCUMENT (self), spreadsheet_service, content_type,
+	                                                                link_href, destination_file, export_format, replace_file_if_exists,
+	                                                                cancellable, error);
 	g_free (link_href);
 
 	return destination_file;
diff --git a/gdata/services/documents/gdata-documents-spreadsheet.h b/gdata/services/documents/gdata-documents-spreadsheet.h
index 8456a6b..e40ee3e 100644
--- a/gdata/services/documents/gdata-documents-spreadsheet.h
+++ b/gdata/services/documents/gdata-documents-spreadsheet.h
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include <gdata/services/documents/gdata-documents-entry.h>
+#include <gdata/services/documents/gdata-documents-document.h>
 #include <gdata/gdata-types.h>
 
 G_BEGIN_DECLS
@@ -126,7 +126,7 @@ typedef struct _GDataDocumentsSpreadsheetPrivate	GDataDocumentsSpreadsheetPrivat
  * Since: 0.4.0
  **/
 typedef struct {
-	GDataDocumentsEntry parent;
+	GDataDocumentsDocument parent;
 	GDataDocumentsSpreadsheetPrivate *priv;
 } GDataDocumentsSpreadsheet;
 
@@ -139,7 +139,7 @@ typedef struct {
  **/
 typedef struct {
 	/*< private >*/
-	GDataDocumentsEntryClass parent;
+	GDataDocumentsDocumentClass parent;
 } GDataDocumentsSpreadsheetClass;
 
 GType gdata_documents_spreadsheet_get_type (void) G_GNUC_CONST;
diff --git a/gdata/services/documents/gdata-documents-text.c b/gdata/services/documents/gdata-documents-text.c
index dadba8a..bf236c2 100644
--- a/gdata/services/documents/gdata-documents-text.c
+++ b/gdata/services/documents/gdata-documents-text.c
@@ -24,7 +24,7 @@
  * @stability: Unstable
  * @include: gdata/services/documents/gdata-documents-text.h
  *
- * #GDataDocumentsText is a subclass of #GDataDocumentsEntry to represent a text document from Google Documents.
+ * #GDataDocumentsText is a subclass of #GDataDocumentsDocument to represent a text document from Google Documents.
  *
  * For more details of Google Documents' GData API, see the
  * <ulink type="http://code.google.com/apis/document/docs/2.0/developers_guide_protocol.html";>online documentation</ulink>.
@@ -45,7 +45,7 @@
 
 static void get_xml (GDataParsable *parsable, GString *xml_string);
 
-G_DEFINE_TYPE (GDataDocumentsText, gdata_documents_text, GDATA_TYPE_DOCUMENTS_ENTRY)
+G_DEFINE_TYPE (GDataDocumentsText, gdata_documents_text, GDATA_TYPE_DOCUMENTS_DOCUMENT)
 
 static void
 gdata_documents_text_class_init (GDataDocumentsTextClass *klass)
@@ -134,9 +134,9 @@ gdata_documents_text_download_document (GDataDocumentsText *self, GDataDocuments
 
 	/* Download the file */
 	link_href = gdata_documents_text_get_download_uri (self, export_format);
-	destination_file = _gdata_documents_entry_download_document (GDATA_DOCUMENTS_ENTRY (self), GDATA_SERVICE (service),
-	                                                             content_type, link_href, destination_file, export_format,
-	                                                             replace_file_if_exists, cancellable, error);
+	destination_file = _gdata_documents_document_download_document (GDATA_DOCUMENTS_DOCUMENT (self), GDATA_SERVICE (service),
+	                                                                content_type, link_href, destination_file, export_format,
+	                                                                replace_file_if_exists, cancellable, error);
 	g_free (link_href);
 
 	return destination_file;
diff --git a/gdata/services/documents/gdata-documents-text.h b/gdata/services/documents/gdata-documents-text.h
index 0593aec..d02f039 100644
--- a/gdata/services/documents/gdata-documents-text.h
+++ b/gdata/services/documents/gdata-documents-text.h
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#include <gdata/services/documents/gdata-documents-entry.h>
+#include <gdata/services/documents/gdata-documents-document.h>
 #include <gdata/gdata-types.h>
 
 G_BEGIN_DECLS
@@ -149,7 +149,7 @@ typedef struct _GDataDocumentsTextPrivate	GDataDocumentsTextPrivate;
  * Since: 0.4.0
  **/
 typedef struct {
-	GDataDocumentsEntry parent;
+	GDataDocumentsDocument parent;
 	GDataDocumentsTextPrivate *priv;
 } GDataDocumentsText;
 
@@ -162,7 +162,7 @@ typedef struct {
  **/
 typedef struct {
 	/*< private >*/
-	GDataDocumentsEntryClass parent;
+	GDataDocumentsDocumentClass parent;
 } GDataDocumentsTextClass;
 
 GType gdata_documents_text_get_type (void) G_GNUC_CONST;



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