![]() |
![]() |
![]() |
GData Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces |
#include <gdata/services/documents/gdata-documents-spreadsheet.h> GDataDocumentsSpreadsheet; GDataDocumentsSpreadsheetClass; enum GDataDocumentsSpreadsheetFormat; GDataDocumentsSpreadsheet * gdata_documents_spreadsheet_new (const gchar *id
); GFile * gdata_documents_spreadsheet_download_document (GDataDocumentsSpreadsheet *self
,GDataDocumentsService *service
,gchar **content_type
,GDataDocumentsSpreadsheetFormat export_format
,gint gid
,GFile *destination_file
,gboolean replace_file_if_exists
,GCancellable *cancellable
,GError **error
); gchar * gdata_documents_spreadsheet_get_download_uri (GDataDocumentsSpreadsheet *self
,GDataDocumentsSpreadsheetFormat export_format
,gint gid
);
GObject +----GDataParsable +----GDataEntry +----GDataDocumentsEntry +----GDataDocumentsSpreadsheet
GDataDocumentsSpreadsheet is a subclass of GDataDocumentsEntry to represent a spreadsheet from Google Documents.
For more details of Google Documents' GData API, see the online documentation.
typedef struct _GDataDocumentsSpreadsheet GDataDocumentsSpreadsheet;
All the fields in the GDataDocumentsSpreadsheet structure are private and should never be accessed directly.
Since 0.4.0
typedef struct { } GDataDocumentsSpreadsheetClass;
All the fields in the GDataDocumentsSpreadsheetClass structure are private and should never be accessed directly.
Since 0.4.0
typedef enum { GDATA_DOCUMENTS_SPREADSHEET_XLS = 0, GDATA_DOCUMENTS_SPREADSHEET_CSV, GDATA_DOCUMENTS_SPREADSHEET_PDF, GDATA_DOCUMENTS_SPREADSHEET_ODS, GDATA_DOCUMENTS_SPREADSHEET_TSV, GDATA_DOCUMENTS_SPREADSHEET_HTML } GDataDocumentsSpreadsheetFormat;
The different available download formats for spreadsheets.
Microsoft Excel spreadsheet (XLS) format | |
Comma-Separated Values (CSV) format | |
Portable Document Format (PDF) | |
OpenDocument Spreadsheet (ODS) format | |
Tab-Separated Values (TSV) format | |
HyperText Markup Language (HTML) format |
Since 0.4.0
GDataDocumentsSpreadsheet * gdata_documents_spreadsheet_new
(const gchar *id
);
Creates a new GDataDocumentsSpreadsheet with the given entry ID ("id").
|
the entry's ID (not the document ID of the spreadsheet), or NULL . [allow-none]
|
Returns : |
a new GDataDocumentsSpreadsheet, or NULL ; unref with g_object_unref()
|
Since 0.4.0
GFile * gdata_documents_spreadsheet_download_document (GDataDocumentsSpreadsheet *self
,GDataDocumentsService *service
,gchar **content_type
,GDataDocumentsSpreadsheetFormat export_format
,gint gid
,GFile *destination_file
,gboolean replace_file_if_exists
,GCancellable *cancellable
,GError **error
);
Downloads and returns the spreadsheet file represented by the GDataDocumentsSpreadsheet. If the document doesn't exist,
NULL
is returned, but no error is set in error
. TODO: What?
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.
When requesting a GDATA_DOCUMENTS_SPREADSHEET_CSV
or GDATA_DOCUMENTS_SPREADSHEET_TSV
file you must specify an additional
parameter called gid
which indicates which grid, or sheet, you wish to get (the index is 0
-based, so
GID 1
actually refers to the second sheet on a given spreadsheet).
If destination_file
is a directory, then the file will be downloaded in this directory with the "title" with
the apropriate extension as name.
If there is an error getting the document, a GDATA_SERVICE_ERROR_PROTOCOL_ERROR
error will be returned.
|
a GDataDocumentsSpreadsheet |
|
a GDataDocumentsService |
|
return location for the document's content type, or NULL ; free with g_free() . [out callee-allocates][transfer full callee-allocates][allow-none callee-allocates]
|
|
the format in which the spreadsheet should be exported |
|
the 0 -based sheet ID to download, or -1
|
|
the GFile into which the spreadsheet 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 : |
the document's data, or NULL ; unref with g_object_unref() . [transfer full]
|
Since 0.4.0
gchar * gdata_documents_spreadsheet_get_download_uri (GDataDocumentsSpreadsheet *self
,GDataDocumentsSpreadsheetFormat export_format
,gint gid
);
Builds and returns the download URI for the given GDataDocumentsSpreadsheet 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.
When requesting a GDATA_DOCUMENTS_SPREADSHEET_CSV
or GDATA_DOCUMENTS_SPREADSHEET_TSV
file you must specify an additional
parameter called gid
which indicates which grid, or sheet, you wish to get (the index is 0
-based, so
GID 1
actually refers to the second sheet on a given spreadsheet).
|
a GDataDocumentsSpreadsheet |
|
the format in which the spreadsheet should be exported when downloaded |
|
the 0 -based sheet ID to download, or -1
|
Returns : |
the download URI; free with g_free()
|
Since 0.5.0