summaryrefslogtreecommitdiff
path: root/include/bt-main-ug.h
blob: 0c965a857303d57cb683316eda7107df474b503b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/*
 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Flora License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://floralicense.org/license/
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __BT_MAIN_UG_H__
#define __BT_MAIN_UG_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>
#include <libintl.h>
#include <appcore-efl.h>
#include <Elementary.h>
#include <ui-gadget-module.h>
#include <dlog.h>
#include <E_DBus.h>
#include <bundle.h>
#include <gio/gio.h>

#include "bt-type-define.h"
#include "bt-profile-view.h"

#ifndef UG_MODULE_API
#define UG_MODULE_API __attribute__ ((visibility("default")))
#endif

#define PKGNAME "ug-setting-bluetooth-efl"

#ifdef PREFIX
#undef PREFIX
#endif
#define PREFIX "/usr/ug/"

#define LOCALEDIR PREFIX"res/locale"

#define _EDJ(o)			elm_layout_edje_get(o)
#define BT_ICON_EDJ "/usr/ug/res/edje/ug-setting-bluetooth-efl/bluetooth_images.edj"
#ifdef _
#undef _
#endif
#define _(s)			dgettext(PKGNAME, s)

#define dgettext_noop(s)	(s)

#ifdef N_
#undef N_
#endif
#define N_(s)			dgettext_noop(s)

#define BT_UG_VCONF_PRINTSETTING		"memory/bluetooth/printsetting"

typedef struct {
	/* UI gadget data */
	ui_gadget_h ug;
	Evas_Object *base;
	Evas_Object *win_main;
	bt_launch_mode_t bt_launch_mode;

	/* Request timer */
	Ecore_Timer *request_timer;

	/*************************
	*          Main View objects
	************************ */
	Evas_Object *navi_bar;
	Evas_Object *main_layout;
	Elm_Object_Item *navi_it;
	Elm_Object_Item *service_navi_it;

	/* Genlist */
	Evas_Object *main_genlist;

	/* Paired / Searched devices */
	Evas_Object *paired_dlggrp;
	Evas_Object *searched_dlggrp;

	/* Selected device's genlist items */
	Elm_Object_Item *paired_item;
	Elm_Object_Item *searched_item;

	/* Paired / Searched device list */
	Eina_List *paired_device;
	Eina_List *searched_device;

	/* Button */
	Evas_Object *onoff_btn;
	Evas_Object *scan_btn;
	Evas_Object *radio_main;

	/* Genlist Item class */
	Elm_Genlist_Item_Class *sp_itc;
	Elm_Genlist_Item_Class *status_itc;
	Elm_Genlist_Item_Class *visible_itc;
	Elm_Genlist_Item_Class *paired_title_itc;
	Elm_Genlist_Item_Class *searched_title_itc;
	Elm_Genlist_Item_Class *timeout_value_itc;
	Elm_Genlist_Item_Class *searched_itc;
	Elm_Genlist_Item_Class *no_device_itc;
	Elm_Genlist_Item_Class *device_itc;
	Elm_Genlist_Item_Class *visibility_status_itc;

	/* Genlist Items */
	Elm_Object_Item *status_item;
	Elm_Object_Item *visible_item;
	Elm_Object_Item *paired_title;
	Elm_Object_Item *searched_title;
	Elm_Object_Item *no_device_item;
	Elm_Object_Item *paired_padding;
	Elm_Object_Item *searched_padding;
	Elm_Object_Item *bottom_padding;
	Elm_Object_Item *visible_exp_item[5];
	Elm_Object_Item *visibility_status_item;

	/*************************
	*           Popup objects
	************************ */
	Evas_Object *popup;
	Evas_Object *popup_menu;

	/*************************
	*          Status Variables
	************************ */
	bool waiting_service_response;
	bool connect_req;
	bool search_req;
	bool aul_launching_req;
	bool aul_pairing_req;
	unsigned int op_status;
	unsigned int ug_status;
	unsigned int search_type;

	/*************************
	*          Grobal variables
	************************ */
	Elm_Genlist_Item_Class popup_menu_itc;
	service_h service;
	bundle *popup_bundle;
	int handle;
	char phone_name[BT_DEVICE_NAME_LENGTH_MAX + 1];
	int selected_radio;
	int remain_time;
	time_t start_time;
	bool visible;
	int timeout_id;
	int popup_timer;
	int visibility_timeout;
	bt_rotate_mode_t rotation;
	bt_dev_t *pick_device;
	void *connection;
	bool is_popup_exist;

	/* Dbus connection / proxy */
	void *conn;

	GDBusConnection *g_conn;
	guint gdbus_owner_id;

	/* End key callback */
	bt_app_back_cb back_cb;

	/*************************
	*           Profile  View Data
	************************ */
	bt_profile_view_data *profile_vd;
	bt_confirm_req_t confirm_req;
} bt_ug_data;

void _bt_ug_destroy(void *data, void *result);

#ifdef __cplusplus
}
#endif
#endif				/* __BT_MAIN_UG_H__ */