GDataDocumentsText

## GDataDocumentsText GDataDocumentsText — GData Documents text object |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <gdata/services/documents/gdata-documents-text.h>

                        GDataDocumentsText;
                        GDataDocumentsTextClass;
    enum                GDataDocumentsTextFormat;
    GDataDocumentsText * gdata_documents_text_new           (const gchar *id);
    GFile *             gdata_documents_text_download_document
                                                            (GDataDocumentsText *self,
                                                             GDataDocumentsService *service,
                                                             gchar **content_type,
                                                             GDataDocumentsTextFormat export_format,
                                                             GFile *destination_directory,
                                                             gboolean replace_file_if_exists,
                                                             GCancellable *cancellable,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----GDataParsable
             +----GDataEntry
                   +----GDataDocumentsEntry
                         +----GDataDocumentsText

## Implemented Interfaces

GDataDocumentsText implements GDataAccessHandler.

## Description

GDataDocumentsText is a subclass of GDataDocumentsEntry to represent a text document from Google Documents.

For more details of Google Documents' GData API, see the online documentation.

## Details

### GDataDocumentsText

    typedef struct _GDataDocumentsText GDataDocumentsText;

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

Since 0.4.0

### GDataDocumentsTextClass

    typedef struct {
    } GDataDocumentsTextClass;

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

Since 0.4.0

### enum GDataDocumentsTextFormat

    typedef enum {
    	GDATA_DOCUMENTS_TEXT_DOC = 0,
    	GDATA_DOCUMENTS_TEXT_HTML,
    	GDATA_DOCUMENTS_TEXT_ODT,
    	GDATA_DOCUMENTS_TEXT_PDF,
    	GDATA_DOCUMENTS_TEXT_PNG,
    	GDATA_DOCUMENTS_TEXT_RTF,
    	GDATA_DOCUMENTS_TEXT_TXT,
    	GDATA_DOCUMENTS_TEXT_ZIP,
    } GDataDocumentsTextFormat;

The different available download formats for text documents.

`GDATA_DOCUMENTS_TEXT_DOC` | Microsoft Word (DOC) format
`GDATA_DOCUMENTS_TEXT_HTML` | HyperText Markup Language (HTML) format
`GDATA_DOCUMENTS_TEXT_ODT` | OpenDocument Text (ODT) format
`GDATA_DOCUMENTS_TEXT_PDF` | Portable Document Format (PDF)
`GDATA_DOCUMENTS_TEXT_PNG` | Portable Network Graphics (PNG) image format
`GDATA_DOCUMENTS_TEXT_RTF` | Rich Text Format (RTF)
`GDATA_DOCUMENTS_TEXT_TXT` | plain text format
`GDATA_DOCUMENTS_TEXT_ZIP` | ZIP archive containing images and exported HTML

Since 0.4.0

### gdata_documents_text_new ()

    GDataDocumentsText * gdata_documents_text_new           (const gchar *id);

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

`id` : | the entry's ID (not the document ID of the text document), or `NULL`
Returns : | a new GDataDocumentsText, or `NULL`; unref with `g_object_unref()`

Since 0.4.0

### gdata_documents_text_download_document ()

    GFile *             gdata_documents_text_download_document
                                                            (GDataDocumentsText *self,
                                                             GDataDocumentsService *service,
                                                             gchar **content_type,
                                                             GDataDocumentsTextFormat export_format,
                                                             GFile *destination_directory,
                                                             gboolean replace_file_if_exists,
                                                             GCancellable *cancellable,
                                                             GError **error);

Downloads and returns the text document file represented by the GDataDocumentsText. 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.

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

`self` : | a GDataDocumentsText
`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 text document should be exported
`destination_directory` : | the directory into which the text document 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