![]() |
![]() |
![]() |
GData Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <gdata/services/documents/gdata-documents-service.h> GDataDocumentsService; GDataDocumentsServiceClass; enum GDataDocumentsServiceError; GDataDocumentsService * gdata_documents_service_new (const gchar *client_id
); GDataDocumentsFeed * gdata_documents_service_query_documents (GDataDocumentsService *self
,GDataDocumentsQuery *query
,GCancellable *cancellable
,GDataQueryProgressCallback progress_callback
,gpointer progress_user_data
,GError **error
); void gdata_documents_service_query_documents_async (GDataDocumentsService *self
,GDataDocumentsQuery *query
,GCancellable *cancellable
,GDataQueryProgressCallback progress_callback
,gpointer progress_user_data
,GAsyncReadyCallback callback
,gpointer user_data
); GDataDocumentsEntry * gdata_documents_service_query_single_document (GDataDocumentsService *self
,GType document_type
,const gchar *document_id
,GCancellable *cancellable
,GError **error
); GDataDocumentsEntry * gdata_documents_service_upload_document (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GFile *document_file
,GDataDocumentsFolder *folder
,GCancellable *cancellable
,GError **error
); GDataDocumentsEntry * gdata_documents_service_update_document (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GFile *document_file
,GCancellable *cancellable
,GError **error
); GDataDocumentsEntry * gdata_documents_service_move_document_to_folder (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GDataDocumentsFolder *folder
,GCancellable *cancellable
,GError **error
); GDataDocumentsEntry * gdata_documents_service_remove_document_from_folder (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GDataDocumentsFolder *folder
,GCancellable *cancellable
,GError **error
); gchar * gdata_documents_service_get_upload_uri (GDataDocumentsFolder *folder
);
GDataDocumentsService is a subclass of GDataService for communicating with the GData API of Google Documents. It supports querying for, inserting, editing and deleting documents, as well as a folder hierarchy.
For more details of Google Documents' GData API, see the online documentation.
Fore more details about the spreadsheet downloads handling, see the online explanation about the problem.
typedef struct _GDataDocumentsService GDataDocumentsService;
All the fields in the GDataDocumentsService structure are private and should never be accessed directly.
Since 0.4.0
typedef struct { } GDataDocumentsServiceClass;
All the fields in the GDataDocumentsServiceClass structure are private and should never be accessed directly.
Since 0.4.0
typedef enum { GDATA_DOCUMENTS_SERVICE_ERROR_INVALID_CONTENT_TYPE } GDataDocumentsServiceError;
Error codes for GDataDocumentsService operations.
Since 0.4.0
GDataDocumentsService * gdata_documents_service_new (const gchar *client_id
);
Creates a new GDataDocumentsService. The client_id
must be unique for your application, and as registered with Google.
|
your application's client ID |
Returns : |
a new GDataDocumentsService, or NULL ; unref with g_object_unref()
|
Since 0.4.0
GDataDocumentsFeed * gdata_documents_service_query_documents (GDataDocumentsService *self
,GDataDocumentsQuery *query
,GCancellable *cancellable
,GDataQueryProgressCallback progress_callback
,gpointer progress_user_data
,GError **error
);
Queries the service to return a list of documents matching the given query
.
For more details, see gdata_service_query()
.
|
a GDataDocumentsService |
|
a GDataDocumentsQuery with the query parameters, or NULL . [allow-none]
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL . [scope call]
|
|
data to pass to the progress_callback function. [closure]
|
|
a GError, or NULL
|
Returns : |
a GDataDocumentsFeed of query results; unref with g_object_unref() . [transfer full]
|
Since 0.4.0
void gdata_documents_service_query_documents_async (GDataDocumentsService *self
,GDataDocumentsQuery *query
,GCancellable *cancellable
,GDataQueryProgressCallback progress_callback
,gpointer progress_user_data
,GAsyncReadyCallback callback
,gpointer user_data
);
Queries the service to return a list of documents matching the given query
. self
and
query
are both reffed when this function is called, so can safely be unreffed after this function returns.
For more details, see gdata_documents_service_query_documents()
, which is the synchronous version of this function,
and gdata_service_query_async()
, which is the base asynchronous query function.
|
a GDataDocumentsService |
|
a GDataDocumentsQuery with the query parameters, or NULL . [allow-none]
|
|
optional GCancellable object, or NULL
|
|
a GDataQueryProgressCallback to call when an entry is loaded, or NULL
|
|
data to pass to the progress_callback function
|
|
a GAsyncReadyCallback to call when authentication is finished |
|
data to pass to the callback function. [closure]
|
Since 0.4.0
GDataDocumentsEntry * gdata_documents_service_query_single_document (GDataDocumentsService *self
,GType document_type
,const gchar *document_id
,GCancellable *cancellable
,GError **error
);
Retrieves information about a single document with the given document ID.
document_type
should be the expected type of the document to be returned. e.g. GDATA_TYPE_DOCUMENTS_SPREADSHEET
if you're querying
for a spreadsheet.
document_id
should be the ID of the document as returned by gdata_documents_entry_get_document_id()
.
Parameters and errors are as for gdata_service_query()
.
|
a GDataDocumentsService |
|
the expected GType of the queried entry |
|
the document ID of the queried document |
|
a GCancellable, or NULL
|
|
a GError, or NULL
|
Returns : |
a GDataDocumentsEntry, or NULL ; unref with g_object_unref() . [transfer full]
|
Since 0.5.0
GDataDocumentsEntry * gdata_documents_service_upload_document (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GFile *document_file
,GDataDocumentsFolder *folder
,GCancellable *cancellable
,GError **error
);
Uploads a document to Google Documents, using the properties from document
and the document file pointed to by document_file
.
If document
is NULL
, only the document file will be uploaded. The new document entry will be named after the document file's name,
and will have default metadata.
If document_file
is NULL
, only the document metadata will be uploaded. A blank document file will be created with the name
new document
and the specified metadata. document
and document_file
cannot both be NULL
, but can both have values.
The updated document_entry
will be returned on success, containing updated metadata.
If there is a problem reading document_file
, an error from g_file_load_contents()
or g_file_query_info()
will be returned. Other errors from
GDataServiceError can be returned for other exceptional conditions, as determined by the server.
|
an authenticated GDataDocumentsService |
|
the GDataDocumentsEntry to insert, or NULL . [allow-none]
|
|
the document to upload, or NULL . [allow-none]
|
|
the folder to which the document should be uploaded, or NULL . [allow-none]
|
|
optional GCancellable object, or NULL
|
|
a GError, or NULL
|
Returns : |
an updated GDataDocumentsEntry, or NULL ; unref with g_object_unref() . [transfer full]
|
Since 0.4.0
GDataDocumentsEntry * gdata_documents_service_update_document (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GFile *document_file
,GCancellable *cancellable
,GError **error
);
Update the document using the properties from document
and the document file pointed to by document_file
. If the document file does not
need to be changed, document_file
can be NULL
.
If there is a problem reading document_file
, an error from g_file_load_contents()
or g_file_query_info()
will be returned. Other errors from
GDataServiceError can be returned for other exceptional conditions, as determined by the server.
For more details, see gdata_service_insert_entry()
.
|
a GDataDocumentsService |
|
the GDataDocumentsEntry to update |
|
the local document file containing the new data, or NULL . [allow-none]
|
|
optional GCancellable object, or NULL
|
|
a GError, or NULL
|
Returns : |
an updated GDataDocumentsEntry, or NULL ; unref with g_object_unref() . [transfer full]
|
Since 0.4.0
GDataDocumentsEntry * gdata_documents_service_move_document_to_folder (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GDataDocumentsFolder *folder
,GCancellable *cancellable
,GError **error
);
Move the given document
to the specified folder
. If the document is already in another folder, it will be added to
the new folder, but will also remain in any previous folders.
Errors from GDataServiceError can be returned for other exceptional conditions, as determined by the server.
|
an authenticated GDataDocumentsService |
|
the GDataDocumentsEntry to move |
|
the GDataDocumentsFolder to move document into
|
|
optional GCancellable object, or NULL
|
|
a GError, or NULL
|
Returns : |
an updated GDataDocumentsEntry, or NULL ; unref with g_object_unref() . [transfer full]
|
Since 0.4.0
GDataDocumentsEntry * gdata_documents_service_remove_document_from_folder (GDataDocumentsService *self
,GDataDocumentsEntry *document
,GDataDocumentsFolder *folder
,GCancellable *cancellable
,GError **error
);
Remove the GDataDocumentsEntry document
from the GDataDocumentsFolder folder
, and updates the document entry document
.
Errors from GDataServiceError can be returned for other exceptional conditions, as determined by the server.
|
a GDataDocumentsService |
|
the GDataDocumentsEntry to remove |
|
the GDataDocumentsFolder from which we should remove document
|
|
optional GCancellable object, or NULL
|
|
a GError, or NULL
|
Returns : |
an updated GDataDocumentsEntry, or NULL ; unref with g_object_unref() . [transfer full]
|
Since 0.4.0
gchar * gdata_documents_service_get_upload_uri
(GDataDocumentsFolder *folder
);
Gets the upload URI for documents for the service.
If folder
is NULL
, the URI will be the one to upload documents to the "root" folder.
|
the GDataDocumentsFolder into which to upload the document, or NULL . [allow-none]
|
Returns : |
the URI permitting the upload of documents to folder , or NULL ; free with g_free()
|
Since 0.5.0
"spreadsheet-service"
property"spreadsheet-service" GDataService* : Read
Another service for spreadsheets.