tizen 2.3.1 release
[framework/api/telephony.git] / include / telephony_private.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __CAPI_TELEPHONY_PRIVATE_H__
18 #define __CAPI_TELEPHONY_PRIVATE_H__
19
20 #include <gio/gio.h>
21 #include <glib.h>
22 #include <system_info.h>
23 #include "telephony_common.h"
24
25 #define TELEPHONY_FEATURE       "http://tizen.org/feature/network.telephony"
26
27 #define CHECK_TELEPHONY_SUPPORTED(feature_name) { \
28         bool telephony_supported = FALSE; \
29         if (!system_info_get_platform_bool(feature_name, &telephony_supported)) { \
30                 if (telephony_supported == FALSE) { \
31                         LOGE("telephony feature is disabled"); \
32                         return TELEPHONY_ERROR_NOT_SUPPORTED; \
33                 } \
34         } else { \
35                 LOGE("Error - Feature getting from System Info"); \
36                 return TELEPHONY_ERROR_OPERATION_FAILED; \
37         } \
38 }
39
40 typedef struct {
41         GSList *evt_list;
42         struct tapi_handle *tapi_h;
43 } telephony_data;
44
45 /*
46  * Need to define the struct same as tapi_handle of libslp-tapi
47  * because we are request dbus directly using dbus_connection, path
48  */
49 struct tapi_handle {
50         gpointer dbus_connection;
51         char *path;
52         char *cp_name;
53         GHashTable *evt_list;
54         char cookie[20];
55         GCancellable *ca;
56
57         GHashTable *cache_property;
58         guint prop_callback_evt_id;
59 };
60
61 #endif /* __CAPI_TELEPHONY_PRIVATE_H__ */