Initialize Tizen 2.3
[framework/telephony/libslp-tapi.git] / wearable / include / tapi_common.h
1 /*
2  * libslp-tapi
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef _TAPI_COMMON_H_
22 #define _TAPI_COMMON_H_
23
24 /**
25 *  @addtogroup TAPI_COMMON
26 *  @{
27 *
28 *  @file tapi_common.h
29 *  @brief TAPI Common Interface
30 */
31
32 #include <stdio.h>
33 #include <glib.h>
34
35 #include <tapi_type.h>
36 #include <tapi_event.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 /**
43  *  @brief Fetches the list of available CPs
44  *
45  *  @par Sync (or) Async:
46  *  Synchronous API
47  *
48  *  @param[out] None.
49  *
50  *  @return #List of available CPs on SUCCESS and NULL on FAILURE.
51  */
52 char** tel_get_cp_name_list(void);
53
54 /**
55  *  @brief Acquires a TAPI Handle for specified CP name
56  *
57  *  @par Sync (or) Async:
58  *  Synchronous API
59  *
60  *  @param[in] cp_name CP Name against which TAPI handle is required \n
61  *  NULL CP Name will return TapiHandle bound to the first CP in the list of available CPs
62  *
63  *  @return #TapiHandle on SUCCESS and NULL on FAILURE.
64  */
65 TapiHandle* tel_init(const char *cp_name);
66
67 /**
68  *  @brief De-initializes the TAPI Handle
69  *
70  *  @par Sync (or) Async:
71  *  Synchronous API
72  *
73  *  @param[in] handle #TapiHandle obtained from tel_init()
74  *
75  *  @return #TapiResult_t
76  */
77 int tel_deinit(TapiHandle *handle);
78
79 /**
80  *  @brief Registers Notification CallBack for events on DBus interface
81  *
82  *  @par Sync (or) Async:
83  *  Synchronous API
84  *
85  *  @param[in] handle #TapiHandle obtained from tel_init()
86  *
87  *  @param[in] noti_id Notification Id for which callback has to be registered
88  *
89  *  @param[in] callback #tapi_notification_cb Notification callback which will be invoked on event
90  *
91  * @param user_data User Data
92  *
93  *  @return #TapiResult_t
94  */
95 int tel_register_noti_event(TapiHandle *handle, const char *noti_id,
96                         tapi_notification_cb callback, void *user_data);
97
98 /**
99  *  @brief De-Registers Notification CallBack for events on DBus interface
100  *
101  *  @par Sync (or) Async:
102  *  Synchronous API
103  *
104  *  @param[in] handle #TapiHandle obtained from tel_init()
105  *
106  *  @param[in] noti_id Notification Id for which callback has to be de-registered
107  *
108  *  @return #TapiResult_t
109  */
110  int tel_deregister_noti_event(TapiHandle *handle, const char *noti_id);
111
112 /**
113  *  @brief Gets  the property value in integer format for given property
114  *
115  *  @par Sync (or) Async:
116  *  Synchronous API
117  *
118  *  @param[in] handle #TapiHandle obtained from tel_init()
119  *
120  *  @param[in] property Property which is to be retrieved from Dbus
121  *
122  *  @param[out] result Property value in integer format
123  *
124  *  @return #TapiResult_t
125  */
126 int tel_get_property_int(TapiHandle *handle, const char *property, int *result);
127
128 /**
129  *  @brief Gets  the property value in string format for given property
130  *
131  *  @par Sync (or) Async:
132  *  Synchronous API
133  *
134  *  @param[in] handle #TapiHandle obtained from tel_init()
135  *
136  *  @param[in] property Property which is to be retrieved from Dbus
137  *
138  *  @param[out] result Property value in string format
139  *
140  *  @return #TapiResult_t
141  */
142 int tel_get_property_string(TapiHandle *handle, const char *property, char **result);
143
144 #ifdef __cplusplus
145 }
146 #endif
147
148 /** @}*/
149
150 #endif /* _TAPI_COMMON_H_ */
151