| 1 |
/* |
| 2 |
* librest - RESTful web services access |
| 3 |
* Copyright (c) 2008, 2009, Intel Corporation. |
| 4 |
* |
| 5 |
* Authors: Rob Bradford <[email protected]> |
| 6 |
* Ross Burton <[email protected]> |
| 7 |
* Günther Wagner <[email protected]> |
| 8 |
* |
| 9 |
* This program is free software; you can redistribute it and/or modify it |
| 10 |
* under the terms and conditions of the GNU Lesser General Public License, |
| 11 |
* version 2.1, as published by the Free Software Foundation. |
| 12 |
* |
| 13 |
* This program is distributed in the hope it will be useful, but WITHOUT ANY |
| 14 |
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 15 |
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for |
| 16 |
* more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU Lesser General Public License |
| 19 |
* along with this program; if not, write to the Free Software Foundation, |
| 20 |
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
| 21 |
* |
| 22 |
*/ |
| 23 |
|
| 24 |
#pragma once |
| 25 |
|
| 26 |
#include <rest/rest-proxy.h> |
| 27 |
#include <rest/rest-xml-parser.h> |
| 28 |
|
| 29 |
G_BEGIN_DECLS |
| 30 |
|
| 31 |
#define FLICKR_PROXY_ERROR flickr_proxy_error_quark() |
| 32 |
#define FLICKR_TYPE_PROXY flickr_proxy_get_type() |
| 33 |
|
| 34 |
G_DECLARE_DERIVABLE_TYPE (FlickrProxy, flickr_proxy, FLICKR, PROXY, RestProxy) |
| 35 |
|
| 36 |
struct _FlickrProxyClass { |
| 37 |
RestProxyClass parent_class; |
| 38 |
|
| 39 |
/*< private >*/ |
| 40 |
/* padding for future expansion */ |
| 41 |
gpointer _padding_dummy[8]; |
| 42 |
}; |
| 43 |
|
| 44 |
|
| 45 |
RestProxy *flickr_proxy_new (const char *api_key, |
| 46 |
const char *shared_secret); |
| 47 |
RestProxy *flickr_proxy_new_with_token (const char *api_key, |
| 48 |
const char *shared_secret, |
| 49 |
const char *token); |
| 50 |
const char *flickr_proxy_get_api_key (FlickrProxy *proxy); |
| 51 |
const char *flickr_proxy_get_shared_secret (FlickrProxy *proxy); |
| 52 |
const char *flickr_proxy_get_token (FlickrProxy *proxy); |
| 53 |
void flickr_proxy_set_token (FlickrProxy *proxy, |
| 54 |
const char *token); |
| 55 |
char *flickr_proxy_sign (FlickrProxy *proxy, |
| 56 |
GHashTable *params); |
| 57 |
char *flickr_proxy_build_login_url (FlickrProxy *proxy, |
| 58 |
const char *frob, |
| 59 |
const char *perms); |
| 60 |
gboolean flickr_proxy_is_successful (RestXmlNode *root, |
| 61 |
GError **error); |
| 62 |
RestProxyCall *flickr_proxy_new_upload (FlickrProxy *proxy); |
| 63 |
RestProxyCall *flickr_proxy_new_upload_for_file (FlickrProxy *proxy, |
| 64 |
const char *filename, |
| 65 |
GError **error); |
| 66 |
|
| 67 |
G_END_DECLS |