4 * Copyright 2012 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://www.tizenopensource.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 __COMMON_UTILS_H__
21 #define __COMMON_UTILS_H__
30 #include <Elementary.h>
32 /* Fix build warning (redefine '_()' in appcore-common.h) */
36 #include <appcore-common.h>
38 #include "wlan_manager.h"
40 typedef void (*imf_ctxt_panel_cb_t)(void *data, Ecore_IMF_Context *ctx, int value);
46 ENTRY_TYPE_SUBNET_MASK,
50 ENTRY_TYPE_PROXY_ADDR,
51 ENTRY_TYPE_PROXY_PORT,
56 entry_id_type_t entry_id;
60 Elm_Object_Item *item;
61 imf_ctxt_panel_cb_t input_panel_cb;
62 void *input_panel_cb_data;
63 const char *str_pkg_name;
65 } common_utils_entry_info_t;
74 Evas_Smart_Cb btn1_cb;
75 Evas_Smart_Cb btn2_cb;
80 typedef Eina_Bool(*common_util_scan_update_cb)(void *data);
82 Eina_Bool common_utils_is_portrait_mode(void);
83 void common_utils_set_rotate_cb(int (*func)(enum appcore_rm, void*, Eina_Bool, Eina_Bool),
84 void* data, Eina_Bool wps_value, Eina_Bool setting_value);
85 void common_utils_contents_rotation_adjust(int event);
86 Elm_Object_Item *common_utils_add_dialogue_separator(
87 Evas_Object* genlist, const char *separator_style);
88 char *common_utils_get_ap_security_type_info_txt(
89 const char *pkg_name, wifi_device_info_t *device_info, bool check_fav);
90 void common_utils_get_device_icon(wifi_device_info_t *device_info,
92 char *common_utils_get_rssi_text(
93 const char *str_pkg_name, int rssi);
95 Evas_Object *common_utils_add_edit_box(Evas_Object *parent,
96 common_utils_entry_info_t *entry_info);
97 void common_utils_set_edit_box_imf_panel_evnt_cb(Elm_Object_Item *item,
98 imf_ctxt_panel_cb_t input_panel_cb, void *user_data);
99 void common_utils_edit_box_focus_set(Elm_Object_Item *item, Eina_Bool focus_set);
100 void common_utils_edit_box_allow_focus_set(Elm_Object_Item *item,
101 Eina_Bool focus_set);
102 Elm_Object_Item *common_utils_add_2_line_txt_disabled_item(
103 Evas_Object* view_list, const char *style_name,
104 const char *line1_txt, const char *line2_txt);
105 char *common_utils_get_list_item_entry_txt(Elm_Object_Item *entry_item);
106 Evas_Object *common_utils_create_layout(Evas_Object *navi_frame);
107 Evas_Object *common_utils_show_info_popup(Evas_Object *win,
108 popup_btn_info_t *popup_data);
109 Evas_Object *common_utils_show_info_ok_popup(Evas_Object *win,
110 const char *str_pkg_name, const char *info_txt,
111 Evas_Smart_Cb ok_cb, void *cb_data);
112 Evas_Object *common_utils_show_info_timeout_popup(Evas_Object *win,
113 const char* info_text, const double timeout);
114 int common_utils_get_rotate_angle(enum appcore_rm rotate_mode);
115 int common_utils_send_message_to_net_popup(const char *title,
116 const char *content, const char *type, const char *ssid);
117 int common_utils_send_restriction_to_net_popup(const char *title,
118 const char *type, const char *restriction);
120 int common_util_set_system_registry(const char *key, int value);
121 int common_util_get_system_registry(const char *key);
123 guint common_util_managed_idle_add(GSourceFunc func, gpointer user_data);
124 void common_util_managed_idle_cleanup(void);
125 void common_util_managed_ecore_scan_update_timer_add(double interval,
126 common_util_scan_update_cb callback, void *data);
127 void common_util_managed_ecore_scan_update_timer_del(void);
128 void common_util_manager_ecore_scan_update_timer_reset(void);
130 int common_utils_get_sim_state(void);
131 Eina_Bool _is_emulator(void);