Top |
Object Hierarchy
GObject ╰── GDataParsable ╰── GDataEntry ╰── GDataDocumentsEntry ╰── GDataDocumentsFolder
Description
GDataDocumentsFolder is a subclass of GDataDocumentsEntry to represent a folder from Google Documents.
For more details of Google Drive's GData API, see the
online documentation.Example 36. Adding a Folder
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
GDataAuthorizationDomain *domain; GDataDocumentsService *service; GDataDocumentsFolder *folder, *new_folder, *parent_folder; GError *error = NULL; domain = gdata_documents_service_get_primary_authorization_domain (); /* Create a service */ service = create_documents_service (); parent_folder = GDATA_DOCUMENTS_FOLDER (gdata_service_query_single_entry (GDATA_SERVICE (service), domain, "root", NULL, GDATA_TYPE_DOCUMENTS_FOLDER, NULL, &error)); if (error != NULL) { g_error ("Error getting root folder"); g_error_free (error); return; } /* Create the new folder */ folder = gdata_documents_folder_new (NULL); gdata_entry_set_title (GDATA_ENTRY (folder), "Folder Name"); /* Insert the folder */ new_folder = GDATA_DOCUMENTS_FOLDER (gdata_documents_service_add_entry_to_folder (GDATA_SERVICE (service), GDATA_DOCUMENTS_ENTRY (folder), parent_folder, NULL, &error)); g_object_unref (folder); g_object_unref (parent_folder); g_object_unref (service); if (error != NULL) { g_error ("Error inserting new folder: %s", error->message); g_error_free (error); return; } /* Do something with the new folder, such as store its ID for future use */ g_object_unref (new_folder); |
Functions
gdata_documents_folder_new ()
GDataDocumentsFolder *
gdata_documents_folder_new (const gchar *id
);
Creates a new GDataDocumentsFolder with the given entry ID (“id”).
Since: 0.4.0
Types and Values
GDataDocumentsFolder
typedef struct _GDataDocumentsFolder GDataDocumentsFolder;
All the fields in the GDataDocumentsFolder structure are private and should never be accessed directly.
Since: 0.4.0
GDataDocumentsFolderClass
typedef struct { } GDataDocumentsFolderClass;
All the fields in the GDataDocumentsFolderClass structure are private and should never be accessed directly.
Since: 0.4.0