Blame docs/reference/html/GDataDocumentsSpreadsheet.html

Packit 4b6dd7
Packit 4b6dd7
<html>
Packit 4b6dd7
<head>
Packit 4b6dd7
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Packit 4b6dd7
<title>GDataDocumentsSpreadsheet: GData Reference Manual</title>
Packit 4b6dd7
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
Packit 4b6dd7
<link rel="home" href="index.html" title="GData Reference Manual">
Packit 4b6dd7
<link rel="up" href="ch16.html" title="Google Documents/Drive API">
Packit 4b6dd7
<link rel="prev" href="GDataDocumentsPresentation.html" title="GDataDocumentsPresentation">
Packit 4b6dd7
<link rel="next" href="GDataDocumentsText.html" title="GDataDocumentsText">
Packit 4b6dd7
<meta name="generator" content="GTK-Doc V1.26.1 (XML mode)">
Packit 4b6dd7
<link rel="stylesheet" href="style.css" type="text/css">
Packit 4b6dd7
</head>
Packit 4b6dd7
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Top  | 
Packit 4b6dd7
                  Description  | 
Packit 4b6dd7
                  Object Hierarchy  | 
Packit 4b6dd7
                  Implemented Interfaces
Packit 4b6dd7
Packit 4b6dd7
Home
Packit 4b6dd7
Up
Packit 4b6dd7
Prev
Packit 4b6dd7
Next
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

GDataDocumentsSpreadsheet

Packit 4b6dd7

GDataDocumentsSpreadsheet — GData Documents spreadsheet object

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Stability Level

Packit 4b6dd7
Packit 4b6dd7
develop applications to these interfaces, release them, and have confidence that
Packit 4b6dd7
they will run on all minor releases of the product (after the one in which the
Packit 4b6dd7
interface was introduced, and within the same major release). Even at a major
Packit 4b6dd7
release, incompatible changes are expected to be rare, and to have strong
Packit 4b6dd7
justifications.
Packit 4b6dd7
">Stable, unless otherwise indicated
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Functions

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
GDataDocumentsSpreadsheet *
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
gdata_documents_spreadsheet_new ()
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
gchar *
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
gdata_documents_spreadsheet_get_download_uri ()
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Types and Values

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
#define
Packit 4b6dd7
GDATA_DOCUMENTS_SPREADSHEET_CSV
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
#define
Packit 4b6dd7
GDATA_DOCUMENTS_SPREADSHEET_HTML
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
#define
Packit 4b6dd7
GDATA_DOCUMENTS_SPREADSHEET_ODS
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
#define
Packit 4b6dd7
GDATA_DOCUMENTS_SPREADSHEET_PDF
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
#define
Packit 4b6dd7
GDATA_DOCUMENTS_SPREADSHEET_TSV
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
#define
Packit 4b6dd7
GDATA_DOCUMENTS_SPREADSHEET_XLS
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
 
Packit 4b6dd7
GDataDocumentsSpreadsheet
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
 
Packit 4b6dd7
GDataDocumentsSpreadsheetClass
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Object Hierarchy

Packit 4b6dd7
    GObject
Packit 4b6dd7
    ╰── GDataParsable
Packit 4b6dd7
        ╰── GDataEntry
Packit 4b6dd7
            ╰── GDataDocumentsEntry
Packit 4b6dd7
                ╰── GDataDocumentsDocument
Packit 4b6dd7
                    ╰── GDataDocumentsSpreadsheet
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Implemented Interfaces

Packit 4b6dd7

Packit 4b6dd7
GDataDocumentsSpreadsheet implements
Packit 4b6dd7
 GDataAccessHandler.

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Includes

Packit 4b6dd7
#include <gdata/services/documents/gdata-documents-spreadsheet.h>
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Description

Packit 4b6dd7

GDataDocumentsSpreadsheet is a subclass of GDataDocumentsDocument to represent a spreadsheet from Google Documents.

Packit 4b6dd7

For more details of Google Drive's GData API, see the

Packit 4b6dd7
online documentation.
Packit 4b6dd7
Packit 4b6dd7

Example 37. Downloading a Specific Sheet of a Spreadsheet

Packit 4b6dd7
Packit 4b6dd7
  
Packit 4b6dd7
    
Packit 4b6dd7
      
Packit 4b6dd7
        
1
Packit 4b6dd7
2
Packit 4b6dd7
3
Packit 4b6dd7
4
Packit 4b6dd7
5
Packit 4b6dd7
6
Packit 4b6dd7
7
Packit 4b6dd7
8
Packit 4b6dd7
9
Packit 4b6dd7
10
Packit 4b6dd7
11
Packit 4b6dd7
12
Packit 4b6dd7
13
Packit 4b6dd7
14
Packit 4b6dd7
15
Packit 4b6dd7
16
Packit 4b6dd7
17
Packit 4b6dd7
18
Packit 4b6dd7
19
Packit 4b6dd7
20
Packit 4b6dd7
21
Packit 4b6dd7
22
Packit 4b6dd7
23
Packit 4b6dd7
24
Packit 4b6dd7
25
Packit 4b6dd7
26
Packit 4b6dd7
27
Packit 4b6dd7
28
Packit 4b6dd7
29
Packit 4b6dd7
30
Packit 4b6dd7
31
Packit 4b6dd7
32
Packit 4b6dd7
33
Packit 4b6dd7
34
Packit 4b6dd7
35
Packit 4b6dd7
36
Packit 4b6dd7
37
Packit 4b6dd7
38
Packit 4b6dd7
39
Packit 4b6dd7
40
Packit 4b6dd7
41
Packit 4b6dd7
42
Packit 4b6dd7
43
Packit 4b6dd7
44
Packit 4b6dd7
45
Packit 4b6dd7
46
Packit 4b6dd7
47
Packit 4b6dd7
48
Packit 4b6dd7
        
GDataDocumentsService *service;
Packit 4b6dd7
GDataDocumentsSpreadsheet *spreadsheet;
Packit 4b6dd7
GFile *destination_file;
Packit 4b6dd7
guint gid;
Packit 4b6dd7
gchar *download_uri;
Packit 4b6dd7
GDataDownloadStream *download_stream;
Packit 4b6dd7
GFileOutputStream *output_stream;
Packit 4b6dd7
GError *error = NULL;
Packit 4b6dd7
Packit 4b6dd7
/* Create a service and retrieve the spreadsheet and sheet index (GID) to download and the file to save the download in */
Packit 4b6dd7
service = create_youtube_service ();
Packit 4b6dd7
spreadsheet = get_document_to_download (service);
Packit 4b6dd7
destination_file = query_user_for_destination_file (spreadsheet);
Packit 4b6dd7
gid = query_user_for_gid (spreadsheet);
Packit 4b6dd7
Packit 4b6dd7
/* Create the download stream */
Packit 4b6dd7
download_uri = gdata_documents_spreadsheet_get_download_uri (spreadsheet, GDATA_DOCUMENTS_SPREADSHEET_CSV, gid);
Packit 4b6dd7
download_stream = GDATA_DOWNLOAD_STREAM (gdata_download_stream_new (service, gdata_documents_service_get_spreadsheet_authorization_domain (),
Packit 4b6dd7
                                                                    download_uri, NULL));
Packit 4b6dd7
g_free (download_uri);
Packit 4b6dd7
Packit 4b6dd7
g_object_unref (spreadsheet);
Packit 4b6dd7
g_object_unref (service);
Packit 4b6dd7
Packit 4b6dd7
/* Create the file output stream */
Packit 4b6dd7
output_stream = g_file_replace (destination_file, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, NULL, &error);
Packit 4b6dd7
Packit 4b6dd7
g_object_unref (destination_file);
Packit 4b6dd7
Packit 4b6dd7
if (error != NULL) {
Packit 4b6dd7
    g_error ("Error creating destination file: %s", error->message);
Packit 4b6dd7
    g_error_free (error);
Packit 4b6dd7
    g_object_unref (download_stream);
Packit 4b6dd7
    return;
Packit 4b6dd7
}
Packit 4b6dd7
Packit 4b6dd7
/* Download the document. This should almost always be done asynchronously. */
Packit 4b6dd7
g_output_stream_splice (G_OUTPUT_STREAM (output_stream), G_INPUT_STREAM (download_stream),
Packit 4b6dd7
                        G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, NULL, &error);
Packit 4b6dd7
Packit 4b6dd7
g_object_unref (output_stream);
Packit 4b6dd7
g_object_unref (download_stream);
Packit 4b6dd7
Packit 4b6dd7
if (error != NULL) {
Packit 4b6dd7
    g_error ("Error downloading spreadsheet: %s", error->message);
Packit 4b6dd7
    g_error_free (error);
Packit 4b6dd7
    return;
Packit 4b6dd7
}
Packit 4b6dd7
      
Packit 4b6dd7
    
Packit 4b6dd7
  
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Functions

Packit 4b6dd7
Packit 4b6dd7

gdata_documents_spreadsheet_new ()

Packit 4b6dd7
GDataDocumentsSpreadsheet *
Packit 4b6dd7
gdata_documents_spreadsheet_new (const gchar *id);
Packit 4b6dd7

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

Packit 4b6dd7
Packit 4b6dd7

Parameters

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

id

Packit 4b6dd7

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

Packit 4b6dd7
[allow-none]
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Returns

Packit 4b6dd7

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

Packit 4b6dd7

[transfer full]

Packit 4b6dd7
Packit 4b6dd7

Since: 0.4.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

gdata_documents_spreadsheet_get_download_uri ()

Packit 4b6dd7
gchar *
Packit 4b6dd7
gdata_documents_spreadsheet_get_download_uri
Packit 4b6dd7
                               (GDataDocumentsSpreadsheet *self,
Packit 4b6dd7
                                const gchar *export_format,
Packit 4b6dd7
                                gint gid);
Packit 4b6dd7

Builds and returns the download URI for the given GDataDocumentsSpreadsheet in the desired format. Note that directly downloading

Packit 4b6dd7
the document using this URI isn't possible, as authentication is required. You should instead use gdata_download_stream_new() with
Packit 4b6dd7
the URI, and use the resulting GInputStream.

Packit 4b6dd7

When requesting a "csv", "tsv", "pdf" or

Packit 4b6dd7
"html" file you may specify an additional parameter called gid which indicates which grid, or sheet, you wish to get
Packit 4b6dd7

(the index is 0-based, so GID 1 actually refers to the second sheet on a given

Packit 4b6dd7
spreadsheet).

Packit 4b6dd7
Packit 4b6dd7

Parameters

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

self

Packit 4b6dd7

a GDataDocumentsSpreadsheet

Packit 4b6dd7
 
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

export_format

Packit 4b6dd7

the format in which the spreadsheet should be exported when downloaded

Packit 4b6dd7
 
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

gid

Packit 4b6dd7

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

Packit 4b6dd7
 
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Returns

Packit 4b6dd7

the download URI; free with g_free()

Packit 4b6dd7
Packit 4b6dd7

Since: 0.5.0

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Types and Values

Packit 4b6dd7
Packit 4b6dd7

GDATA_DOCUMENTS_SPREADSHEET_CSV

Packit 4b6dd7
#define GDATA_DOCUMENTS_SPREADSHEET_CSV "csv"
Packit 4b6dd7
Packit 4b6dd7

The export format for Comma-Separated Values (CSV) format.

Packit 4b6dd7

For more information, see the

Packit 4b6dd7
Packit 4b6dd7
GData protocol specification.
Packit 4b6dd7

Since: 0.7.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

GDATA_DOCUMENTS_SPREADSHEET_HTML

Packit 4b6dd7
#define GDATA_DOCUMENTS_SPREADSHEET_HTML "html"
Packit 4b6dd7
Packit 4b6dd7

The export format for HyperText Markup Language (HTML) format.

Packit 4b6dd7

For more information, see the

Packit 4b6dd7
Packit 4b6dd7
GData protocol specification.
Packit 4b6dd7

Since: 0.7.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

GDATA_DOCUMENTS_SPREADSHEET_ODS

Packit 4b6dd7
#define GDATA_DOCUMENTS_SPREADSHEET_ODS "ods"
Packit 4b6dd7
Packit 4b6dd7

The export format for OpenDocument Spreadsheet (ODS) format.

Packit 4b6dd7

For more information, see the

Packit 4b6dd7
Packit 4b6dd7
GData protocol specification.
Packit 4b6dd7

Since: 0.7.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

GDATA_DOCUMENTS_SPREADSHEET_PDF

Packit 4b6dd7
#define GDATA_DOCUMENTS_SPREADSHEET_PDF "pdf"
Packit 4b6dd7
Packit 4b6dd7

The export format for Portable Document Format (PDF).

Packit 4b6dd7

For more information, see the

Packit 4b6dd7
Packit 4b6dd7
GData protocol specification.
Packit 4b6dd7

Since: 0.7.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

GDATA_DOCUMENTS_SPREADSHEET_TSV

Packit 4b6dd7
#define GDATA_DOCUMENTS_SPREADSHEET_TSV "tsv"
Packit 4b6dd7
Packit 4b6dd7

The export format for Tab-Separated Values (TSV) format.

Packit 4b6dd7

For more information, see the

Packit 4b6dd7
Packit 4b6dd7
GData protocol specification.
Packit 4b6dd7

Since: 0.7.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

GDATA_DOCUMENTS_SPREADSHEET_XLS

Packit 4b6dd7
#define GDATA_DOCUMENTS_SPREADSHEET_XLS "xls"
Packit 4b6dd7
Packit 4b6dd7

The export format for Microsoft Excel spreadsheet (XLS) format.

Packit 4b6dd7

For more information, see the

Packit 4b6dd7
Packit 4b6dd7
GData protocol specification.
Packit 4b6dd7

Since: 0.7.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

GDataDocumentsSpreadsheet

Packit 4b6dd7
typedef struct _GDataDocumentsSpreadsheet GDataDocumentsSpreadsheet;
Packit 4b6dd7

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

Packit 4b6dd7

Since: 0.4.0

Packit 4b6dd7
Packit 4b6dd7

Packit 4b6dd7
Packit 4b6dd7

GDataDocumentsSpreadsheetClass

Packit 4b6dd7
typedef struct {
Packit 4b6dd7
} GDataDocumentsSpreadsheetClass;
Packit 4b6dd7
Packit 4b6dd7

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

Packit 4b6dd7

Since: 0.4.0

Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7
Packit 4b6dd7

Generated by GTK-Doc V1.26.1
Packit 4b6dd7
</body>
Packit 4b6dd7
</html>