| 1 |
/* |
| 2 |
* librest - RESTful web services access |
| 3 |
* Copyright (c) 2010 Intel Corporation. |
| 4 |
* |
| 5 |
* Authors: Rob Bradford <[email protected]> |
| 6 |
* Ross Burton <[email protected]> |
| 7 |
* |
| 8 |
* This program is free software; you can redistribute it and/or modify it |
| 9 |
* under the terms and conditions of the GNU Lesser General Public License, |
| 10 |
* version 2.1, as published by the Free Software Foundation. |
| 11 |
* |
| 12 |
* This program is distributed in the hope it will be useful, but WITHOUT ANY |
| 13 |
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 14 |
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for |
| 15 |
* more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Lesser General Public License |
| 18 |
* along with this program; if not, write to the Free Software Foundation, |
| 19 |
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
#pragma once |
| 24 |
|
| 25 |
#include <rest/rest-proxy.h> |
| 26 |
#include <rest/rest-xml-parser.h> |
| 27 |
|
| 28 |
G_BEGIN_DECLS |
| 29 |
|
| 30 |
#define LASTFM_TYPE_PROXY lastfm_proxy_get_type() |
| 31 |
|
| 32 |
G_DECLARE_DERIVABLE_TYPE (LastfmProxy, lastfm_proxy, LASTFM, PROXY, RestProxy) |
| 33 |
|
| 34 |
struct _LastfmProxyClass { |
| 35 |
RestProxyClass parent_class; |
| 36 |
|
| 37 |
/*< private >*/ |
| 38 |
/* padding for future expansion */ |
| 39 |
gpointer _padding_dummy[8]; |
| 40 |
}; |
| 41 |
|
| 42 |
#define LASTFM_PROXY_ERROR lastfm_proxy_error_quark() |
| 43 |
|
| 44 |
RestProxy *lastfm_proxy_new (const char *api_key, |
| 45 |
const char *secret); |
| 46 |
RestProxy *lastfm_proxy_new_with_session (const char *api_key, |
| 47 |
const char *secret, |
| 48 |
const char *session_key); |
| 49 |
const char *lastfm_proxy_get_api_key (LastfmProxy *proxy); |
| 50 |
const char *lastfm_proxy_get_secret (LastfmProxy *proxy); |
| 51 |
const char *lastfm_proxy_get_session_key (LastfmProxy *proxy); |
| 52 |
void lastfm_proxy_set_session_key (LastfmProxy *proxy, |
| 53 |
const char *session_key); |
| 54 |
char *lastfm_proxy_sign (LastfmProxy *proxy, |
| 55 |
GHashTable *params); |
| 56 |
char *lastfm_proxy_build_login_url (LastfmProxy *proxy, |
| 57 |
const char *token); |
| 58 |
gboolean lastfm_proxy_is_successful (RestXmlNode *root, |
| 59 |
GError **error); |
| 60 |
|
| 61 |
G_END_DECLS |