apply FSL(Flora Software License)
[apps/native/ug-wifi-direct.git] / ug-wifidirect / include / wfd_ug.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
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 /*
18  * This file declares structure for Wi-Fi direct UI Gadget.
19  *
20  * @file    wfd_ug.h
21  * @author  Gibyoung Kim (lastkgb.kim@samsung.com)
22  * @version 0.1
23  */
24
25
26 #ifndef __WFD_UG_H__
27 #define __WFD_UG_H__
28
29 #include <dlog.h>
30
31 #define PACKAGE "ug-setting-wifidirect-efl"
32 #define LOCALEDIR "/opt/ug/res/locale"
33
34 #define DIRECT_TAG  "wfd_ug"
35 #define DBG(log_level, format, args...) \
36        LOG(log_level, DIRECT_TAG, "[%s()][%d] " format, __FUNCTION__, __LINE__, ##args)
37
38 #define __FUNC_ENTER__  DBG(LOG_VERBOSE, "+\n")
39 #define __FUNC_EXIT__   DBG(LOG_VERBOSE, "-\n")
40
41 #define VCONF_WFD_ONOFF                         "db/wifi_direct/onoff"
42 #define VCONF_WFD_CONNECTION_STATUS "db/wifi_direct/connection_status"
43 #define VCONF_WFD_APNAME                        "db/setting/device_name"
44 #define VCONF_WFD_PASSWORD                      "db/mobile_hotspot/wifi_key"
45 #define VCONF_WFD_PREV_STATUS           "db/wifi_direct/prev_status"
46
47 #define assertm_if(expr, fmt, arg...) do { \
48    if(expr) { \
49           DBG(LOG_VERBOSE, " ##(%s) -> %s() assert!!## "fmt, #expr, __FUNCTION__, ##arg); \
50                  assert(1); \
51    } \
52 } while (0)
53
54 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
55 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
56
57 #define AP_NAME_LENGTH_MAX              32
58 #define AP_PASSWORD_LENGTH_MAX  64
59 #define AP_PASSWORD_LENGTH_MIN  8
60 #define AP_REJECT_CHAR_LIST             "=,"
61
62 #define DEFAULT_DEV_NAME        "Tizen"
63 #define MAC_LENGTH  18
64 #define SSID_LENGTH 32
65 #define MAX_PEER_NUM 10
66
67 #define _(s)        dgettext(PACKAGE, s)
68 #define N_(s)      dgettext_noop(s)
69 #define S_(s)      dgettext("sys_string", s)
70
71
72 typedef struct
73 {
74     char ssid[SSID_LENGTH];
75     unsigned int category;
76     char mac_addr[MAC_LENGTH];
77     char if_addr[MAC_LENGTH];
78     int conn_status;
79     Elm_Object_Item *gl_item;
80 } device_type_s;
81
82 struct ug_data
83 {
84     Evas_Object *base;
85     struct ui_gadget *ug;
86
87     Evas_Object *win;
88     Evas_Object *bg;
89     Evas_Object *naviframe;
90     Evas_Object *genlist;
91     Elm_Object_Item *head;
92     Elm_Object_Item *noitem;
93     Elm_Object_Item *scan_btn;
94     Evas_Object *popup;
95     Evas_Object *act_popup;
96     Evas_Object *warn_popup;
97
98     int head_text_mode;
99
100     device_type_s *peers;
101     int peer_cnt;
102
103     int wfd_onoff;
104     int wfd_status;
105     char *dev_name;
106     char *dev_pass;
107 };
108
109
110 #endif                          /* __WFD_UG_H__ */