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;
66 /* IoT Common profile only */
69 } common_utils_entry_info_t;
78 Evas_Smart_Cb btn1_cb;
79 Evas_Smart_Cb btn2_cb;
84 typedef Eina_Bool(*common_util_scan_update_cb)(void *data);
86 Eina_Bool common_utils_is_portrait_mode(void);
87 void common_utils_set_rotate_cb(int (*func)(enum appcore_rm, void*, Eina_Bool, Eina_Bool),
88 void* data, Eina_Bool wps_value, Eina_Bool setting_value);
89 void common_utils_contents_rotation_adjust(int event);
90 Elm_Object_Item *common_utils_add_dialogue_separator(
91 Evas_Object* genlist, const char *separator_style);
92 char *common_utils_get_ap_security_type_info_txt(
93 const char *pkg_name, wifi_device_info_t *device_info, bool check_fav);
94 void common_utils_get_device_icon(wifi_device_info_t *device_info,
96 char *common_utils_get_rssi_text(
97 const char *str_pkg_name, int rssi);
99 Evas_Object *common_utils_add_edit_box(Evas_Object *parent,
100 common_utils_entry_info_t *entry_info);
101 void common_utils_set_edit_box_imf_panel_evnt_cb(Elm_Object_Item *item,
102 imf_ctxt_panel_cb_t input_panel_cb, void *user_data);
103 void common_utils_edit_box_focus_set(Elm_Object_Item *item, Eina_Bool focus_set);
104 void common_utils_edit_box_allow_focus_set(Elm_Object_Item *item,
105 Eina_Bool focus_set);
106 Elm_Object_Item *common_utils_add_2_line_txt_disabled_item(
107 Evas_Object* view_list, const char *style_name,
108 const char *line1_txt, const char *line2_txt);
109 char *common_utils_get_list_item_entry_txt(Elm_Object_Item *entry_item);
110 Evas_Object *common_utils_create_layout(Evas_Object *navi_frame);
111 Evas_Object *common_utils_show_info_popup(Evas_Object *win,
112 popup_btn_info_t *popup_data);
113 Evas_Object *common_utils_show_info_ok_popup(Evas_Object *win,
114 const char *str_pkg_name, const char *info_txt,
115 Evas_Smart_Cb ok_cb, void *cb_data);
116 Evas_Object *common_utils_show_info_timeout_popup(Evas_Object *win,
117 const char* info_text, const double timeout);
118 int common_utils_get_rotate_angle(enum appcore_rm rotate_mode);
119 int common_utils_send_message_to_net_popup(const char *title,
120 const char *content, const char *type, const char *ssid);
121 int common_utils_send_restriction_to_net_popup(const char *title,
122 const char *type, const char *restriction);
124 int common_util_set_system_registry(const char *key, int value);
125 int common_util_get_system_registry(const char *key);
127 guint common_util_managed_idle_add(GSourceFunc func, gpointer user_data);
128 void common_util_managed_idle_cleanup(void);
129 void common_util_managed_ecore_scan_update_timer_add(double interval,
130 common_util_scan_update_cb callback, void *data);
131 void common_util_managed_ecore_scan_update_timer_del(void);
132 void common_util_manager_ecore_scan_update_timer_reset(void);
134 int common_utils_get_sim_state(void);
135 Eina_Bool _is_emulator(void);
137 bool is_common_profile(void);
138 void common_util_update_genlist_style(void);
139 void common_util_update_content_size(void);
141 void common_util_set_ug_type(UG_TYPE type);
142 UG_TYPE common_util_get_ug_type(void);