Initialize Tizen 2.3
[apps/connectivity/bt-connection-popup.git] / include / bt-connection-main.h
1 /*
2 * bt-connection-popup
3 *
4 * Copyright 2012 Samsung Electronics Co., Ltd
5 *
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 *           Injun Yang <injun.yang@samsung.com>
8 *           Seungyoun Ju <sy39.ju@samsung.com>
9 *
10 * Licensed under the Flora License, Version 1.1 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.tizenopensource.org/license
15 *
16 * Unless required by applicable law or agreed to in writing,
17 * software distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 */
23
24 #ifndef __BT_CONNECTION_MAIN_H__
25 #define __BT_CONNECTION_MAIN_H__
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #include <glib.h>
32 #include <dlog.h>
33 #include <app_service.h>
34 #include <Elementary.h>
35 #include <appcore-efl.h>
36 #include <vconf.h>
37 #include <vconf-keys.h>
38 #include <app.h>
39 #include <efl_assist.h>
40
41 #include <Ecore_X.h>
42
43
44 #ifdef LOG_TAG
45 #undef LOG_TAG
46 #endif
47
48 #define LOG_TAG "BT_CONNECTION_POPUP"
49 #define DBG(format, args...) SLOGD(format, ##args)
50 #define ERR(format, args...) SLOGE(format, ##args)
51 #define DBG_SECURE(fmt, args...) SECURE_SLOGD(fmt, ##args)
52
53 #define ret_if(expr) \
54         do { \
55                 if (expr) { \
56                         return; \
57                 } \
58         } while (0);
59
60 #define retv_if(expr, val) \
61         do { \
62                 if (expr) { \
63                         return (val); \
64                 } \
65         } while (0);
66
67 #define retm_if(expr, fmt, arg...) \
68         do { \
69                 if (expr) { \
70                         ERR(fmt, ##arg); \
71                         return; \
72                 } \
73         } while (0);
74
75
76 #define retvm_if(expr, val, fmt, arg...) \
77         do { \
78                 if (expr) { \
79                         ERR(fmt, ##arg); \
80                         return (val); \
81                 } \
82         } while (0);
83
84
85 #define EDJ_FILE                EDJDIR "/bt-connection-popup.edj"
86 #define BUF_SIZE 32
87 #define BUF_SIZE_256 256
88 #define TITLE_STR_MAX_LEN 256
89 #define TEXT_EXTRA_LEN 20
90 #define APP_DESTORY_TIMEOUT 3
91 #define CONNECT_TIMEOUT 30 //20
92
93
94 #define DLL_DEFAULT __attribute__((visibility ("default")))
95
96 #ifndef _EDJ
97 #define _EDJ(obj) (elm_layout_edje_get(obj))
98 #endif
99
100 #ifndef PACKAGE
101 #define PACKAGE "bt-connection-popup"
102 #endif
103
104 #define KEY_VAL_CONNECTED "Connected"
105 #define KEY_VAL_NOT_CONNECTED "Not Connected"
106
107 typedef enum {
108         WMS_DISCONNECTED,
109         WMS_CONNECTED
110 } wms_status_e;
111
112 typedef struct {
113         Evas_Object *window;
114         Evas_Object *conform;
115         Evas_Object *layout_main;
116         Evas_Object *navi;
117         Evas_Object *main_layout;
118
119         Evas_Object *popup;
120         Ecore_Timer *timer;
121
122         service_h service;
123         service_h service_clone;
124
125         gboolean initialize;
126
127         E_DBus_Connection *dbus_conn;
128         E_DBus_Signal_Handler *gesture_sh;
129         E_DBus_Signal_Handler *app_core_sh;
130 } bt_app_data_t;
131
132 #ifdef __cplusplus
133 }
134 #endif
135
136 #endif                          /* __APP_COMMON_H__ */