tizen 2.3 release
[framework/telephony/libslp-tapi.git] / include / ITapiNetwork.h
1 /*
2  * libslp-tapi
3  *
4  * Copyright (c) 2014 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 /**
22  * @file ITapiNetwork.h
23  */
24
25 /**
26  * @internal
27  * @addtogroup CAPI_TELEPHONY_SERVICE_NETWORK
28  * @{
29  */
30
31 #ifndef _ITAPI_NETWORK_H_
32 #define _ITAPI_NETWORK_H_
33
34 #include <tapi_common.h>
35 #include <TelNetwork.h>
36
37 #ifdef __cplusplus
38 extern "C"
39 {
40 #endif
41
42 /**
43  * @brief Requests the lower layers to select the network automatically.
44  *
45  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
46  *
47  *          <b> Prospective Clients: </b> External Apps.\n
48  *
49  *          This function makes a Dbus method call to the Telephony Server and returns an immediate value.
50  *          However it just means that the API request has been transferred to the CP successfully.
51  *          The actual operation result is delivered in the corresponding event asynchronously.
52  *
53  * @since_tizen 2.3
54  * @privlevel platform
55  * @privilege %http://tizen.org/privilege/telephony.admin
56  *
57  * @param[in] handle The handle from tel_init()
58  *
59  * @param[in] callback To register a callback function for result
60  *
61  * @param[in] user_data The user data for user specification
62  *
63  * @return The return type (int)\n
64  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
65  *         Refer #TapiResult_t for failure and an error code.
66  *
67  * @pre Initialize the Dbus connection with #tel_init.
68  */
69 int tel_select_network_automatic(TapiHandle *handle, tapi_response_cb callback, void *user_data);
70
71 /**
72  * @brief Requests the lower layers to select the network (PLMN) which has been selected by the user from the Network List displayed to the user.
73  *
74  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
75  *
76  *          <b> Prospective Clients: </b> External Apps.\n
77  *
78  *          This function makes a Dbus method call to the Telephony Server and returns an immediate value.
79  *          However it just means that the API request has been transferred to the CP successfully.
80  *          The actual operation result is delivered in the corresponding event asynchronously.
81  *
82  * @since_tizen 2.3
83  * @privlevel platform
84  * @privilege %http://tizen.org/privilege/telephony.admin
85  *
86  * @param[in] handle The handle from tel_init()
87  *
88  * @param[in] plmn The user selected PLMN
89  *
90  * @param[in] act The user selected Access Technology
91  *
92  * @param[in] callback To register a callback function for result
93  *
94  * @param[in] user_data The user data for user specification
95  *
96  * @return The return type (int)\n
97  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
98  *         Refer #TapiResult_t for failure and an error code.
99  *
100  * @pre Initialize the Dbus connection with #tel_init.
101  */
102 int tel_select_network_manual(TapiHandle *handle, const char *plmn, int act, tapi_response_cb callback, void *user_data);
103
104 /**
105  * @brief Sends a request to do manual search for the available networks and provides the Network List to the User/Application.
106  *
107  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
108  *
109  *          <b> Prospective Clients: </b> External Apps.\n
110  *
111  *          This function makes a Dbus method call to the Telephony Server and returns an immediate value.
112  *          However it just means that the API request has been transferred to the CP successfully.
113  *          The actual operation result is delivered in the corresponding event asynchronously.
114  *
115  * @since_tizen 2.3
116  * @privlevel platform
117  * @privilege %http://tizen.org/privilege/telephony.admin
118  *
119  * @param[in] handle The handle from tel_init()
120  *
121  * @param[in] callback To register a callback function for result
122  *
123  * @param[in] user_data The user data for user specification
124  *
125  * @return The return type (int)\n
126  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
127  *         Refer #TapiResult_t for failure and an error code.
128  *
129  * @pre Initialize the Dbus connection with #tel_init.
130  *
131  * @post In the available network list, the user can select one of the networks successfully.
132  */
133 int tel_search_network(TapiHandle *handle, tapi_response_cb callback, void *user_data);
134
135 /**
136  * @brief Gets the present network selection mode i.e. automatic or manual.
137  *
138  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
139  *
140  *          <b> Prospective Clients: </b> External Apps.\n
141  *
142  *          This function makes a Dbus method call to the Telephony Server and returns an immediate value.
143  *          However it just means that the API request has been transferred to the CP successfully.
144  *          The actual operation result is delivered in the corresponding event asynchronously.
145  *
146  * @since_tizen 2.3
147  * @privlevel public
148  * @privilege %http://tizen.org/privilege/telephony
149  *
150  * @param[in] handle The handle from tel_init()
151  *
152  * @param[in] callback To register a callback function for the result
153  *
154  * @param[in] user_data The user data for user specification
155  *
156  * @return The return type (int)\n
157  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
158  *         Refer #TapiResult_t for failure and an error code.
159  *
160  * @pre Initialize the Dbus connection with #tel_init.
161  */
162 int tel_get_network_selection_mode(struct tapi_handle *handle, tapi_response_cb callback, void *user_data);
163
164 /**
165  * @brief Sets the network preferred PLMN.
166  *
167  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
168  *
169  *          <b> Prospective Clients: </b> External Apps. \n
170  *
171  *          This function makes a Dbus method call to the Telephony Server and returns an immediate value.
172  *          However it just means that the API request has been transferred to the CP successfully.
173  *          The actual operation result is delivered in the corresponding event asynchronously.
174  *
175  * @since_tizen 2.3
176  * @privlevel platform
177  * @privilege %http://tizen.org/privilege/telephony.admin
178  *
179  * @param[in] handle The handle from tel_init()
180  *
181  * @param[in] operation The operation to be done on the preferred PLMN
182  *
183  * @param[in] info The PLMN Info
184  *
185  * @param[in] callback To register a callback function for result
186  *
187  * @param[in] user_data The user data for user specification
188  *
189  * @return The return type (int)\n
190  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
191  *         Refer #TapiResult_t for failure and an error code.
192  *
193  * @pre Initialize the Dbus connection with #tel_init.
194  */
195 int tel_set_network_preferred_plmn(TapiHandle *handle, TelNetworkPreferredPlmnOp_t operation,
196                 TelNetworkPreferredPlmnInfo_t *info, tapi_response_cb callback, void *user_data);
197
198 /**
199  * @brief Gets the preferred PLMN list.
200  *
201  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
202  *
203  *          <b> Prospective Clients: </b> External Apps. \n
204  *
205  *          This function makes a Dbus method call to the Telephony Server and returns an immediate value.
206  *          However it just means that the API request has been transferred to the CP successfully.
207  *          The actual operation result is delivered in the corresponding event asynchronously.
208  *
209  * @since_tizen 2.3
210  * @privlevel public
211  * @privilege %http://tizen.org/privilege/telephony
212  *
213  * @param[in] handle The handle from tel_init()
214  *
215  * @param[in] callback To register a callback function for result
216  *
217  * @param[in] user_data The user data for user specification
218  *
219  * @return The return type (int)\n
220  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
221  *         Refer #TapiResult_t for failure and an error code.
222  *
223  * @pre Initialize the Dbus connection with #tel_init.
224  */
225 int tel_get_network_preferred_plmn(TapiHandle *handle, tapi_response_cb callback, void *user_data);
226
227 /**
228  * @brief Cancels the triggered manual network search.
229  *
230  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
231  *
232  *          <b> Prospective Clients: </b> External Apps.
233  *
234  * @since_tizen 2.3
235  * @privlevel platform
236  * @privilege %http://tizen.org/privilege/telephony.admin
237  *
238  * @param[in] handle The handle from tel_init()
239  *
240  * @param[in] callback To register a callback function for result
241  *
242  * @param[in] user_data The user data for user specification
243  *
244  * @return The return type (int)\n
245  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
246  *         Refer #TapiResult_t for failure and an error code.
247  */
248 int tel_cancel_network_manual_search(TapiHandle *handle, tapi_response_cb callback, void *user_data);
249
250 /**
251  * @brief Gets network serving information.
252  *
253  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
254  *
255  *          <b> Prospective Clients: </b> External Apps.
256  *
257  * @since_tizen 2.3
258  * @privlevel public
259  * @privilege %http://tizen.org/privilege/telephony
260  *
261  * @param[in] handle The handle from tel_init()
262  *
263  * @param[in] callback To register a callback function for result
264  *
265  * @param[in] user_data The user data for user specification
266  *
267  * @return The return type (int)\n
268  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
269  *         Refer #TapiResult_t for failure and an error code.
270  */
271 int tel_get_network_serving(TapiHandle *handle, tapi_response_cb callback, void *user_data);
272
273 /**
274  * @brief Sets the network mode.
275  *
276  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
277  *
278  *          <b> Prospective Clients: </b> External Apps.
279  *
280  * @since_tizen 2.3
281  * @privlevel platform
282  * @privilege %http://tizen.org/privilege/telephony.admin
283  *
284  * @param[in] handle The handle from tel_init()
285  *
286  * @param[in] mode The network mode (GSM only or WCDMA only or Automatic)
287  *
288  * @param[in] callback To register a callback function for result
289  *
290  * @param[in] user_data The user data for user specification
291  *
292  * @return The return type (int)\n
293  *         #TAPI_API_SUCCESS - indicates that the operation is completed successfully\n
294  *         Refer #TapiResult_t for failure and an error code.
295  */
296 int tel_set_network_mode(TapiHandle *handle, int mode, tapi_response_cb callback, void *user_data);
297
298 /**
299  * @brief Gets the network mode.
300  *
301  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
302  *
303  *          <b> Prospective Clients: </b> External Apps.
304  *
305  * @since_tizen 2.3
306  * @privlevel public
307  * @privilege %http://tizen.org/privilege/telephony
308  *
309  * @param[in] handle The handle from tel_init()
310  *
311  * @param[in] callback To register a callback function for result
312  *
313  * @param[in] user_data The user data for user specification
314  *
315  * @return The return type (int)\n
316  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
317  *         Refer #TapiResult_t for failure and an error code.
318  */
319 int tel_get_network_mode(TapiHandle *handle, tapi_response_cb callback, void *user_data);
320
321 /**
322  * @brief Gets neighboring cell info.
323  *
324  * @details <b> Sync (or) Async: </b> This is an Asynchronous API.\n
325  *
326  *          <b> Prospective Clients: </b> External Apps.
327  *
328  * @since_tizen 2.3
329  * @privlevel public
330  * @privilege %http://tizen.org/privilege/telephony
331  *
332  * @param[in] handle The handle from tel_init()
333  *
334  * @param[in] callback To register a callback function for result
335  *
336  * @param[in] user_data The user data for user specification
337  *
338  * @return The return type (int)\n
339  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
340  *         Refer #TapiResult_t for failure and an error code.
341  */
342 int tel_get_network_neighboring_cell_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
343
344 /**
345  * @brief Enters or exits the emergency callback mode.
346  *
347  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
348  *
349  *          <b> Prospective Clients: </b> External Apps.
350  *
351  * @since_tizen 2.3
352  * @privlevel platform
353  * @privilege %http://tizen.org/privilege/telephony.admin
354  *
355  * @param[in] handle The handle from tel_init()
356  *
357  * @param[in] mode The emergency callback mode (Enter or Exit)
358  *
359  * @param[in] callback To register a callback function for result
360  *
361  * @param[in] user_data The user data for user specification
362  *
363  * @return The return type (int)\n
364  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
365  *         Refer #TapiResult_t for failure and an error code.
366  */
367 int tel_set_network_emergency_callback_mode(TapiHandle *handle, TelNetworkEmergencyCallbackMode_t mode,
368                 tapi_response_cb callback, void *user_data);
369
370 /**
371  * @brief Sets the network roaming preference.
372  *
373  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
374  *
375  *          <b> Prospective Clients: </b> External Apps.
376  *
377  * @since_tizen 2.3
378  * @privlevel platform
379  * @privilege %http://tizen.org/privilege/telephony.admin
380  *
381  * @param[in] handle The handle from tel_init()
382  *
383  * @param [in] roam_pref The network roaming preference (AUTOMATIC, HOME_ONLY, ROAM_ONLY)
384  *
385  * @param[in] callback To register a callback function for result
386  *
387  * @param[in] user_data The user data for user specification
388  *
389  * @return The return type (int)\n
390  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
391  *         Refer #TapiResult_t for failure and an error code.
392  */
393 int tel_set_network_roaming_preference(TapiHandle *handle, TelNetworkPrefNetType_t roam_pref, tapi_response_cb callback, void *user_data);
394
395 /**
396  * @brief Gets the network roaming preference.
397  *
398  * @details <b> Sync (or) Async: </b> This is an Asynchronous API. \n
399  *
400  *          <b> Prospective Clients: </b> External Apps.
401  *
402  * @since_tizen 2.3
403  * @privlevel public
404  * @privilege %http://tizen.org/privilege/telephony
405  *
406  * @param[in] handle The handle from tel_init()
407  *
408  * @param[in] callback To register a callback function for result
409  *
410  * @param[in] user_data The user data for user specification
411  *
412  * @return The return type (int)\n
413  *         #TAPI_API_SUCCESS indicates that the operation is completed successfully\n
414  *         Refer #TapiResult_t for failure and an error code.
415  */
416 int tel_get_network_roaming_preference(TapiHandle *handle, tapi_response_cb callback, void *user_data);
417
418 /**
419  * @brief Sets the Subscription (related to #TapiHandle) as 'default' Data Subscription.
420  *
421  * @since_tizen 2.3
422  * @privlevel platform
423  * @privilege %http://tizen.org/privilege/telephony.admin
424  *
425  * @param[in] handle The handle from tel_init()
426  *
427  * @param[in] callback To register a callback function for result
428  *
429  * @param[in] user_data The user data for user specification
430  *
431  * @post None.
432  *
433  * @return The return type (int)\n
434  *         #TAPI_API_SUCCESS indicates that the operation has completed successfully\n
435  *         Refer #TapiResult_t for failure and an error code.
436  *
437  * @par Prospective Clients: External Apps.
438  */
439 int tel_set_network_default_data_subscription(TapiHandle *handle, tapi_response_cb callback, void *user_data);
440
441 /**
442  * @brief Gets the Subscription which is configured as 'default' Data Subscription.
443  *
444  * @since_tizen 2.3
445  * @privlevel public
446  * @privilege %http://tizen.org/privilege/telephony
447  *
448  * @param[in] handle The handle from tel_init()
449  *
450  * @param[out] The default subscription
451  *             - 'default' Data Subscription.
452  *             - Refer #TelNetworkDefaultDataSubs_t for Subscription details.
453  *
454  * @post None.
455  *
456  * @return The return type (int)\n
457  *         #TAPI_API_SUCCESS indicates that the operation has completed successfully\n
458  *         Refer #TapiResult_t for failure and an error code.
459  *
460  * @par Prospective Clients: External Apps.
461  */
462 int tel_get_network_default_data_subscription(TapiHandle *handle, TelNetworkDefaultDataSubs_t *default_subscription);
463
464 /**
465  * @brief This function is called to set the Subscription (related to #TapiHandle) as 'default' Subscription for CS (Voice).
466  *
467  * @since_tizen 2.3
468  * @privlevel platform
469  * @privilege %http://tizen.org/privilege/telephony.admin
470  *
471  * @param [in] handle
472  * - handle from tel_init().
473  *
474  * @param [in] callback
475  * - To register callback function for result.
476  *
477  * @param [in] user_data
478  * - user_data for user specification.
479  *
480  * @post
481  *  - None.
482  *
483  * @return Return Type (int) \n
484  * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
485  * - Refer #TapiResult_t for failure and error code
486  *
487  * @par Prospective Clients:
488  * External Apps.
489  */
490 int tel_set_network_default_subscription(TapiHandle *handle, tapi_response_cb callback, void *user_data);
491
492 /**
493  * @brief This function is called to get the Subscription which is configured as 'default' Subscription for CS (Voice).
494  *
495  * @since_tizen 2.3
496  * @privlevel public
497  * @privilege %http://tizen.org/privilege/telephony
498  *
499  * @param [in] handle
500  * - handle from tel_init().
501  *
502  * @param [out] default_subscription
503  * - 'default' Subscription for CS (Voice).
504  * - Refer #TelNetworkDefaultSubs_t for Subscription details
505  *
506  * @post
507  *  - None.
508  *
509  * @return Return Type (int) \n
510  * - TAPI_API_SUCCESS - indicating that the operation has completed successfully. \n
511  * - Refer #TapiResult_t for failure and error code
512  *
513  * @par Prospective Clients:
514  * External Apps.
515  */
516 int tel_get_network_default_subscription(TapiHandle *handle, TelNetworkDefaultSubs_t *default_subscription);
517
518 #ifdef __cplusplus
519 }
520 #endif
521
522 #endif  /* _ITAPI_NETWORK_H_ */
523
524 /**
525  * @}
526  */