GDataDocumentsSpreadsheet

GDataDocumentsSpreadsheet — GData Documents spreadsheet object

Stability Level

Unstable, unless otherwise indicated

Synopsis

#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_directory,
                                                         gboolean replace_file_if_exists,
                                                         GCancellable *cancellable,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GDataParsable
         +----GDataEntry
               +----GDataDocumentsEntry
                     +----GDataDocumentsSpreadsheet

Implemented Interfaces

GDataDocumentsSpreadsheet implements GDataAccessHandler.

Description

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.

Details

GDataDocumentsSpreadsheet

typedef struct _GDataDocumentsSpreadsheet GDataDocumentsSpreadsheet;

All the fields in the GDataDocumentsSpreadsheet structure are private and should never be accessed directly.

Since 0.4.0


GDataDocumentsSpreadsheetClass

typedef struct {
} GDataDocumentsSpreadsheetClass;

All the fields in the GDataDocumentsSpreadsheetClass structure are private and should never be accessed directly.

Since 0.4.0


enum GDataDocumentsSpreadsheetFormat

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.

GDATA_DOCUMENTS_SPREADSHEET_XLS

Microsoft Excel spreadsheet (XLS) format

GDATA_DOCUMENTS_SPREADSHEET_CSV

Comma-Separated Values (CSV) format

GDATA_DOCUMENTS_SPREADSHEET_PDF

Portable Document Format (PDF)

GDATA_DOCUMENTS_SPREADSHEET_ODS

OpenDocument Spreadsheet (ODS) format

GDATA_DOCUMENTS_SPREADSHEET_TSV

Tab-Separated Values (TSV) format

GDATA_DOCUMENTS_SPREADSHEET_HTML

HyperText Markup Language (HTML) format

Since 0.4.0


gdata_documents_spreadsheet_new ()

GDataDocumentsSpreadsheet * gdata_documents_spreadsheet_new
                                                        (const gchar *id);

Creates a new GDataDocumentsSpreadsheet with the given entry ID ("id").

id :

the entry's ID (not the document ID of the spreadsheet), or NULL

Returns :

a new GDataDocumentsSpreadsheet, or NULL; unref with g_object_unref()

Since 0.4.0


gdata_documents_spreadsheet_download_document ()

GFile *             gdata_documents_spreadsheet_download_document
                                                        (GDataDocumentsSpreadsheet *self,
                                                         GDataDocumentsService *service,
                                                         gchar **content_type,
                                                         GDataDocumentsSpreadsheetFormat export_format,
                                                         gint gid,
                                                         GFile *destination_directory,
                                                         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 sheet on a given spreadsheet).

If there is an error getting the document, a GDATA_SERVICE_ERROR_WITH_QUERY error will be returned.

self :

a GDataDocumentsPresentation

service :

a GDataDocumentsService

content_type :

return location for the document's content type, or NULL; free with g_free()

export_format :

the format in which the presentation should be exported

gid :

the 0-based sheet ID to download, or -1

destination_directory :

the directory into which the presentation file should be saved

replace_file_if_exists :

TRUE if the file should be replaced if it already exists, FALSE otherwise

cancellable :

optional GCancellable object, or NULL

error :

a GError, or NULL

Returns :

the document's data, or NULL; unref with g_object_unref()

Since 0.4.0