v0.2.2 release
[yandexfotkisp] / src / common.h
1 /*
2  * This file is part of sharing-plugin-template
3  *
4  * Copyright (C) 2008-2009 Nokia Corporation. All rights reserved.
5  *
6  * This maemo code example is licensed under a MIT-style license,
7  * that can be found in the file called "COPYING" in the root
8  * directory.
9  *
10  */
11
12 #ifndef _COMMON_H_
13 #define _COMMON_H_
14
15 #include "libsharing/sharing-entry.h"
16 #include "libsharing/sharing-transfer.h"
17 #include <glib.h>
18
19 #define PLUGIN_USER_AGENT "Maemo.5 Yandex.Fotki sharing plugin/0.2.1 (Hitosu<hub@hito.su>)"
20 #define PUB_CHANNEL "Maemo Sharing Plugin by Hito.su"
21 #define APP_PLATFORM "Maemo"
22 #define APP_VERSION "0.2.1"
23
24 G_BEGIN_DECLS
25
26         typedef enum {
27                 YANDEX_GET_SESSION_KEY_SUCCESS = 0,
28                 YANDEX_GET_SESSION_KEY_FAILED = 1,
29         } yandexGetSessionKeyResult;
30         yandexGetSessionKeyResult yandexGetSessionKey(char** key, char** request_id);
31
32         typedef enum {
33                 YANDEX_GET_AUTH_TOKEN_SUCCESS = 0,
34                 YANDEX_GET_AUTH_TOKEN_FAILED = 1,
35                 YANDEX_GET_AUTH_TOKEN_INVALID_USER = 2
36         } yandexGetAuthTokenResult;
37         yandexGetAuthTokenResult yandexGetAuthToken(const char* request_id, const char* key, const char* username, const char* password, char** token);
38
39         typedef enum {
40                 YANDEX_SEND_PHOTO_SUCCESS = 0,
41                 YANDEX_SEND_PHOTO_FAILED = 1,
42                 YANDEX_SEND_PHOTO_FILE_NOT_FOUND = 2,
43                 YANDEX_SEND_PHOTO_FILE_INVALID_TOKEN = 3
44         } yandexSendPhotoResult;
45         typedef enum {
46                 YANDEX_PHOTO_ACCESS_PUBLIC = 0,
47                 YANDEX_PHOTO_ACCESS_FRIENDS = 1,
48                 YANDEX_PHOTO_ACCESS_PRIVATE = 2
49         } yandexPhotoAccessType;
50         typedef enum {
51                 YANDEX_PHOTO_PUBLISH = 0,
52                 YANDEX_PHOTO_DONT_PUBLISH = 1
53         } yandexPhotoPublishSettings;
54         typedef struct {
55                 const char* album;
56                 yandexPhotoAccessType access;
57                 yandexPhotoPublishSettings publish;
58         } yandexPhotoOptions;
59         yandexSendPhotoResult yandexSendPhoto(const char* token, const SharingEntryMedia* photo, SharingTransfer* transfer, yandexPhotoOptions options);
60
61         typedef enum {
62                 YANDEX_GET_ALBUM_LIST_SUCCESS = 0,
63                 YANDEX_GET_ALBUM_LIST_FAILED = 1,
64                 YANDEX_GET_ALBUM_LIST_INVALID_TOKEN = 2
65         } yandexGetAlbumsListResult;
66         yandexGetAlbumsListResult yandexGetAlbumsList(const char* token, const char* username, GSList** albumOptionValues);
67
68 G_END_DECLS
69
70 #endif // _COMMON_H_
71