4 * Copyright 2012-2013 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __MOBILE_HOTSPOT_H__
21 #define __MOBILE_HOTSPOT_H__
28 #define PACKAGE "ug-setting-mobileap-efl"
31 #if !defined(LOCALEDIR)
32 #define LOCALEDIR "/usr/ug/res/locale"
36 #define EDJDIR "/usr/ug/res/edje/ug-setting-mobileap-efl"
40 #define PREFIX "/usr/ug"
45 #include <Elementary.h>
47 #include <ui-gadget-module.h>
49 #include <net_connection.h>
51 #include <tethering.h>
54 #define MH_TEXT_DOMAIN PACKAGE
55 #define MH_LOCALEDIR LOCALEDIR
60 #define S_(str) dgettext("sys_string", str)
65 #define N_(str) gettext_noop(str)
70 #define _(str) dgettext(MH_TEXT_DOMAIN, str)
72 #define VCONF_MOBILE_AP_PREV_WIFI_STATUS "db/private/libug-setting-mobileap-efl/prev_wifi_status"
74 #define MOBILE_AP_TAG "mobile_ap"
75 #define DBG(fmt, args...) LOG(LOG_DEBUG, MOBILE_AP_TAG, "[%s()][Ln:%d] "fmt, \
76 __func__, __LINE__, ##args)
77 #define ERR(fmt, args...) LOG(LOG_ERROR, MOBILE_AP_TAG, "[%s()][Ln:%d] "fmt, \
78 __func__, __LINE__, ##args)
80 #define __MOBILE_AP_FUNC_ENTER__ DBG("Entering: +\n")
81 #define __MOBILE_AP_FUNC_EXIT__ DBG("Exit: -\n")
83 #define TETHERING_IMAGES_EDJ "tethering_images.edj"
84 #define WIFI_ICON "Wifi.png"
85 #define BT_ICON "Bluetooth.png"
86 #define USB_ICON "USB.png"
88 #define DEVICE_NAME_LENGTH_MAX 31
89 #define WIFI_PASSPHRASE_LENGTH_MIN 8
90 #define WIFI_PASSPHRASE_LENGTH_MAX 63
91 #define MH_LABEL_LENGTH_MAX 1024
93 #define _EDJ(obj) elm_layout_edje_get(obj)
95 #define TETHERING_WIFI_MAX_CONNECTED_STA 8
96 #define TETHERING_BT_MAX_CONNECTED_STA 7
97 #define TETHERING_USB_MAX_CONNECTED_STA 1
98 #define TETHERING_MAX_CONNECTED_STA \
99 (TETHERING_WIFI_MAX_CONNECTED_STA + TETHERING_BT_MAX_CONNECTED_STA + TETHERING_USB_MAX_CONNECTED_STA)
101 /* This is from tethering_private.h */
102 #define TETHERING_TYPE_MAX 4 /**< All, USB, Wi-Fi, BT */
107 /* Two buttons pop-up */
108 MH_POP_WIFI_OFF_CONF,
112 MH_POP_USB_ON_PREVCONN_CONF,
113 MH_POP_ENTER_TO_WIFI_SETUP_CONF,
115 /* One button pop-up */
119 /* No button & timeout pop-up */
120 MH_POP_INFORMATION_WO_BUTTON,
131 typedef struct ap_app_main {
132 Evas_Object *genlist;
134 Evas_Object *back_btn;
135 Evas_Object *wifi_btn;
137 Evas_Object *usb_btn;
139 Elm_Genlist_Item_Class *sp_itc;
140 Elm_Genlist_Item_Class *end_sp_itc;
141 Elm_Genlist_Item_Class *wifi_itc;
142 Elm_Genlist_Item_Class *setup_itc;
143 Elm_Genlist_Item_Class *bt_itc;
144 Elm_Genlist_Item_Class *usb_itc;
145 Elm_Genlist_Item_Class *help_itc;
147 Elm_Genlist_Item_Class *device_itc;
148 Elm_Genlist_Item_Class *device0_itc;
149 Elm_Genlist_Item_Class *usage_itc;
150 Elm_Genlist_Item_Class *dev_itc[TETHERING_TYPE_MAX];
152 Elm_Object_Item *sp_item[4];
153 Elm_Object_Item *wifi_item;
154 Elm_Object_Item *setup_item;
155 Elm_Object_Item *bt_item;
156 Elm_Object_Item *usb_item;
157 Elm_Object_Item *device_item;
158 Elm_Object_Item *usage_item;
159 Elm_Object_Item *help_item;
165 bool need_recover_wifi_tethering;
169 Elm_Object_Item *navi_it;
170 Evas_Object *genlist;
172 Evas_Object *back_btn;
173 Evas_Object *title_back_btn;
174 Evas_Object *hide_btn;
175 Evas_Object *security_btn;
176 Evas_Object *pw_entry;
178 Elm_Genlist_Item_Class *sp_itc;
179 Elm_Genlist_Item_Class *end_sp_itc;
180 Elm_Genlist_Item_Class *hide_itc;
181 Elm_Genlist_Item_Class *security_itc;
182 Elm_Genlist_Item_Class *pw_itc;
183 Elm_Genlist_Item_Class *name_itc;
185 Elm_Object_Item *sp_item[2];
186 Elm_Object_Item *hide_item;
187 Elm_Object_Item *security_item;
188 Elm_Object_Item *pw_item;
189 Elm_Object_Item *name_item;
192 tethering_wifi_security_type_e security_type;
194 char device_name[DEVICE_NAME_LENGTH_MAX + 1];
195 char wifi_passphrase[WIFI_PASSPHRASE_LENGTH_MAX + 1];
196 char wifi_passphrase_new[WIFI_PASSPHRASE_LENGTH_MAX + 1];
197 } mh_wifi_setting_view_t;
201 tethering_client_h handle[TETHERING_MAX_CONNECTED_STA];
206 unsigned long long pdp_total_sent;
207 unsigned long long pdp_total_receive;
213 connection_h conn_handle;
219 Evas_Object *naviframe;
222 Ecore_Timer *update_statistics_handle;
225 mh_wifi_setting_view_t setup;
227 mh_data_usage_t data_statistics;
228 mh_clients_t clients;
230 enum ug_event rotate_state;
231 Ecore_IMF_Input_Panel_State imf_state;
242 #endif /* __MOBILE_HOTSPOT_H__ */