![]() |
![]() |
![]() |
GData Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces |
#include <gdata/services/documents/gdata-documents-document.h> GDataDocumentsDocument; GDataDocumentsDocumentClass; GFile * gdata_documents_document_download (GDataDocumentsDocument *self
,GDataDocumentsService *service
,gchar **content_type
,const gchar *export_format
,GFile *destination_file
,gboolean replace_file_if_exists
,GCancellable *cancellable
,GError **error
); gchar * gdata_documents_document_get_download_uri (GDataDocumentsDocument *self
,const gchar *export_format
);
GObject +----GDataParsable +----GDataEntry +----GDataDocumentsEntry +----GDataDocumentsDocument +----GDataDocumentsPresentation +----GDataDocumentsSpreadsheet +----GDataDocumentsText
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 online documentation.
typedef struct _GDataDocumentsDocument GDataDocumentsDocument;
All the fields in the GDataDocumentsDocument structure are private and should never be accessed directly.
Since 0.7.0
typedef struct { } GDataDocumentsDocumentClass;
All the fields in the GDataDocumentsDocumentClass structure are private and should never be accessed directly.
Since 0.7.0
GFile * gdata_documents_document_download (GDataDocumentsDocument *self
,GDataDocumentsService *service
,gchar **content_type
,const gchar *export_format
,GFile *destination_file
,gboolean replace_file_if_exists
,GCancellable *cancellable
,GError **error
);
Downloads and returns the document file represented by the GDataDocumentsDocument. If the document doesn't exist, NULL
is returned, but no error
is set in error
.
export_format
should be the file extension of the desired output format for the document, from the list accepted by Google Documents. For example:
GDATA_DOCUMENTS_PRESENTATION_PDF
, GDATA_DOCUMENTS_SPREADSHEET_ODS
or GDATA_DOCUMENTS_TEXT_ODT
.
If self
is a GDataDocumentsSpreadsheet, only the first grid, or sheet, in the spreadsheet will be downloaded for some export formats. To download
a specific a specific grid, use gdata_documents_spreadsheet_get_download_uri()
with GDataDownloadStream to download the grid manually. See the
GData protocol
specification for more information.
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 destination_file
is a directory, then the file will be downloaded into this directory with a filename based on the GDataEntry's title and the
export format. 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
will be returned.
If there is an error getting the document, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR
error will be returned.
|
a GDataDocumentsDocument |
|
a GDataDocumentsService |
|
return location for the document's content type, or NULL ; free with g_free() . [out callee-allocates][transfer full][allow-none]
|
|
the format in which the document should be exported |
|
the GFile into which the text file should be saved |
|
TRUE if the file should be replaced if it already exists, FALSE otherwise
|
|
optional GCancellable object, or NULL
|
|
a GError, or NULL
|
Returns : |
a GFile pointing to the downloaded document, or NULL ; unref with g_object_unref() . [transfer full]
|
Since 0.7.0
gchar * gdata_documents_document_get_download_uri (GDataDocumentsDocument *self
,const gchar *export_format
);
Builds and returns the download URI for the given GDataDocumentsDocument in the desired format. Note that directly downloading the document using
this URI isn't possible, as authentication is required. You should instead use gdata_download_stream_new()
with the URI, and use the resulting
GInputStream.
export_format
should be the file extension of the desired output format for the document, from the list accepted by Google Documents. For example:
GDATA_DOCUMENTS_PRESENTATION_PDF
, GDATA_DOCUMENTS_SPREADSHEET_ODS
or GDATA_DOCUMENTS_TEXT_ODT
.
|
a GDataDocumentsDocument |
|
the format in which the document should be exported when downloaded |
Returns : |
the download URI; free with g_free()
|
Since 0.7.0