4 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __OAUTH1_SERVICE_H__
21 #define __OAUTH1_SERVICE_H__
24 #define API __attribute__ ((visibility("default")))
36 * @brief Describes infromation about oAuth1 Service
39 typedef struct _oauth1_s
44 typedef struct _oauth1_s *oauth1_h;
47 * @brief Callback for oauth1 API
49 * @param[in] access_token
50 * @param[in] user_data Passed data from #oauth1_get_access_token()
52 * @pre oauth1() will invoke this callback.
54 typedef void (*oauth1_cb)(int result, oauth1_h oauth1, void *user_data);
57 * @brief Describes infromation about oAuth 1.0 Service
58 * @key access token, ...
60 typedef struct _oauth1_service_s
62 int (*oauth1_get_access_token)(void *plugin, oauth1_cb callback, void *user_data);
63 int (*oauth1_get_extra_data)(void *plugin, const char *key, oauth1_cb callback, void *user_data);
65 typedef struct _oauth1_service_s *oauth1_service_h;
67 /*==================================================================================================
69 ==================================================================================================*/
72 * @brief Register oAuth 1.0 Service
75 * @param[in] oauth1 The oAuth 1.0 service handle
78 * @see oauth1_unregister_service()
79 * @return 0 on success, otherwise a negative error value
80 * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
81 * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
82 * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
84 int oauth1_register_service(oauth1_service_h oauth1, GHashTable *service);
87 * @brief Unregister oAuth 1.0 Service
90 * @param[in] oauth1 The oAuth 1.0 service handle
92 * @see oauth1_register_service()
93 * @return 0 on success, otherwise a negative error value
94 * @retval #SERVICE_ADAPTOR_ERROR_NONE Successful
95 * @retval #SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER Invalid parameter
96 * @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
98 int oauth1_unregister_service(oauth1_service_h oauth1);
104 #endif /* __OAUTH1_SERVICE_H__ */