Remove the devider of genlist for IOT profile
[apps/native/ug-bluetooth-efl.git] / standard / bt-main-ug.h
1 /*
2 * ug-bluetooth-efl
3 *
4 * Copyright 2012 Samsung Electronics Co., Ltd
5 *
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 *           GirishAshok Joshi <girish.joshi@samsung.com>
8 *           DoHyun Pyun <dh79.pyun@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_MAIN_UG_H__
25 #define __BT_MAIN_UG_H__
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #include <stdbool.h>
32 #include <libintl.h>
33 #include <appcore-efl.h>
34 #include <Elementary.h>
35 #include <efl_extension.h>
36 #include <ui-gadget-module.h>
37 #include <dlog.h>
38 #include <bundle.h>
39 #include <gio/gio.h>
40
41 #include "bt-define.h"
42 #include "bt-type-define.h"
43 #include "bt-profile-view.h"
44
45 #define _EDJ(o)                 elm_layout_edje_get(o)
46
47 #ifdef _
48 #undef _
49 #endif
50 #define _(s) dgettext(PKGNAME, s)
51
52 #define dgettext_noop(s) (s)
53
54 #ifdef N_
55 #undef N_
56 #endif
57 #define N_(s) dgettext_noop(s)
58
59 #define BT_UG_VCONF_PRINTSETTING                "memory/bluetooth/printsetting"
60
61 typedef struct {
62         /* UI gadget data */
63         ui_gadget_h ug;
64         Evas_Object *base;
65         Evas_Object *win_main;
66         Elm_Theme *theme;
67
68         bt_launch_mode_t bt_launch_mode;
69
70         /* Request timer */
71         Ecore_Timer *request_timer;
72
73         /*************************
74         *          Main View objects
75         ************************ */
76         Evas_Object *navi_bar;
77         Evas_Object *main_layout;
78         Elm_Object_Item *navi_it;
79         Elm_Object_Item *service_navi_it;
80         /* Genlist */
81         Evas_Object *main_genlist;
82
83
84         /* Paired / Searched devices */
85         Evas_Object *paired_dlggrp;
86         Evas_Object *searched_dlggrp;
87
88         /* Selected device's genlist items */
89         Elm_Object_Item *paired_item;
90         Elm_Object_Item *searched_item;
91
92         /* Help object */
93         Evas_Object *help_more_popup;
94         Evas_Object *help_popup;
95
96         /* Rename Device object*/
97         Evas_Object *rename_popup;
98         Evas_Object *rename_entry;
99         Evas_Object *rename_button;
100
101         /* Paired / Searched device list */
102         Eina_List *paired_device;
103         Eina_List *searched_device;
104
105         /* Network profile list */
106         Eina_List *net_profile_list;
107
108         /* Button */
109         Evas_Object *onoff_btn;
110         Evas_Object *scan_btn;
111
112         /* Genlist Item class */
113         Elm_Genlist_Item_Class *device_name_itc;
114         Elm_Genlist_Item_Class *rename_entry_itc;
115         Elm_Genlist_Item_Class *rename_desc_itc;
116         Elm_Genlist_Item_Class *paired_title_itc;
117         Elm_Genlist_Item_Class *searched_title_itc;
118         Elm_Genlist_Item_Class *searched_device_itc;
119         Elm_Genlist_Item_Class *no_device_itc;
120         Elm_Genlist_Item_Class *paired_device_itc;
121         Elm_Genlist_Item_Class *on_itc;
122         Elm_Genlist_Item_Class *off_itc;
123
124         /* Genlist Items */
125         Elm_Object_Item *onoff_item;
126         Elm_Object_Item *device_name_item;
127         Elm_Object_Item *paired_title;
128         Elm_Object_Item *searched_title;
129         Elm_Object_Item *no_device_item;
130         Elm_Object_Item *visible_exp_item[BT_MAX_TIMEOUT_ITEMS + 1];
131         Elm_Object_Item *empty_status_item;
132         Elm_Object_Item *rename_entry_item;
133
134         /*************************
135         *           Popup objects
136         ************************ */
137         Evas_Object *popup;
138         bt_popup_data popup_data;
139         Evas_Object *popup_menu;
140
141         /*************************
142         *          Status Variables
143         ************************ */
144         bool waiting_service_response;
145         bool disconn_req;
146         bool connect_req;
147         bool aul_launching_req;
148         bool aul_pairing_req;
149         bool is_discovery_started;
150         bool is_le_discovery_started;
151         unsigned int op_status;
152         unsigned int ug_status;
153         unsigned int help_status;
154         unsigned int search_type;
155
156         /*************************
157         *          Grobal variables
158         ************************ */
159         app_control_h service;
160         bundle *popup_bundle;
161         void *handle;
162         char phone_name[BT_GLOBALIZATION_STR_LENGTH];
163         int timeout_id;
164         int popup_timer;
165         bt_dev_t *pick_device;
166         void *connection;
167         bool is_popup_exist;
168
169         GDBusConnection *g_conn;
170         guint gdbus_owner_id;
171
172         /* End key callback */
173         bt_app_back_cb back_cb;
174
175         Ecore_Timer *timer;
176         Ecore_Timer *network_timer;
177         /*************************
178         *           Profile  View Data
179         ************************ */
180         bt_profile_view_data *profile_vd;
181         bt_confirm_req_t confirm_req;
182
183         void *dpm_handle;
184         int dpm_callback_id;
185 } bt_ug_data;
186
187
188 typedef enum _bt_cfg_item_reset_type {
189         BT_CFG_ITEM_UNRESETABLE = 0,
190         BT_CFG_ITEM_RESETABLE = 1,
191 } bt_cfg_item_reset_type;
192
193 typedef enum _bt_cfg_item_type {
194         BT_CFG_ITEM_NODE_ERROR = 0,     /** Error */
195         BT_CFG_ITEM_UG_NODE = 1,                /** general UG */
196         BT_CFG_ITEM_UI_NODE = 2,                /** no UG, no app launching, just menu name */
197         BT_CFG_ITEM_TITLE_NODE = 3,     /** view name */
198         BT_CFG_ITEM_APP_NODE = 4,               /** app type - by launcher - read doc '4' */
199         BT_CFG_ITEM_VIEW_NODE = 5,              /** view name - 2depth search */
200 } bt_cfg_item_type;
201
202 typedef struct {
203         char *key_name;                         /** key name */
204         char *icon_path;                        /** icon path */
205         char *ug_args;                          /** UG path or hyperlink */
206         int pos;                                /** position : 1st, 2st -- deprecated */
207         bt_cfg_item_reset_type reset_type;      /** if ug supports Reset function */
208         int click_times;                        /** UG menu need to check */
209         bt_cfg_item_type item_type;     /** 0:item 1:header title */
210         void *data;
211 } bt_setting_cfg_node_t;
212
213 void _bt_ug_destroy(void *data, void *result);
214
215 #ifdef __cplusplus
216 }
217 #endif
218 #endif                          /* __BT_MAIN_UG_H__ */