| Top |
ZpjSkydrive represents the
Skydrive file hosting service. It has to be used with animplementation of ZpjAuthorizer.
Currently it supports the following operations:
Deleting a file, folder or photo.
Listing the contents of a folder.
Reading the properties of a file, folder or photo.
Uploading files and photos.
ZpjSkydrive *
zpj_skydrive_new (ZpjAuthorizer *authorizer);
Creates a new ZpjSkydrive using the given authorizer
.
gboolean zpj_skydrive_create_folder (ZpjSkydrive *self,ZpjSkydriveFolder *folder,GCancellable *cancellable,GError **error);
gboolean zpj_skydrive_create_folder_from_name (ZpjSkydrive *self,const gchar *name,const gchar *parent_id,GCancellable *cancellable,GError **error);
gboolean zpj_skydrive_delete_entry_id (ZpjSkydrive *self,const gchar *entry_id,GCancellable *cancellable,GError **error);
Synchronously deletes the entry corresponding to entry_id
from
self |
A ZpjSkydrive. |
|
entry_id |
The ID of the ZpjSkydriveEntry to be deleted. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
GInputStream * zpj_skydrive_download_file_id_to_stream (ZpjSkydrive *self,const gchar *file_id,GCancellable *cancellable,GError **error);
Synchronously returns a stream for downloading the file
corresponding to file_id
from
zpj_skydrive_download_file_id_to_stream_async() for the asynchronous version of this call.
self |
A ZpjSkydrive. |
|
file_id |
The ID of the ZpjSkydriveFile to be downloaded. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
A GInputStream to read the file data
from. Free the returned object with g_object_unref().
[transfer full]
void zpj_skydrive_download_file_id_to_stream_async (ZpjSkydrive *self,const gchar *file_id,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously returns a stream for downloading the file
corresponding to file_id
from
zpj_skydrive_download_file_id_to_stream() for
the synchronous version of this call.
When the operation is finished, callback
will be called. You can
then call zpj_skydrive_download_file_id_to_stream_finish() to get
the result of the operation.
self |
A ZpjSkydrive. |
|
file_id |
The ID of the ZpjSkydriveFile to be downloaded. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
The data to pass to |
[closure] |
GInputStream * zpj_skydrive_download_file_id_to_stream_finish (ZpjSkydrive *self,GAsyncResult *res,GError **error);
Finishes an asynchronous operation started with
zpj_skydrive_download_file_id_to_stream_async().
A GInputStream to read the file data
from. Free the returned object with g_object_unref().
[transfer full]
GInputStream * zpj_skydrive_download_file_to_stream (ZpjSkydrive *self,ZpjSkydriveFile *file,GCancellable *cancellable,GError **error);
Synchronously returns a stream for downloading file
from
zpj_skydrive_download_file_to_stream_async()for the asynchronous version of this call.
self |
A ZpjSkydrive. |
|
file |
The ZpjSkydriveFile to be downloaded. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
A GInputStream to read the file data
from. Free the returned object with g_object_unref().
[transfer full]
void zpj_skydrive_download_file_to_stream_async (ZpjSkydrive *self,ZpjSkydriveFile *file,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously returns a stream for downloading file
from
zpj_skydrive_download_file_to_stream() for the
synchronous version of this call.
When the operation is finished, callback
will be called. You can
then call zpj_skydrive_download_file_to_stream_finish() to get the
result of the operation.
self |
A ZpjSkydrive. |
|
file |
The ZpjSkydriveFile to be downloaded. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
The data to pass to |
[closure] |
GInputStream * zpj_skydrive_download_file_to_stream_finish (ZpjSkydrive *self,GAsyncResult *res,GError **error);
Finishes an asynchronous operation started with
zpj_skydrive_download_file_to_stream_async().
A GInputStream to read the file data
from. Free the returned object with g_object_unref().
[transfer full]
gboolean zpj_skydrive_download_file_id_to_path (ZpjSkydrive *self,const gchar *file_id,const gchar *path,GCancellable *cancellable,GError **error);
Synchronously downloads the file corresponding to file_id
from
path. The file is temporarily
saved in the preferred directory for temporary files (as returned
by g_get_tmp_dir()) while the download is going on, and then moved
to path
.
self |
A ZpjSkydrive. |
|
file_id |
The ID of the ZpjSkydriveFile to be downloaded. |
|
path |
The destination. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
gboolean zpj_skydrive_download_file_to_path (ZpjSkydrive *self,ZpjSkydriveFile *file,const gchar *path,GCancellable *cancellable,GError **error);
Synchronously downloads file
from
path. The file is temporarily
saved in the preferred directory for temporary files (as returned
by g_get_tmp_dir()) while the download is going on, and then moved
to path
.
self |
A ZpjSkydrive. |
|
file |
The ZpjSkydriveFile to be downloaded. |
|
path |
The destination. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
GList * zpj_skydrive_list_folder (ZpjSkydrive *self,ZpjSkydriveFolder *folder,GCancellable *cancellable,GError **error);
Synchronously lists the contents of folder_id
from
self |
A ZpjSkydrive. |
|
folder |
The ZpjSkydriveFolder to be listed. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
A
list of the ZpjSkydrive entries within the ZpjSkydriveFolder.
Free the returned list with g_list_free() after each element has
been freed with g_object_unref().
[transfer full][element-type ZpjSkydriveEntry]
GList * zpj_skydrive_list_folder_id (ZpjSkydrive *self,const gchar *folder_id,GCancellable *cancellable,GError **error);
Synchronously lists the contents of the folder corresponding to
folder_id
from
self |
A ZpjSkydrive. |
|
folder_id |
The ID of the ZpjSkydriveFolder to be listed. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
A
list of the ZpjSkydrive entries within the ZpjSkydriveFolder, or
NULL on error. Free the returned list with g_list_free() after
each element has been freed with g_object_unref().
[transfer full][element-type ZpjSkydriveEntry]
void zpj_skydrive_list_folder_id_async (ZpjSkydrive *self,const gchar *folder_id,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously lists the contents of the folder corresponding to
folder_id
from
zpj_skydrive_list_folder_id() for the
synchronous version of this call.
When the operation is finished, callback
will be called. You can
then call zpj_skydrive_list_folder_id_finish() to get the result
of the operation.
self |
A ZpjSkydrive. |
|
folder_id |
The ID of the ZpjSkydriveFolder to be listed. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
The data to pass to |
[closure] |
GList * zpj_skydrive_list_folder_id_finish (ZpjSkydrive *self,GAsyncResult *res,GError **error);
Finishes an asynchronous operation started with
zpj_skydrive_list_folder_id_async().
A
list of the ZpjSkydrive entries within the ZpjSkydriveFolder, or
NULL on error. Free the returned list with g_list_free() after
each element has been freed with g_object_unref().
[transfer full][element-type ZpjSkydriveEntry]
ZpjAuthorizer *
zpj_skydrive_get_authorizer (ZpjSkydrive *self);
Gets the authorizer used to authorize requests to self
.
A ZpjAuthorizer. The returned object is owned by ZpjSkydrive and should not be modified or freed.
[transfer none]
ZpjSkydriveEntry * zpj_skydrive_query_info_from_id (ZpjSkydrive *self,const gchar *id,GCancellable *cancellable,GError **error);
Synchronously reads the properties of the entry corresponding to
id
from
zpj_skydrive_query_info_from_id_async() for
the asynchronous version of this call.
self |
A ZpjSkydrive. |
|
id |
An ID to be queried. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
void zpj_skydrive_query_info_from_id_async (ZpjSkydrive *self,const gchar *id,GCancellable *cancellable,GAsyncReadyCallback callback,gpointer user_data);
Asynchronously reads the properties of the entry corresponding to
id
from
zpj_skydrive_query_info_from_id() for the
synchronous version of this call.
When the operation is finished, callback
will be called. You can
then call zpj_skydrive_query_info_from_id_finish() to get the result
of the operation.
self |
A ZpjSkydrive. |
|
id |
The ID to be queried. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
callback |
A GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
The data to pass to |
[closure] |
ZpjSkydriveEntry * zpj_skydrive_query_info_from_id_finish (ZpjSkydrive *self,GAsyncResult *res,GError **error);
Finishes an asynchronous operation started with
zpj_skydrive_query_info_from_id_async().
void zpj_skydrive_set_authorizer (ZpjSkydrive *self,ZpjAuthorizer *authorizer);
Uses the new authorizer
to replace the old one that was used to
authorize requests to self
.
GInputStream * zpj_skydrive_thumbnail_file_id_to_stream (ZpjSkydrive *self,const gchar *file_id,ZpjThumbnailSize size,GCancellable *cancellable,GError **error);
Synchronously returns a stream for downloading the thumbnail of the
file corresponding to file_id
from
zpj_skydrive_thumbnail_file_id_to_stream_async() for the asynchronous version of this call.
Thumbnails are only available for ZpjSkydrivePhoto and
ZpjSkydriveVideo objects. If file_id
refers to some other kind of
ZpjSkydriveFile, the error ZPJ_ERROR_REQUEST_URL_INVALID will be
returned.
self |
A ZpjSkydrive. |
|
file_id |
The ID of the ZpjSkydriveFile to be thumbnailed. |
|
size |
The thumbnail size. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
A GInputStream to read the thumbnail
data from. Free the returned object with g_object_unref().
[transfer full]
gboolean zpj_skydrive_upload_path_to_folder (ZpjSkydrive *self,const gchar *path,ZpjSkydriveFolder *folder,GCancellable *cancellable,GError **error);
Synchronously uploads the file at path
to
folder.
self |
A ZpjSkydrive. |
|
path |
The source. |
|
folder |
The destination ZpjSkydriveFolder. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
gboolean zpj_skydrive_upload_path_to_folder_id (ZpjSkydrive *self,const gchar *path,const gchar *folder_id,GCancellable *cancellable,GError **error);
Synchronously uploads the file at path
to
folder_id
.
self |
A ZpjSkydrive. |
|
path |
The source. |
|
folder_id |
The ID of the destination ZpjSkydriveFolder. |
|
cancellable |
An optional GCancellable object, or
|
[allow-none] |
error |
[allow-none] |
Different
thumbnail sizes offered by SkyDrive.This enumeration can be expanded at a later date.
struct ZpjSkydrive;
The ZpjSkydrive structure contains only private data and should only be accessed using the provided API.
struct ZpjSkydriveClass {
GObjectClass parent_class;
};
Class structure for ZpjSkydrive.
“authorizer” property“authorizer” ZpjAuthorizer *
An authorizer object to provide an access token for each request.
Flags: Read / Write / Construct