diff options
author | Abhishek Sansanwal <abhishek.s94@samsung.com> | 2017-10-04 11:14:07 +0530 |
---|---|---|
committer | Abhishek Sansanwal <abhishek.s94@samsung.com> | 2017-10-11 10:10:44 +0530 |
commit | 9a8a55c56fe0e0b5b7eee59f16f88637b1f2a9f6 (patch) | |
tree | 89c7f34aefa1dcd9a0dc47154600c30a01d7f959 | |
parent | c44331aba04743e4d590ce9a0c02817922851b52 (diff) | |
download | wifi-9a8a55c56fe0e0b5b7eee59f16f88637b1f2a9f6.tar.gz wifi-9a8a55c56fe0e0b5b7eee59f16f88637b1f2a9f6.tar.bz2 wifi-9a8a55c56fe0e0b5b7eee59f16f88637b1f2a9f6.zip |
Added IPv6 configuration to Change network menusubmit/tizen/20171012.045027accepted/tizen/unified/20171013.190303
Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
Change-Id: I6a3dc3ae930482a4036c9149df2174ad0a752cd2
22 files changed, 1480 insertions, 71 deletions
diff --git a/sources/wearable/CMakeLists.txt b/sources/wearable/CMakeLists.txt index f02f5c0..9825f56 100644 --- a/sources/wearable/CMakeLists.txt +++ b/sources/wearable/CMakeLists.txt @@ -118,11 +118,19 @@ ADD_CUSTOM_TARGET(circle_button.edj DEPENDS ${RES_SOURCE_DIR}/edje/circle_button.edc ) +ADD_CUSTOM_TARGET(genlist.edj + COMMAND edje_cc -id ${RES_SOURCE_DIR}/images + ${RES_SOURCE_DIR}/edje/genlist.edc ${CMAKE_CURRENT_SOURCE_DIR}/genlist.edj + DEPENDS ${RES_SOURCE_DIR}/edje/genlist.edc + ) + ADD_DEPENDENCIES(${PROJECT_NAME} circle_button.edj) +ADD_DEPENDENCIES(${PROJECT_NAME} genlist.edj) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.edj DESTINATION ${EDJDIR}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/circle_button.edj DESTINATION ${EDJDIR}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/genlist.edj DESTINATION ${EDJDIR}) # install application HOME directory INSTALL(DIRECTORY DESTINATION ${DATADIR}) diff --git a/sources/wearable/inc/net/emulator.h b/sources/wearable/inc/net/emulator.h index a08458a..2aea930 100644 --- a/sources/wearable/inc/net/emulator.h +++ b/sources/wearable/inc/net/emulator.h @@ -44,6 +44,8 @@ int _wifi_manager_ap_get_ip_config_type(wifi_manager_ap_h ap, wifi_manager_addre int _wifi_manager_ap_set_ip_config_type(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, wifi_manager_ip_config_type_e type); +int _wifi_manager_ap_set_dns_config_type(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, wifi_manager_dns_config_type_e type); + int _wifi_manager_ap_get_ip_address(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, char** ip_address); int _wifi_manager_ap_set_ip_address(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, const char* ip_address); @@ -127,3 +129,5 @@ int _wifi_manager_config_foreach_configuration(wifi_manager_h wifi, wifi_manager int _wifi_manager_config_get_name(wifi_manager_config_h config, char **name); int _wifi_manager_config_get_security_type(wifi_manager_config_h config, wifi_manager_security_type_e *security_type); + +int _wifi_manager_ap_set_prefix_length(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, int length); diff --git a/sources/wearable/inc/net/util/wifi_address.h b/sources/wearable/inc/net/util/wifi_address.h index a31bdbb..a41a964 100755 --- a/sources/wearable/inc/net/util/wifi_address.h +++ b/sources/wearable/inc/net/util/wifi_address.h @@ -26,7 +26,9 @@ extern "C" { #endif #define DEFAULT_GUIDE_IP_ADDRESS "192.168.1.128" +#define DEFAULT_GUIDE_IPV6_ADDRESS "0000:0000:0000:0000:0000:0000:0000:0000" #define DEFAULT_GUIDE_SUBNET_MASK "255.255.255.0" +#define DEFAULT_GUIDE_NETWORK_PREFIX_LENGTH "24" #define DEFAULT_GUIDE_GATEWAY_ADDRESS "192.168.1.1" #define DEFAULT_GUIDE_DNS1 "8.8.8.8" #define DEFAULT_GUIDE_DNS2 "8.8.4.4" @@ -38,7 +40,10 @@ typedef struct _wifi_address_object wifi_address_object; wifi_address_object *wifi_address_new(); void wifi_address_free(wifi_address_object *object); -wifi_address_object *wifi_address_clone(wifi_address_object *self); +wifi_address_object *wifi_address_clone(wifi_address_object *self, gboolean is_ipv6); + +gboolean wifi_address_is_static_ipv6(wifi_address_object *self); +void wifi_address_set_static_ipv6(wifi_address_object *self, gboolean is_static_ip); gboolean wifi_address_is_static_ip(wifi_address_object *self); void wifi_address_set_static_ip(wifi_address_object *self, gboolean is_static_ip); @@ -55,6 +60,7 @@ void wifi_address_set_eap_type(wifi_address_object *self, wifi_manage const gchar *wifi_address_get_password(wifi_address_object *self); void wifi_address_set_password(wifi_address_object *self, const gchar *password); +/* IPV4 */ const gchar *wifi_address_get_ip_address(wifi_address_object *self); void wifi_address_set_ip_address(wifi_address_object *self, const gchar *ip_address); @@ -67,6 +73,19 @@ void wifi_address_set_subnet_mask(wifi_address_object *self, const gchar const gchar *wifi_address_get_dns_address(wifi_address_object *self, gint order); void wifi_address_set_dns_address(wifi_address_object *self, const gchar *dns, gint order); +/* IPV6 */ +const gchar *wifi_address_get_ipv6_address(wifi_address_object *self); +void wifi_address_set_ipv6_address(wifi_address_object *self, const gchar *ip_address); + +const gchar *wifi_address_get_ipv6_gateway_address(wifi_address_object *self); +void wifi_address_set_ipv6_gateway_address(wifi_address_object *self, const gchar *gateway_address); + +const gchar *wifi_address_get_prefix_length(wifi_address_object *self); +void wifi_address_set_prefix_length(wifi_address_object *self, const gchar *subnet_mask); + +const gchar *wifi_address_get_ipv6_dns_address(wifi_address_object *self, gint order); +void wifi_address_set_ipv6_dns_address(wifi_address_object *self, const gchar *dns, gint order); + const gchar *wifi_address_get_proxy_address(wifi_address_object *self); void wifi_address_set_proxy_address(wifi_address_object *self, const gchar *proxy_address); diff --git a/sources/wearable/inc/net/wifi_manager.h b/sources/wearable/inc/net/wifi_manager.h index c02a1d8..fa4bc59 100755 --- a/sources/wearable/inc/net/wifi_manager.h +++ b/sources/wearable/inc/net/wifi_manager.h @@ -135,17 +135,17 @@ wifi_manager_security_type_e wifi_ap_get_security_type(wifi_ap_object *ap_obj); gchar *wifi_ap_get_security_type_text(wifi_ap_object *ap_obj); wifi_manager_connection_state_e wifi_ap_get_connection_state(wifi_ap_object *ap_obj); gchar *wifi_ap_get_ip_address(wifi_ap_object *ap_obj); -void wifi_ap_set_ip_address(wifi_ap_object *ap_obj, const gchar *ip_address); +void wifi_ap_set_ip_address(wifi_ap_object *ap_obj, const gchar *ip_address, wifi_manager_address_family_e address_family); gchar *wifi_ap_get_gateway_address(wifi_ap_object *ap_obj); -void wifi_ap_set_gateway_address(wifi_ap_object *ap_obj, const gchar *gateway_address); +void wifi_ap_set_gateway_address(wifi_ap_object *ap_obj, const gchar *gateway_address, wifi_manager_address_family_e address_family); gchar *wifi_ap_get_subnet_mask(wifi_ap_object *ap_obj); void wifi_ap_set_subnet_mask(wifi_ap_object *ap_obj, const gchar *subnet_mask); gchar *wifi_ap_get_dns_address(wifi_ap_object *ap_obj, gint order); -void wifi_ap_set_dns_address(wifi_ap_object *ap_obj, const gchar *dns_address, gint order); +void wifi_ap_set_dns_address(wifi_ap_object *ap_obj, const gchar *dns_address, gint order, wifi_manager_address_family_e address_family); wifi_manager_ip_config_type_e wifi_ap_get_ip_config(wifi_ap_object *ap_obj); -void wifi_ap_set_ip_config(wifi_ap_object *ap_obj, wifi_manager_ip_config_type_e config_type); bool wifi_ap_is_ip_config_static(wifi_ap_object *ap_obj); -void wifi_ap_set_ip_config_static(wifi_ap_object *ap_obj); +void wifi_ap_set_ip_config_static(wifi_ap_object *ap_obj, wifi_manager_address_family_e address_family); +void wifi_ap_set_dns_config_static(wifi_ap_object *ap_obj, wifi_manager_address_family_e address_family); wifi_manager_proxy_type_e wifi_ap_get_proxy_type(wifi_ap_object *ap_obj); void wifi_ap_set_proxy_type(wifi_ap_object *ap_obj, wifi_manager_proxy_type_e proxy_type); bool wifi_ap_is_proxy_manual(wifi_ap_object *ap_obj); @@ -157,6 +157,7 @@ bool wifi_ap_is_wps_mode(wifi_ap_object *ap_obj); bool wifi_ap_is_favorite(wifi_manager_object *manager, wifi_ap_object *ap_obj); gboolean wifi_manager_ap_has_configuration(wifi_manager_object *manager, wifi_ap_object *ap_obj); wifi_manager_error_e wifi_ap_remove_configuration(wifi_manager_object *manager, wifi_ap_object *ap_obj); +void wifi_ap_set_prefix_length(wifi_ap_object *ap_obj, const gchar *length); /* * Only wearable API (weconn / vconf feature) diff --git a/sources/wearable/inc/util/locale.h b/sources/wearable/inc/util/locale.h index 01ffbfa..4302da8 100755 --- a/sources/wearable/inc/util/locale.h +++ b/sources/wearable/inc/util/locale.h @@ -76,6 +76,7 @@ static inline char *wifi_text(const char *msgid) #define STR_PROXY_SETTINGS wifi_text("WDS_WIFI_BODY_PROXY_SETTINGS") #define STR_IP_ADDRESS wifi_text("WDS_WIFI_BODY_IP_ADDRESS") #define STR_SUBNETMASK wifi_text("WDS_WIFI_MBODY_SUBNET_MASK_ABB") +#define STR_NETWORK_PREFIX_LENGTH wifi_text("WDS_WIFI_MBODY_NETWORK_PREFIX_LENGTH_ABB") #define STR_GATYEWAY wifi_text("WDS_WIFI_MBODY_GATEWAY_ADDRESS_ABB") #define STR_DNS wifi_text("WDS_WIFI_MBODY_DNS_PD_ABB") #define STR_PROXY_ADDRESS wifi_text("WDS_WIFI_MBODY_PROXY_ADDRESS_ABB") @@ -103,6 +104,7 @@ static inline char *wifi_text(const char *msgid) #define STR_UNTICK_FOR_TTS wifi_text("IDS_COM_BODY_UNTICK_T_TTS") #define STR_EDITFIELD_FOR_TTS wifi_text("IDS_TPLATFORM_BODY_EDIT_FIELD_M_NOUN_T_TTS") #define STR_CONNECTED_TO_WIFI_NETWORK wifi_text("WDS_WIFI_TPOP_CONNECTED_TO_WI_FI_NETWORK_PS") +#define STR_IPV6 wifi_text("WDS_WIFI_MBODY_IPV6_ABB") #if defined TIZEN_WLAN_CHINA_WAPI #define STR_WAPI_PSK "WAPI PSK" diff --git a/sources/wearable/inc/wearable-circle/view/base.h b/sources/wearable/inc/wearable-circle/view/base.h index 1dd60d4..ffadb90 100755 --- a/sources/wearable/inc/wearable-circle/view/base.h +++ b/sources/wearable/inc/wearable-circle/view/base.h @@ -59,6 +59,9 @@ void view_base_conformant_del_virtualkeypad_size_changed_cb(view_base_object *se Evas_Object *view_base_add_genlist(view_base_object *self, Evas_Object *parent); Evas_Object *view_base_add_genlist_for_circle(view_base_object *self, Evas_Object *parent, Evas_Object **circle_genlist); +Evas_Object *view_base_add_genlist_2text_multiline(view_base_object *self, Evas_Object *parent); +Evas_Object *view_base_add_2text_multiline_genlist_for_circle(view_base_object *self, + Evas_Object *parent, Evas_Object **circle_genlist); Evas_Object *view_base_add_scroller(view_base_object *self, Evas_Object *parent); Evas_Object *view_base_add_scroller_for_circle(view_base_object *self, Evas_Object *parent, Evas_Object **circle_scroller); diff --git a/sources/wearable/inc/wearable-circle/view/layout_ap_info.h b/sources/wearable/inc/wearable-circle/view/layout_ap_info.h index 477f02c..0697949 100755 --- a/sources/wearable/inc/wearable-circle/view/layout_ap_info.h +++ b/sources/wearable/inc/wearable-circle/view/layout_ap_info.h @@ -31,6 +31,7 @@ typedef enum { AP_INFO_MENU_EAP, AP_INFO_MENU_PASSWORD, AP_INFO_MENU_STATIC, + AP_INFO_MENU_IPV6, AP_INFO_MENU_PROXY, AP_INFO_MENU_EMPTY, AP_INFO_MENU_SIZE, diff --git a/sources/wearable/inc/wearable-circle/view/layout_static_ip.h b/sources/wearable/inc/wearable-circle/view/layout_static_ip.h index 62c60fb..99bf441 100755 --- a/sources/wearable/inc/wearable-circle/view/layout_static_ip.h +++ b/sources/wearable/inc/wearable-circle/view/layout_static_ip.h @@ -60,7 +60,10 @@ void layout_static_ip_save_button_set_enable(layout_static_ip_object *self); void layout_static_ip_save_button_set_disable(layout_static_ip_object *self); void layout_static_ip_activate_rotary_event(layout_static_ip_object *self); -void layout_static_ip_deactivate_rotary_event(layout_static_ip_object *self); +void layout_static_ip_deactivate_rotary_event(layout_static_ip_object *self, Eina_Bool val); + +void layout_static_ip_set_is_ipv6(layout_static_ip_object *self, gboolean is_ipv6); +gboolean layout_static_ip_get_is_ipv6(layout_static_ip_object *self); void layout_static_ip_set_del_cb(layout_static_ip_object *self, Evas_Object_Event_Cb func, void *data); diff --git a/sources/wearable/inc/wearable-circle/view/layout_wearable_input.h b/sources/wearable/inc/wearable-circle/view/layout_wearable_input.h index 2f31462..39c0127 100755 --- a/sources/wearable/inc/wearable-circle/view/layout_wearable_input.h +++ b/sources/wearable/inc/wearable-circle/view/layout_wearable_input.h @@ -61,6 +61,7 @@ void layout_wearable_input_set_input_maxlength_reached_cb(layout_wearable_input_ int max_char_count, Evas_Smart_Cb func, void *data); void layout_wearable_input_set_input_activated_cb(layout_wearable_input_object *self, Evas_Smart_Cb func, void *data); +gboolean layout_wearable_input_filter_set(layout_wearable_input_object *self, void *accept_set); #ifdef __cplusplus } diff --git a/sources/wearable/inc/wearable-circle/view/util/efl_helper.h b/sources/wearable/inc/wearable-circle/view/util/efl_helper.h index cdbf199..b628edf 100755 --- a/sources/wearable/inc/wearable-circle/view/util/efl_helper.h +++ b/sources/wearable/inc/wearable-circle/view/util/efl_helper.h @@ -37,6 +37,7 @@ extern "C" { #define EDJ_PATH "edje" #define EDJ_FILE "wifi.edj" #define EDJ_CIRCLE_BUTTON_FILE "circle_button.edj" +#define EDJ_GENLIST "genlist.edj" #define IMAGE_PATH "images" @@ -44,6 +45,7 @@ gboolean get_color_table_path(gchar *table_path, gsize table_path_length); gboolean get_font_table_path(gchar *table_path, gsize table_path_length); gboolean get_edj_path(gchar *edj_path, gsize edj_path_length); gboolean get_edj_circle_button_path(gchar *edj_path, gsize edj_path_length); +gboolean get_edj_genlist_path(gchar *edj_path, gsize edj_path_length); gboolean get_image_path(gchar *image_path, gsize image_path_length, const gchar *image_file); @@ -59,7 +61,7 @@ Evas_Object *create_icon_use_image_file(Evas_Object *parent, const gchar *image, const gchar *code); Evas_Object *create_circle_button_use_edj_file(Evas_Object *parent); - +Evas_Object *create_genlist_use_edj_file(Evas_Object *parent); #ifdef __cplusplus } #endif diff --git a/sources/wearable/res/po/en.po b/sources/wearable/res/po/en.po index 2231c39..498226a 100755 --- a/sources/wearable/res/po/en.po +++ b/sources/wearable/res/po/en.po @@ -166,6 +166,12 @@ msgstr "Signal strength" msgid "WDS_WIFI_MBODY_STATIC_IP_ABB" msgstr "Static IP" +msgid "WDS_WIFI_MBODY_IPV6_ABB" +msgstr "IPv6" + +msgid "WDS_WIFI_MBODY_NETWORK_PREFIX_LENGTH_ABB" +msgstr "Network prefix length" + msgid "WDS_WIFI_MBODY_SUBNET_MASK_ABB" msgstr "Subnet mask" diff --git a/sources/wearable/res/po/en_US.po b/sources/wearable/res/po/en_US.po index 32723a7..d641242 100755 --- a/sources/wearable/res/po/en_US.po +++ b/sources/wearable/res/po/en_US.po @@ -166,6 +166,12 @@ msgstr "Signal strength" msgid "WDS_WIFI_MBODY_STATIC_IP_ABB" msgstr "Static IP" +msgid "WDS_WIFI_MBODY_IPV6_ABB" +msgstr "IPv6" + +msgid "WDS_WIFI_MBODY_NETWORK_PREFIX_LENGTH_ABB" +msgstr "Network prefix length" + msgid "WDS_WIFI_MBODY_SUBNET_MASK_ABB" msgstr "Subnet mask" diff --git a/sources/wearable/res/wearable-circle/edje/genlist.edc b/sources/wearable/res/wearable-circle/edje/genlist.edc new file mode 100644 index 0000000..43f1105 --- /dev/null +++ b/sources/wearable/res/wearable-circle/edje/genlist.edc @@ -0,0 +1,556 @@ +/* + * Copyright (c) 2000-2014 Samsung Electronics Co., Ltd All Rights Reserved + * + * PROPRIETARY/CONFIDENTIAL + * + * This software is the confidential and proprietary information of + * SAMSUNG ELECTRONICS ("Confidential Information"). + * You shall not disclose such Confidential Information and shall + * use it only in accordance with the terms of the license agreement + * you entered into with SAMSUNG ELECTRONICS. + * SAMSUNG make no representations or warranties about the suitability + * of the software, either express or implied, including but not + * limited to the implied warranties of merchantability, fitness for + * a particular purpose, or non-infringement. + * SAMSUNG shall not be liable for any damages suffered by licensee as + * a result of using, modifying or distributing this software or its derivatives. + */ + + +#define PROGRAM_LIST_EVENT \ + program { name: "content_event_disable"; \ + signal: "elm,state,content_event,disable"; \ + source: "elm"; \ + script { \ + set_mouse_events(PART:"event_block", 1); \ + set_repeat_events(PART:"event_block", 0); \ + set_state(PART:"event_block", "blocked", 0.0); \ + } \ + } \ + program { name: "content_event_enable"; \ + signal: "elm,state,content_event,enable"; \ + source: "elm"; \ + script { \ + set_mouse_events(PART:"event_block", 0); \ + set_repeat_events(PART:"event_block", 1); \ + set_state(PART:"event_block", "default", 0.0); \ + } \ + } \ + program { "enable_event_pass"; \ + signal: "elm,event,pass,enabled"; \ + source: "elm"; \ + script { \ + set_mouse_events(PART:"event_block", 0); \ + set_state(PART:"event_block", "default", 0.0); \ + } \ + } \ + program { "disable_event_pass"; \ + signal: "elm,event,pass,disabled"; \ + source:"elm"; \ + script { \ + set_mouse_events(PART:"event_block", 1); \ + set_state(PART:"event_block", "blocked", 0.0); \ + } \ + } \ +program { "enable_event_repeat"; \ + signal: "elm,event,repeat,enabled"; \ + source: "elm"; \ + script { \ + set_repeat_events(PART:"event_block", 1); \ + } \ +} \ +program { "disable_event_repeat"; \ + signal: "elm,event,repeat,disabled"; \ + source:"elm"; \ + script { \ + set_repeat_events(PART:"event_block", 0); \ + set_state(PART:"event_block", "blocked", 0.0); \ + } \ +} + +#define LIST_PADDING_LEFT_SIZE_INC 30 +#define LIST_PADDING_RIGHT_SIZE_INC 30 +#define LIST_PADDING_DIVIDER_LEFT_SIZE_INC 3 +#define LIST_PADDING_ICON_LEFT_SIZE_INC 16 +#define LIST_PADDING_ICON_RIGHT_SIZE_INC 16 +#define LIST_PADDING_ICON_CENTER_SIZE_INC 8 +#define LIST_GROUPINDEX_PADDING_LEFT_SIZE_INC 76 +#define LIST_GROUPINDEX_PADDING_RIGHT_SIZE_INC 76 +#define LIST_GROUPINDEX_PADDING_TOP_SIZE_INC 0 +#define LIST_GROUPINDEX_PADDING_BOTTOM_SIZE_INC 0 +#define LIST_GROUPINDEX_PADDING_CENTER_SIZE_INC 12 +#define LIST_GROUPINDEX_SUB_LINE_WIDTH_INC 64 +#define LIST_GROUPINDEX_SUB_LINE_HEIGHT_INC 2 +#define LIST_1LINE_PADDING_TOP_SIZE_INC 41 +#define LIST_1LINE_PADDING_BOTTOM_SIZE_INC 41 +#define LIST_2LINE_PADDING_TOP_SIZE_INC 41 +#define LIST_2LINE_PADDING_BOTTOM_SIZE_INC 41 +#define LIST_2LINE_PADDING_HIGHLIGHTED_TOP_SIZE_INC 25 +#define LIST_2LINE_PADDING_HIGHLIGHTED_BOTTOM_SIZE_INC 57 +#define LIST_2LINE_PADDING_SUB_TEXT_BOTTOM_SIZE_INC 11 +#define LIST_3LINE_PADDING_TOP_SIZE_INC 41 +#define LIST_3LINE_PADDING_BOTTOM_SIZE_INC 41 +#define LIST_3LINE_PADDING_HIGHLIGHTED_TOP_SIZE_INC 9 +#define LIST_3LINE_PADDING_HIGHLIGHTED_BOTTOM_SIZE_INC 73 +#define LIST_3LINE_PADDING_SUB_TEXT_BOTTOM_SIZE_INC 9 +#define LIST_2LINE_MULTILINE_PADDING_TOP_SIZE_INC 61 +#define LIST_2LINE_MULTILINE_PADDING_BOTTOM_SIZE_INC 15 +#define LIST_3LINE_MULTILINE_PADDING_TOP_SIZE_INC 56 +#define LIST_3LINE_MULTILINE_PADDING_BOTTOM_SIZE_INC 8 +#define LIST_3LINE_PADDING_CENTER_SIZE_INC 2 +#define LIST_4LINE_PADDING_TOP_SIZE_INC 51 +#define LIST_4LINE_PADDING_BOTTOM_SIZE_INC 51 +#define LIST_4LINE_PADDING_CENTER_SIZE_INC 2 +#define LIST_4LINE_PADDING_HIGHLIGHTED_TOP_SIZE_INC 1 +#define LIST_4LINE_PADDING_HIGHLIGHTED_BOTTOM_SIZE_INC 101 +#define LIST_4LINE_PADDING_SUB_TEXT_BOTTOM_SIZE_INC 4 +#define LIST_TITLE_PADDING_LEFT_SIZE_INC 64 +#define LIST_TITLE_PADDING_RIGHT_SIZE_INC 64 +#define LIST_TITLE_PADDING_TOP_SIZE_INC 50 +#define LIST_TITLE_PADDING_BOTTOM_SIZE_INC 25 +#define LIST_TITLE_SUB_PADDING_LEFT_SIZE_INC 64 +#define LIST_TITLE_SUB_PADDING_RIGHT_SIZE_INC 64 +#define LIST_TITLE_SUB_PADDING_TOP_SIZE_INC 37 +#define LIST_TITLE_SUB_PADDING_MIDDLE_SIZE_INC 3 +#define LIST_TITLE_SUB_PADDING_BOTTOM_SIZE_INC 0 +#define LIST_TITLE_GROUP_PADDING_LEFT_SIZE_INC 70 +#define LIST_TITLE_GROUP_PADDING_RIGHT_SIZE_INC 70 +#define LIST_TITLE_GROUP_PADDING_TOP_SIZE_INC 36 +#define LIST_TITLE_GROUP_PADDING_BOTTOM_SIZE_INC 7 +#define LIST_FOCUS_BG_PADDING_TOP_SIZE_INC 11 +#define LIST_FOCUS_BG_PADDING_BOTTOM_SIZE_INC 11 +#define LIST_EDITFIELD_LEFT_PADDING_SIZE_INC 36 +#define LIST_EDITFIELD_RIGHT_PADDING_SIZE_INC 36 +#define LIST_EDITFIELD_TOP_PADDING_SIZE_INC 34 +#define LIST_EDITFIELD_BOTTOM_PADDING_SIZE_INC 34 +#define LIST_EDITFIELD_LEFT_IN_PADDING_SIZE_INC 16 +#define LIST_EDITFIELD_RIGHT_IN_PADDING_SIZE_INC 16 +#define LIST_EDITFIELD_TOP_IN_PADDING_SIZE_INC 13 +#define LIST_EDITFIELD_BOTTOM_IN_PADDING_SIZE_INC 12 +#define LIST_TEXT_MAIN_SIZE_INC 36 +#define LIST_TEXT_SUB_SIZE_INC 24 +#define LIST_TEXT_MULTILINE_SIZE_INC 20 +#define LIST_TEXT_TITLE_SIZE_INC 30 +#define LIST_TEXT_TITLE_SUB_SIZE_INC 24 +#define LIST_TEXT_GROUPINDEX_SIZE_INC 24 +#define LIST_TEXT_MAIN_HEIGHT_INC 47 +#define LIST_TEXT_SUB_HEIGHT_INC 50 +#define LIST_TEXT_SUB_HEIGHT_MAX_INC 100 +#define LIST_TEXT_TITLE_HEIGHT_INC 39 +#define LIST_TEXT_TITLE_SUB_HEIGHT_INC 32 +#define LIST_TEXT_GROUPINDEX_HEIGHT_INC 32 +#define LIST_TEXT_EDITFIELD_HEIGHT_INC 37 +#define LIST_SUB_MULTILINE_ICON_SIZE_INC 76 76 +#define LIST_MARQUEE_SPEED 66.66 +#define LIST_MARQUEE_LOOP_DELAY 0.8 +#define LIST_HIGHLIGHT_DURATION_TIME 0.2 +#define LIST_UNHIGHLIGHT_DURATION_TIME 0.2 + +#define STYLE_TAG_MATCH \ + tag: "match" "+ color=#0e76b2ff"; + +collections { + + styles { + style { name: "list_text_multiline_normal"; + base: "font=Tizen:weight=Normal:width=Condensed font_size="LIST_TEXT_MULTILINE_SIZE_INC" color=#ffffffff color_class=genlist_item/multifline/text text_class=tizen wrap=mixed"; + STYLE_TAG_MATCH + } + style { name: "list_text_2text_main_normal"; + base: "font=Tizen:weight=Normal:width=Condensed font_size="LIST_TEXT_MAIN_SIZE_INC" color=#ffffffff color_class=genlist_item/"ITEM_STYLE"/text text_class=list_item"; + STYLE_TAG_MATCH + } + style { name: "list_text_2text_main_disabled"; + base: "font=Tizen:weight=Normal:width=Condensed font_size="LIST_TEXT_MAIN_SIZE_INC" color=#ffffffff color_class=genlist_item/"ITEM_STYLE"/text_disabled text_class=list_item"; + STYLE_TAG_MATCH + } + style { name: "list_text_2text_main_press"; + base: "font=Tizen:weight=Normal:width=Condensed font_size="LIST_TEXT_MAIN_SIZE_INC" color=#ffffffff color_class=genlist_item/"ITEM_STYLE"/text_pressed text_class=list_item"; + STYLE_TAG_MATCH + } + +} + +group { "elm/genlist/item/2text/static_genlist"; + data.item: "treesize" 0; + data.item: "flips" "elm.flip.icon elm.flip.content"; + data.item: "texts" "elm.text elm.text.1"; + data.item: "contents" "elm.swallow.center_check"; + // 'vi_effect' data can determine fisheye effect. + // 'on' : enable item resize effect depending on their distance from center position. + // 'off': disable the effect and item size will not changed by it's position. this is default value. + data.item: "vi_effect" "on"; + + script { + public is_disabled; + public is_highlighted; + public init() { + slide_stop(); + set_int(is_disabled, 0); + set_int(is_highlighted, 0); + } + public set_disabled(val) { + set_int(is_disabled, val); + } + public set_highlighted(val) { + set_int(is_highlighted, val); + } + public get_disabled() { + return get_int(is_disabled); + } + public get_highlighted() { + return get_int(is_highlighted); + } + public slide_start(val) { + if(get_disabled()) set_state(PART:"elm.text", "slide_disabled", 0.0); + else set_state(PART:"elm.text", "slide", 0.0); + } + public slide_stop() { + if (get_disabled()) set_state(PART:"elm.text", "disabled", 0.0); + else set_state(PART:"elm.text", "default", 0.0); + } + } + parts { + rect { "bg"; + desc { "default"; + color: 255 255 255 0; + color_class: "genlist_item/2text/bg"; + } + } + spacer { "elm.padding.left"; + desc { "default"; + fixed: 1 0; + align: 0.0 0.5; + rel2.relative: 0.0 1.0; + min: LIST_PADDING_LEFT_SIZE_INC 0; + max: LIST_PADDING_LEFT_SIZE_INC -1; + } + } + spacer { "elm.padding.right"; + desc { "default"; + fixed: 1 0; + align: 1.0 0.5; + rel1.relative: 1 0; + min: LIST_PADDING_RIGHT_SIZE_INC 0; + max: LIST_PADDING_RIGHT_SIZE_INC -1; + } + } + spacer { "elm.padding.top"; + desc { "default"; + fixed: 0 1; + align: 0.5 0.0; + rel2.relative: 1.0 0.0; + min: 0 LIST_2LINE_PADDING_TOP_SIZE_INC; + max: -1 LIST_2LINE_PADDING_TOP_SIZE_INC; + } + desc { "highlighting"; + inherit: "default"; + } + desc { "highlighted"; + inherit: "highlighting"; + min: 0 LIST_2LINE_PADDING_HIGHLIGHTED_TOP_SIZE_INC; + max: -1 LIST_2LINE_PADDING_HIGHLIGHTED_TOP_SIZE_INC; + } + } + spacer { "elm.padding.bottom"; + desc { "default"; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0.5 1.0; + min: 0 LIST_2LINE_PADDING_BOTTOM_SIZE_INC; + max: -1 LIST_2LINE_PADDING_BOTTOM_SIZE_INC; + } + desc { "highlighting"; + inherit: "default"; + } + desc { "highlighted"; + inherit: "highlighting"; + min: 0 LIST_2LINE_PADDING_HIGHLIGHTED_BOTTOM_SIZE_INC; + max: -1 LIST_2LINE_PADDING_HIGHLIGHTED_BOTTOM_SIZE_INC; + } + } + rect { "elm.padding.focus_bg.top"; + desc { "default"; + fixed: 0 1; + align: 0.5 0.0; + rel2.relative: 1.0 0.0; + min: 0 LIST_FOCUS_BG_PADDING_TOP_SIZE_INC; + max: -1 LIST_FOCUS_BG_PADDING_TOP_SIZE_INC; + color: 0 0 0 0; + } + } +/* rect { "elm.padding.focus_bg.bottom"; + desc { "default"; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0.5 1.0; + min: 0 LIST_FOCUS_BG_PADDING_BOTTOM_SIZE_INC; + max: -1 LIST_FOCUS_BG_PADDING_BOTTOM_SIZE_INC; + color: 0 0 0 0; + } + }*/ + spacer { "elm.padding.bottom.1"; + desc { "default"; + fixed: 0 1; + rel1.relative: 0.0 1.0; + align: 0.5 1.0; + min: 0 LIST_2LINE_PADDING_SUB_TEXT_BOTTOM_SIZE_INC; + max: -1 LIST_2LINE_PADDING_SUB_TEXT_BOTTOM_SIZE_INC; + } + } + textblock { "elm.text"; + desc { "default"; + rel1 { + relative: 1 1; + to_x: "elm.padding.left"; + to_y: "elm.padding.top"; + } + rel2 { + relative: 0 0; + to_x: "elm.padding.right"; + to_y: "elm.padding.bottom"; + } + fixed: 1 0; + min: 0 LIST_TEXT_MAIN_HEIGHT_INC; + align: 0.5 0.5; + text { + min: 0 1; + max: 1 1; + style: "list_text_2text_main_normal"; + } + } + desc { "disabled"; + inherit: "default"; + text.style: "list_text_2text_main_disabled"; + } + desc { "slide"; + inherit: "default"; + text { + ellipsize { + mode: FADE_MARQUEE; + marquee.loop: 2; + marquee.loop_delay: LIST_MARQUEE_LOOP_DELAY; + marquee.speed: LIST_MARQUEE_SPEED; + } + } + } + desc { "slide_disabled"; + inherit: "disabled"; + text { + ellipsize { + mode: FADE_MARQUEE; + marquee.loop: 2; + marquee.loop_delay: LIST_MARQUEE_LOOP_DELAY; + marquee.speed: LIST_MARQUEE_SPEED; + } + } + } + desc { "pressed"; + inherit: "default"; + text.style: "list_text_2text_main_press"; + } + } + rect { "clipper.sub_text"; + desc { "default"; + rel1 { + relative: 1 1; + to_x: "elm.padding.left"; + to_y: "elm.padding.top"; + } + rel2 { + relative: 0 0; + to_x: "elm.padding.right"; + to_y: "elm.padding.bottom.1"; + } + hid; + } + desc { "highlighting"; + vis; + color: 0 0 0 0; + } + desc { "highlighted"; + inherit: "highlighting"; + color: 255 255 255 255; + } + } + textblock { "elm.text.1"; + clip_to: "clipper.sub_text"; + desc { "default"; + align: 0.5 0; + rel1 { + relative: 1 1; + to_x: "elm.padding.left"; + to_y: "elm.text"; + } + rel2 { + relative: 0 1; + to_x: "elm.padding.right"; + to_y: "elm.padding.bottom"; + } + + min: 0 LIST_TEXT_SUB_HEIGHT_INC; + align: 0.5 0; + text { + min: 0 1; + max: 1 1; + style: "list_text_multiline_normal"; + } + } + desc { "pressed"; + inherit: "default"; + } + desc { "disabled"; + inherit: "default"; + } + } + rect { "elm.padding.focus_bg.bottom"; + desc { "default"; + fixed: 0 1; + rel1.relative: 0.0 1.0; + rel1.to: "elm.text.1"; + align: 0.5 1.0; + min: 0 LIST_FOCUS_BG_PADDING_BOTTOM_SIZE_INC; + max: -1 LIST_FOCUS_BG_PADDING_BOTTOM_SIZE_INC; + color: 0 0 0 0; + } + } + swallow { "elm.swallow.center_check"; + desc { "default"; + align: 0.5 0.5; + } + } + rect { "event_block"; nomouse; repeat; + desc { "default"; + color: 0 0 0 0; + hid; + } + desc { "blocked"; + color: 0 0 0 0; + vis; + } + } + } + programs { + program { "default"; + signal: "elm,state,default"; + source: "elm"; + script { + init(); + run_program(PROGRAM:"defaulted"); + set_mouse_events(PART:"event_block", 0); + set_repeat_events(PART:"event_block", 1); + set_state(PART:"event_block", "default", 0.0); + } + } + program { "defaulted"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "elm.text.1"; + target: "elm.padding.top"; + target: "elm.padding.bottom"; + target: "clipper.sub_text"; + } + program { "text_highlight"; + signal: "elm,state,highlighted"; + source: "elm"; + script { + if (!get_highlighted()) { + set_highlighted(1); + run_program(PROGRAM:"text_highlighting"); + } + } + } + program { "text_highlighting"; + action: STATE_SET "highlighting" 0.0; + target: "clipper.sub_text"; + target: "elm.padding.top"; + target: "elm.padding.bottom"; + after: "text_highlighted"; + } + program { "text_highlighted"; + transition: CUBIC_BEZIER LIST_HIGHLIGHT_DURATION_TIME 0 0 1 1; + action: STATE_SET "highlighted" 0.0; + target: "clipper.sub_text"; + target: "elm.padding.top"; + target: "elm.padding.bottom"; + after: "text_slide"; + } + program { "text_unhighlight"; + signal: "elm,state,unhighlighted"; + source: "elm"; + script { + if (get_highlighted()) { + set_highlighted(0); + slide_stop(); + run_program(PROGRAM:"text_unhighlighting"); + } + } + } + program { "text_unhighlighting"; + transition: CUBIC_BEZIER LIST_UNHIGHLIGHT_DURATION_TIME 0 0 1 1; + action: STATE_SET "highlighting" 0.0; + target: "clipper.sub_text"; + target: "elm.padding.top"; + target: "elm.padding.bottom"; + after: "text_unhighlighted"; + } + program { "text_unhighlighted"; + action: STATE_SET "default" 0.0; + target: "clipper.sub_text"; + target: "elm.padding.top"; + target: "elm.padding.bottom"; + } + program { "text_slide"; + source: "elm"; + signal: "elm,action,title,slide,start"; + script { + slide_start(0); + } + } + program { "text_slide_stop"; + source: "elm"; + signal: "elm,action,title,slide,stop"; + script { + slide_stop(); + } + } + program { "enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "elm.text.1"; + after: "set_enabled"; + } + program { "set_enabled"; + script { + set_disabled(0); + } + } + program { "disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "elm.text"; + target: "elm.text.1"; + after: "set_disabled"; + } + program { "set_disabled"; + script { + set_disabled(1); + } + } + program { "play_sound"; + signal: "elm,state,clicked"; + source: "elm"; + script { + run_program(PROGRAM:"play_sample"); + } + } + program { "play_sample"; + action: RUN_PLUGIN "touch_sound"; + } + PROGRAM_LIST_EVENT + } +} +} diff --git a/sources/wearable/src/net/emulator.c b/sources/wearable/src/net/emulator.c index 467462d..1bb2695 100644 --- a/sources/wearable/src/net/emulator.c +++ b/sources/wearable/src/net/emulator.c @@ -175,6 +175,11 @@ int _wifi_manager_ap_set_ip_config_type(wifi_manager_ap_h ap, wifi_manager_addre return WIFI_MANAGER_ERROR_NONE; } +int _wifi_manager_ap_set_dns_config_type(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, wifi_manager_dns_config_type_e type) +{ + return WIFI_MANAGER_ERROR_NONE; +} + int _wifi_manager_ap_get_ip_address(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, char** ip_address) { return WIFI_MANAGER_ERROR_NONE; @@ -195,6 +200,11 @@ int _wifi_manager_ap_set_subnet_mask(wifi_manager_ap_h ap, wifi_manager_address_ return WIFI_MANAGER_ERROR_NONE; } +int _wifi_manager_ap_set_prefix_length(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, int length) +{ + return WIFI_MANAGER_ERROR_NONE; +} + int _wifi_manager_ap_get_gateway_address(wifi_manager_ap_h ap, wifi_manager_address_family_e address_family, char** gateway_address) { return WIFI_MANAGER_ERROR_NONE; diff --git a/sources/wearable/src/net/util/wifi_address.c b/sources/wearable/src/net/util/wifi_address.c index 665a097..bc51ef4 100755 --- a/sources/wearable/src/net/util/wifi_address.c +++ b/sources/wearable/src/net/util/wifi_address.c @@ -25,15 +25,21 @@ struct _wifi_address_object { gboolean is_static_ip; + gboolean is_static_ipv6; gboolean is_proxy_manual; wifi_manager_security_type_e sec_type; wifi_manager_eap_type_e eap_type; gchar *password; gchar *ip_address; + gchar *ipv6_address; gchar *gateway_address; + gchar *ipv6_gateway_address; gchar *subnet_mask; + gchar *network_prefix_length; gchar *dns_address1; gchar *dns_address2; + gchar *ipv6_dns_address1; + gchar *ipv6_dns_address2; gchar *proxy_address; gchar *proxy_port; }; @@ -49,16 +55,21 @@ void wifi_address_free(wifi_address_object *object) g_free(object->password); g_free(object->ip_address); + g_free(object->ipv6_address); g_free(object->gateway_address); + g_free(object->ipv6_gateway_address); g_free(object->subnet_mask); + g_free(object->network_prefix_length); g_free(object->dns_address1); + g_free(object->ipv6_dns_address1); g_free(object->dns_address2); + g_free(object->ipv6_dns_address2); g_free(object->proxy_address); g_free(object->proxy_port); g_free(object); } -wifi_address_object *wifi_address_clone(wifi_address_object *self) +wifi_address_object *wifi_address_clone(wifi_address_object *self, gboolean is_ipv6) { wifi_address_object *clone = wifi_address_new(); WIFI_RET_VAL_IF_FAIL(clone, NULL); @@ -73,6 +84,14 @@ wifi_address_object *wifi_address_clone(wifi_address_object *self) wifi_address_set_subnet_mask(clone, self->subnet_mask); wifi_address_set_dns_address(clone, self->dns_address1, 1); wifi_address_set_dns_address(clone, self->dns_address2, 2); + if (is_ipv6) { + wifi_address_set_ipv6_address(clone, self->ipv6_address); + wifi_address_set_ipv6_gateway_address(clone, self->ipv6_gateway_address); + wifi_address_set_prefix_length(clone, self->network_prefix_length); + wifi_address_set_ipv6_dns_address(clone, self->ipv6_dns_address1, 1); + wifi_address_set_ipv6_dns_address(clone, self->ipv6_dns_address2, 2); + + } } wifi_address_set_proxy_address(clone, self->proxy_address); wifi_address_set_proxy_port(clone, self->proxy_port); @@ -85,6 +104,19 @@ gboolean wifi_address_is_static_ip(wifi_address_object *self) return self->is_static_ip; } +gboolean wifi_address_is_static_ipv6(wifi_address_object *self) +{ + WIFI_RET_VAL_IF_FAIL(self, FALSE); + return self->is_static_ipv6; +} + +void wifi_address_set_static_ipv6(wifi_address_object *self, gboolean is_static_ipv6) +{ + WIFI_RET_IF_FAIL(self); + + self->is_static_ipv6 = is_static_ipv6; +} + void wifi_address_set_static_ip(wifi_address_object *self, gboolean is_static_ip) { WIFI_RET_IF_FAIL(self); @@ -147,6 +179,22 @@ void wifi_address_set_password(wifi_address_object *self, const gchar *password) self->password = g_strdup(password); } +const gchar *wifi_address_get_ipv6_address(wifi_address_object *self) +{ + WIFI_RET_VAL_IF_FAIL(self, NULL); + return self->ipv6_address; +} + +void wifi_address_set_ipv6_address(wifi_address_object *self, const gchar *ipv6_address) +{ + WIFI_RET_IF_FAIL(self); + WIFI_RET_IF_FAIL(ipv6_address); + + if (self->ipv6_address) + g_free(self->ipv6_address); + self->ipv6_address = g_strdup(ipv6_address); +} + const gchar *wifi_address_get_ip_address(wifi_address_object *self) { WIFI_RET_VAL_IF_FAIL(self, NULL); @@ -163,6 +211,22 @@ void wifi_address_set_ip_address(wifi_address_object *self, const gchar *ip_addr self->ip_address = g_strdup(ip_address); } +const gchar *wifi_address_get_ipv6_gateway_address(wifi_address_object *self) +{ + WIFI_RET_VAL_IF_FAIL(self, NULL); + return self->ipv6_gateway_address; +} + +void wifi_address_set_ipv6_gateway_address(wifi_address_object *self, const gchar *ipv6_gateway_address) +{ + WIFI_RET_IF_FAIL(self); + WIFI_RET_IF_FAIL(ipv6_gateway_address); + + if (self->ipv6_gateway_address) + g_free(self->ipv6_gateway_address); + self->ipv6_gateway_address = g_strdup(ipv6_gateway_address); +} + const gchar *wifi_address_get_gateway_address(wifi_address_object *self) { WIFI_RET_VAL_IF_FAIL(self, NULL); @@ -179,6 +243,22 @@ void wifi_address_set_gateway_address(wifi_address_object *self, const gchar *ga self->gateway_address = g_strdup(gateway_address); } +const gchar *wifi_address_get_prefix_length(wifi_address_object *self) +{ + WIFI_RET_VAL_IF_FAIL(self, NULL); + return self->network_prefix_length; +} + +void wifi_address_set_prefix_length(wifi_address_object *self, const gchar *network_prefix_length) +{ + WIFI_RET_IF_FAIL(self); + WIFI_RET_IF_FAIL(network_prefix_length); + + if (self->subnet_mask) + g_free(self->network_prefix_length); + self->network_prefix_length = g_strdup(network_prefix_length); +} + const gchar *wifi_address_get_subnet_mask(wifi_address_object *self) { WIFI_RET_VAL_IF_FAIL(self, NULL); @@ -195,6 +275,38 @@ void wifi_address_set_subnet_mask(wifi_address_object *self, const gchar *subnet self->subnet_mask = g_strdup(subnet_mask); } +const gchar *wifi_address_get_ipv6_dns_address(wifi_address_object *self, gint order) +{ + WIFI_RET_VAL_IF_FAIL(self, NULL); + + if (order == 1) + return self->ipv6_dns_address1; + else if (order == 2) + return self->ipv6_dns_address2; + WIFI_LOG_ERR("Invaild order[%d] of dns address.", order); + return NULL; +} + +void wifi_address_set_ipv6_dns_address(wifi_address_object *self, const gchar *dns, gint order) +{ + WIFI_RET_IF_FAIL(self); + WIFI_RET_IF_FAIL(dns); + + if (order == 1) { + if (self->ipv6_dns_address1) + g_free(self->ipv6_dns_address1); + + self->ipv6_dns_address1 = g_strdup(dns); + } else if (order == 2) { + if (self->ipv6_dns_address2) + g_free(self->ipv6_dns_address2); + + self->ipv6_dns_address2 = g_strdup(dns); + } else { + WIFI_LOG_ERR("Invaild order[%d] of dns address.", order); + } +} + const gchar *wifi_address_get_dns_address(wifi_address_object *self, gint order) { WIFI_RET_VAL_IF_FAIL(self, NULL); diff --git a/sources/wearable/src/net/wifi_manager.c b/sources/wearable/src/net/wifi_manager.c index ac7db83..650ad14 100755 --- a/sources/wearable/src/net/wifi_manager.c +++ b/sources/wearable/src/net/wifi_manager.c @@ -1063,12 +1063,13 @@ gchar *wifi_ap_get_ip_address(wifi_ap_object *ap_obj) return ip_address; } -void wifi_ap_set_ip_address(wifi_ap_object *ap_obj, const gchar *ip_address) +void wifi_ap_set_ip_address(wifi_ap_object *ap_obj, const gchar *ip_address, + wifi_manager_address_family_e address_family) { wifi_manager_error_e err; WIFI_RET_IF_FAIL(ap_obj); - err = IS_EMU(wifi_manager_ap_set_ip_address(ap_obj->ap, WIFI_MANAGER_ADDRESS_FAMILY_IPV4, ip_address)); + err = IS_EMU(wifi_manager_ap_set_ip_address(ap_obj->ap, address_family, ip_address)); if (err != WIFI_MANAGER_ERROR_NONE) { WIFI_LOG_ERR("wifi_manager_ap_set_ip_address() is failed. error = %s", wifi_error_to_string(err)); @@ -1093,12 +1094,13 @@ gchar *wifi_ap_get_gateway_address(wifi_ap_object *ap_obj) return gateway; } -void wifi_ap_set_gateway_address(wifi_ap_object *ap_obj, const gchar *gateway_address) +void wifi_ap_set_gateway_address(wifi_ap_object *ap_obj, const gchar *gateway_address, + wifi_manager_address_family_e address_family) { wifi_manager_error_e err; WIFI_RET_IF_FAIL(ap_obj); - err = IS_EMU(wifi_manager_ap_set_gateway_address(ap_obj->ap, WIFI_MANAGER_ADDRESS_FAMILY_IPV4, gateway_address)); + err = IS_EMU(wifi_manager_ap_set_gateway_address(ap_obj->ap, address_family, gateway_address)); if (err != WIFI_MANAGER_ERROR_NONE) { WIFI_LOG_ERR("wifi_manager_ap_set_gateway_address() is failed. error = %s", wifi_error_to_string(err)); @@ -1123,6 +1125,18 @@ gchar *wifi_ap_get_subnet_mask(wifi_ap_object *ap_obj) return subnet_mask; } +void wifi_ap_set_prefix_length(wifi_ap_object *ap_obj, const gchar *length) +{ + wifi_manager_error_e err; + WIFI_RET_IF_FAIL(ap_obj); + + err = IS_EMU(wifi_manager_ap_set_prefix_length(ap_obj->ap, WIFI_MANAGER_ADDRESS_FAMILY_IPV6, atoi(length))); + if (err != WIFI_MANAGER_ERROR_NONE) { + WIFI_LOG_ERR("wifi_manager_ap_set_network_prefix_length() is failed. error = %s", + wifi_error_to_string(err)); + } +} + void wifi_ap_set_subnet_mask(wifi_ap_object *ap_obj, const gchar *subnet_mask) { wifi_manager_error_e err; @@ -1153,12 +1167,13 @@ gchar *wifi_ap_get_dns_address(wifi_ap_object *ap_obj, gint order) return dns_address; } -void wifi_ap_set_dns_address(wifi_ap_object *ap_obj, const gchar *dns_address, gint order) +void wifi_ap_set_dns_address(wifi_ap_object *ap_obj, const gchar *dns_address, gint order, + wifi_manager_address_family_e address_family) { wifi_manager_error_e err; WIFI_RET_IF_FAIL(ap_obj); - err = IS_EMU(wifi_manager_ap_set_dns_address(ap_obj->ap, order, WIFI_MANAGER_ADDRESS_FAMILY_IPV4, dns_address)); + err = IS_EMU(wifi_manager_ap_set_dns_address(ap_obj->ap, order, address_family, dns_address)); if (err != WIFI_MANAGER_ERROR_NONE) { WIFI_LOG_ERR("wifi_manager_ap_set_dns_address() is failed. error = %s", wifi_error_to_string(err)); @@ -1180,12 +1195,26 @@ wifi_manager_ip_config_type_e wifi_ap_get_ip_config(wifi_ap_object *ap_obj) return config_type; } -void wifi_ap_set_ip_config(wifi_ap_object *ap_obj, wifi_manager_ip_config_type_e config_type) +static void wifi_ap_set_dns_config(wifi_ap_object *ap_obj, wifi_manager_dns_config_type_e config_type, + wifi_manager_address_family_e address_family) +{ + wifi_manager_error_e err; + WIFI_RET_IF_FAIL(ap_obj); + err = IS_EMU(wifi_manager_ap_set_dns_config_type(ap_obj->ap, + address_family, config_type)); + if (err != WIFI_MANAGER_ERROR_NONE) { + WIFI_LOG_ERR("wifi_manager_ap_set_dns_config_type() is failed. error = %s", + wifi_error_to_string(err)); + } +} + +static void wifi_ap_set_ip_config(wifi_ap_object *ap_obj, wifi_manager_ip_config_type_e config_type, + wifi_manager_address_family_e address_family) { wifi_manager_error_e err; WIFI_RET_IF_FAIL(ap_obj); err = IS_EMU(wifi_manager_ap_set_ip_config_type(ap_obj->ap, - WIFI_MANAGER_ADDRESS_FAMILY_IPV4, config_type)); + address_family, config_type)); if (err != WIFI_MANAGER_ERROR_NONE) { WIFI_LOG_ERR("wifi_manager_ap_set_ip_config_type() is failed. error = %s", wifi_error_to_string(err)); @@ -1197,9 +1226,14 @@ bool wifi_ap_is_ip_config_static(wifi_ap_object *ap_obj) return wifi_ap_get_ip_config(ap_obj) == WIFI_MANAGER_IP_CONFIG_TYPE_STATIC; } -void wifi_ap_set_ip_config_static(wifi_ap_object *ap_obj) +void wifi_ap_set_dns_config_static(wifi_ap_object *ap_obj, wifi_manager_address_family_e address_family) +{ + wifi_ap_set_dns_config(ap_obj, WIFI_MANAGER_DNS_CONFIG_TYPE_STATIC, address_family); +} + +void wifi_ap_set_ip_config_static(wifi_ap_object *ap_obj, wifi_manager_address_family_e address_family) { - wifi_ap_set_ip_config(ap_obj, WIFI_MANAGER_IP_CONFIG_TYPE_STATIC); + wifi_ap_set_ip_config(ap_obj, WIFI_MANAGER_IP_CONFIG_TYPE_STATIC, address_family); } wifi_manager_proxy_type_e wifi_ap_get_proxy_type(wifi_ap_object *ap_obj) diff --git a/sources/wearable/src/wearable-circle/app_main.c b/sources/wearable/src/wearable-circle/app_main.c index 35b390f..2952247 100644 --- a/sources/wearable/src/wearable-circle/app_main.c +++ b/sources/wearable/src/wearable-circle/app_main.c @@ -93,11 +93,14 @@ typedef struct { Evas_Object *checkbox_power; Evas_Object *checkbox_proxy; Evas_Object *checkbox_static_ip; + Evas_Object *checkbox_ipv6; // app control app_control_h app_control; } app_object; +static Elm_Entry_Filter_Accept_Set ipv6_hex_accept_set = {.accepted = "0123456789abcdefABCDEF", .rejected = NULL }; + static gboolean _app_network_init(app_object *app_obj); static gboolean _app_network_callbacks_init_for_view(app_object *app_obj); @@ -1346,21 +1349,43 @@ static gboolean __is_valid_password_length_for_connect_button(const gchar *passw } static gboolean _wifi_manager_ap_update_address_for_connect(wifi_manager_object *manager, - wifi_ap_object *ap, wifi_address_object *address) + wifi_ap_object *ap, wifi_address_object *address) { wifi_manager_security_type_e sec_type = wifi_address_get_security_type(address); + gboolean is_ipv6 = wifi_address_is_static_ipv6(address); if (wifi_address_is_static_ip(address)) { - const gchar *dns2_address; - wifi_ap_set_ip_config_static(ap); - wifi_ap_set_ip_address(ap, wifi_address_get_ip_address(address)); - wifi_ap_set_gateway_address(ap, wifi_address_get_gateway_address(address)); - wifi_ap_set_subnet_mask(ap, wifi_address_get_subnet_mask(address)); - wifi_ap_set_dns_address(ap, wifi_address_get_dns_address(address, 1), 1); - - dns2_address = wifi_address_get_dns_address(address, 2); - if (dns2_address != NULL) - wifi_ap_set_dns_address(ap, dns2_address, 2); + if (!is_ipv6) { + const gchar *dns2_address; + wifi_ap_set_ip_config_static(ap, WIFI_MANAGER_ADDRESS_FAMILY_IPV4); + wifi_ap_set_dns_config_static(ap, WIFI_MANAGER_ADDRESS_FAMILY_IPV4); + wifi_ap_set_ip_address(ap, wifi_address_get_ip_address(address), + WIFI_MANAGER_ADDRESS_FAMILY_IPV4); + wifi_ap_set_gateway_address(ap, wifi_address_get_gateway_address(address), + WIFI_MANAGER_ADDRESS_FAMILY_IPV4); + wifi_ap_set_subnet_mask(ap, wifi_address_get_subnet_mask(address)); + wifi_ap_set_dns_address(ap, wifi_address_get_dns_address(address, 1), 1, + WIFI_MANAGER_ADDRESS_FAMILY_IPV4); + + dns2_address = wifi_address_get_dns_address(address, 2); + if (dns2_address != NULL) + wifi_ap_set_dns_address(ap, dns2_address, 2, WIFI_MANAGER_ADDRESS_FAMILY_IPV4); + } else { + const gchar *dns2_address; + wifi_ap_set_ip_config_static(ap, WIFI_MANAGER_ADDRESS_FAMILY_IPV6); + wifi_ap_set_dns_config_static(ap, WIFI_MANAGER_ADDRESS_FAMILY_IPV6); + wifi_ap_set_ip_address(ap, wifi_address_get_ipv6_address(address), + WIFI_MANAGER_ADDRESS_FAMILY_IPV6); + wifi_ap_set_gateway_address(ap, wifi_address_get_ipv6_gateway_address(address), + WIFI_MANAGER_ADDRESS_FAMILY_IPV6); + wifi_ap_set_prefix_length(ap, wifi_address_get_prefix_length(address)); + wifi_ap_set_dns_address(ap, wifi_address_get_ipv6_dns_address(address, 1), 1, + WIFI_MANAGER_ADDRESS_FAMILY_IPV6); + + dns2_address = wifi_address_get_ipv6_dns_address(address, 2); + if (dns2_address != NULL) + wifi_ap_set_dns_address(ap, dns2_address, 2, WIFI_MANAGER_ADDRESS_FAMILY_IPV6); + } } if (wifi_address_is_proxy_manual(address)) { @@ -1539,7 +1564,7 @@ static void _wifi_reserve_connect_to_selected_ap(app_object *app_obj, if (app_obj->address_for_connect) { if (!_wifi_manager_ap_update_address_for_connect(app_obj->wifi_manager, - app_obj->connect_reserve_wifi_ap, app_obj->address_for_connect)) { + app_obj->connect_reserve_wifi_ap, app_obj->address_for_connect)) { WIFI_LOG_ERR("AP address update failed."); _wifi_connect_reserve_ap_destroy(app_obj); return; @@ -1583,7 +1608,7 @@ static void _wifi_connect_to_selected_ap(app_object *app_obj) if (app_obj->address_for_connect) { if (!_wifi_manager_ap_update_address_for_connect(app_obj->wifi_manager, - app_obj->connecting_wifi_ap, app_obj->address_for_connect)) { + app_obj->connecting_wifi_ap, app_obj->address_for_connect)) { WIFI_LOG_ERR("AP address update failed."); _wifi_connecting_ap_destroy(app_obj); return; @@ -2513,6 +2538,21 @@ static char *__static_ip_menu_ip_address_text_get_cb(void *data, Evas_Object *ob return NULL; } +static char *__static_ip_menu_ipv6_address_text_get_cb(void *data, Evas_Object *obj, const char *part) +{ + app_object *app_obj = data; + WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL); + + if (!g_strcmp0(part, "elm.text")) { + return g_strdup(STR_IP_ADDRESS); + } else if (!g_strcmp0(part, "elm.text.1")) { + return _make_static_ip_menu_text( + wifi_address_get_ipv6_address(app_obj->address_for_edit), + DEFAULT_GUIDE_IPV6_ADDRESS); + } + return NULL; +} + static char *__static_ip_menu_gateway_address_text_get_cb(void *data, Evas_Object *obj, const char *part) { app_object *app_obj = data; @@ -2528,6 +2568,36 @@ static char *__static_ip_menu_gateway_address_text_get_cb(void *data, Evas_Objec return NULL; } +static char *__static_ipv6_menu_gateway_address_text_get_cb(void *data, Evas_Object *obj, const char *part) +{ + app_object *app_obj = data; + WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL); + + if (!g_strcmp0(part, "elm.text")) { + return g_strdup(STR_GATYEWAY); + } else if (!g_strcmp0(part, "elm.text.1")) { + return _make_static_ip_menu_text( + wifi_address_get_ipv6_gateway_address(app_obj->address_for_edit), + DEFAULT_GUIDE_IPV6_ADDRESS); + } + return NULL; +} + +static char *__static_ip_menu_network_prefix_text_get_cb(void *data, Evas_Object *obj, const char *part) +{ + app_object *app_obj = data; + WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL); + + if (!g_strcmp0(part, "elm.text")) { + return g_strdup(STR_NETWORK_PREFIX_LENGTH); + } else if (!g_strcmp0(part, "elm.text.1")) { + return _make_static_ip_menu_text( + wifi_address_get_prefix_length(app_obj->address_for_edit), + DEFAULT_GUIDE_NETWORK_PREFIX_LENGTH); + } + return NULL; +} + static char *__static_ip_menu_subnet_mask_text_get_cb(void *data, Evas_Object *obj, const char *part) { app_object *app_obj = data; @@ -2543,6 +2613,36 @@ static char *__static_ip_menu_subnet_mask_text_get_cb(void *data, Evas_Object *o return NULL; } +static char *__static_ipv6_menu_dns1_text_get_cb(void *data, Evas_Object *obj, const char *part) +{ + app_object *app_obj = data; + WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL); + + if (!g_strcmp0(part, "elm.text")) { + return g_strdup_printf(STR_DNS, 1); + } else if (!g_strcmp0(part, "elm.text.1")) { + return _make_static_ip_menu_text( + wifi_address_get_ipv6_dns_address(app_obj->address_for_edit, 1), + DEFAULT_GUIDE_IPV6_ADDRESS); + } + return NULL; +} + +static char *__static_ipv6_menu_dns2_text_get_cb(void *data, Evas_Object *obj, const char *part) +{ + app_object *app_obj = data; + WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL); + + if (!g_strcmp0(part, "elm.text")) { + return g_strdup_printf(STR_DNS, 2); + } else if (!g_strcmp0(part, "elm.text.1")) { + return _make_static_ip_menu_text( + wifi_address_get_ipv6_dns_address(app_obj->address_for_edit, 2), + DEFAULT_GUIDE_IPV6_ADDRESS); + } + return NULL; +} + static char *__static_ip_menu_dns1_text_get_cb(void *data, Evas_Object *obj, const char *part) { app_object *app_obj = data; @@ -2585,6 +2685,118 @@ static gboolean __is_valid_static_ip_string_length(const gchar *text) return TRUE; } +static void __static_ipv6_wearable_subnet_input_changed_cb(void *data, Evas_Object *obj, + void *event_info) +{ + app_object *app_obj = data; + int i = 0; + int ip_addr = 0; + char entry_ip_text[36] = { 0, }; + gboolean fixed = FALSE; + char *entry_text = NULL; + int length = 0; + WIFI_RET_IF_FAIL(app_obj != NULL); + WIFI_RET_IF_FAIL(obj != NULL); + + entry_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj)); + if (!__is_valid_static_ip_string_length(entry_text)) { + WIFI_LOG_ERR("Invalid IP address."); + layout_wearable_input_set_input_return_key_enable(app_obj->wearable_input, EINA_FALSE); + free(entry_text); + return; + } + + + ip_addr = atoi(entry_text); + + if (ip_addr > 24) { + length = strlen(entry_text); + entry_text[length - 1] = '\n'; + ip_addr = atoi(entry_text); + fixed = TRUE; + } + g_snprintf(entry_text, 3, "%d", ip_addr); + g_strlcat(entry_ip_text, entry_text, sizeof(entry_ip_text)); + + if (fixed) { + i = elm_entry_cursor_pos_get(obj); + elm_entry_entry_set(obj, entry_ip_text); + elm_entry_cursor_pos_set(obj, i + 1); + layout_wearable_input_set_input_return_key_enable(app_obj->wearable_input, + __is_valid_static_ip_string_length(entry_ip_text)); + } else { + layout_wearable_input_set_input_return_key_enable(app_obj->wearable_input, + __is_valid_static_ip_string_length(entry_text)); + } + g_free(entry_text); +} +static void __static_ipv6_wearable_input_changed_cb(void *data, Evas_Object *obj, + void *event_info) +{ + app_object *app_obj = data; + int i = 0; + int ip_addr[8] = { 0 }; + char entry_ip_text[41] = { 0, }; + gboolean fixed = FALSE; + char *entry_text = NULL; + char **ip_text = NULL; + char saved = '\n'; + int length = 0; + WIFI_RET_IF_FAIL(app_obj != NULL); + WIFI_RET_IF_FAIL(obj != NULL); + + entry_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj)); + if (!__is_valid_static_ip_string_length(entry_text)) { + WIFI_LOG_ERR("Invalid IP address."); + layout_wearable_input_set_input_return_key_enable(app_obj->wearable_input, EINA_FALSE); + free(entry_text); + return; + } + ip_text = g_strsplit(entry_text, ":", 9); + for (i = 0; i < 9; i++) { + if (ip_text[i] == NULL) + break; + + if (i == 8) { + fixed = TRUE; + break; + } + + ip_addr[i] = (int)strtol(ip_text[i], NULL, 16); + + if (ip_addr[i] > 65535) { + length = strlen(ip_text[i]); + saved = ip_text[i][length - 1]; + ip_text[i][length - 1] = '\n'; + ip_addr[i] = (int)strtol(ip_text[i], NULL, 16); + fixed = TRUE; + } + + if (i < 7) { + if (saved == '\n') + g_snprintf(entry_text, 6, "%x:", ip_addr[i]); + else + g_snprintf(entry_text, 7, "%x:%c", ip_addr[i], saved); + } else + g_snprintf(entry_text, 5, "%x", ip_addr[i]); + + g_strlcat(entry_ip_text, entry_text, sizeof(entry_ip_text)); + } + + if (fixed) { + i = elm_entry_cursor_pos_get(obj); + elm_entry_entry_set(obj, entry_ip_text); + elm_entry_cursor_pos_set(obj, i + 1); + layout_wearable_input_set_input_return_key_enable(app_obj->wearable_input, + __is_valid_static_ip_string_length(entry_ip_text)); + } else { + layout_wearable_input_set_input_return_key_enable(app_obj->wearable_input, + __is_valid_static_ip_string_length(entry_text)); + } + g_free(entry_text); + g_strfreev(ip_text); +} + static void __static_ip_wearable_input_changed_cb(void *data, Evas_Object *obj, void *event_info) { @@ -2669,6 +2881,72 @@ static gchar *_make_gateway_address_use_ip_address(const gchar *ip_address) ip_addr[2]); } +static void __static_ipv6_wearable_input_activated_cb(void *data, Evas_Object *obj, + void *event_info) +{ + app_object *app_obj = data; + static_ip_menu_type selected_menu; + gchar *ip_addr_text = NULL; + + __WIFI_FUNC_ENTER__; + WIFI_RET_IF_FAIL(app_obj != NULL); + + ip_addr_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj)); + if (!__is_valid_static_ip_string_length(ip_addr_text)) { + WIFI_LOG_ERR("Invalid IP address."); + free(ip_addr_text); + return; + } + + selected_menu = layout_static_ip_get_selected_menu(app_obj->static_ip); + switch (selected_menu) { + case STATIC_IP_ITEM_IP_ADDRESS: + wifi_address_set_ipv6_address(app_obj->address_for_edit, ip_addr_text); + if (wifi_address_get_ipv6_gateway_address(app_obj->address_for_edit) == NULL) { + gchar *gateway_address = _make_gateway_address_use_ip_address(ip_addr_text); + wifi_address_set_gateway_address(app_obj->address_for_edit, gateway_address); + layout_static_ip_update_menu(app_obj->static_ip, STATIC_IP_ITEM_GATEWAY); + g_free(gateway_address); + } + if (wifi_address_get_subnet_mask(app_obj->address_for_edit) == NULL) { + wifi_address_set_subnet_mask(app_obj->address_for_edit, DEFAULT_GUIDE_SUBNET_MASK); + layout_static_ip_update_menu(app_obj->static_ip, STATIC_IP_ITEM_SUBNET_MASK); + } + if (wifi_address_get_dns_address(app_obj->address_for_edit, 1) == NULL) { + wifi_address_set_dns_address(app_obj->address_for_edit, DEFAULT_GUIDE_DNS1, 1); + layout_static_ip_update_menu(app_obj->static_ip, STATIC_IP_ITEM_DNS1); + } + layout_static_ip_save_button_set_enable(app_obj->static_ip); + break; + + case STATIC_IP_ITEM_GATEWAY: + wifi_address_set_ipv6_gateway_address(app_obj->address_for_edit, ip_addr_text); + break; + + case STATIC_IP_ITEM_SUBNET_MASK: + wifi_address_set_prefix_length(app_obj->address_for_edit, ip_addr_text); + break; + + case STATIC_IP_ITEM_DNS1: + wifi_address_set_ipv6_dns_address(app_obj->address_for_edit, ip_addr_text, 1); + break; + + case STATIC_IP_ITEM_DNS2: + wifi_address_set_ipv6_dns_address(app_obj->address_for_edit, ip_addr_text, 2); + break; + + default: + WIFI_LOG_ERR("Invalid selected menu type = %d", selected_menu); + g_free(ip_addr_text); + layout_static_ip_pop_to(app_obj->static_ip); + return; + } + layout_static_ip_update_menu(app_obj->static_ip, selected_menu); + g_free(ip_addr_text); + + layout_static_ip_pop_to(app_obj->static_ip); +} + static void __static_ip_wearable_input_activated_cb(void *data, Evas_Object *obj, void *event_info) { @@ -2735,6 +3013,54 @@ static void __static_ip_wearable_input_activated_cb(void *data, Evas_Object *obj layout_static_ip_pop_to(app_obj->static_ip); } +static layout_wearable_input_object *_static_ipv6_wearable_input_create(app_object *app_obj, + const gchar *text, gboolean is_guide_text, static_ip_menu_type menu_item_type) +{ + layout_wearable_input_object *wearable_input = layout_wearable_input_new(app_obj->base); + if (!wearable_input) { + WIFI_LOG_ERR("layout_wearable_input_new() is failed."); + return NULL; + } + + layout_wearable_input_set_del_cb(wearable_input, + __wearable_input_del_cb, app_obj); + + if (menu_item_type == STATIC_IP_ITEM_SUBNET_MASK) + layout_wearable_input_set_input_type(wearable_input, ELM_INPUT_PANEL_LAYOUT_NUMBER); + else + layout_wearable_input_set_input_type(wearable_input, ELM_INPUT_PANEL_LAYOUT_NORMAL); + + if (is_guide_text) + layout_wearable_input_set_input_guide_text(wearable_input, text); + else + layout_wearable_input_set_input_text(wearable_input, text); + + layout_wearable_input_set_input_show(wearable_input, EINA_TRUE); + + if (menu_item_type == STATIC_IP_ITEM_SUBNET_MASK) + layout_wearable_input_set_input_changed_cb(wearable_input, + __static_ipv6_wearable_subnet_input_changed_cb, app_obj); + else + layout_wearable_input_set_input_changed_cb(wearable_input, + __static_ipv6_wearable_input_changed_cb, app_obj); + + layout_wearable_input_set_input_activated_cb(wearable_input, + __static_ipv6_wearable_input_activated_cb, app_obj); + + if (!layout_wearable_input_create(wearable_input)) { + WIFI_LOG_ERR("layout_wearable_input_create() is failed."); + layout_wearable_input_free(wearable_input); + return NULL; + } + + layout_wearable_input_filter_set(wearable_input, &ipv6_hex_accept_set); + + if (is_guide_text || !text || strlen(text) == 0) + layout_wearable_input_set_input_return_key_enable(wearable_input, EINA_FALSE); + + return wearable_input; +} + static layout_wearable_input_object *_static_ip_wearable_input_create(app_object *app_obj, const gchar *text, gboolean is_guide_text) { @@ -2772,6 +3098,31 @@ static layout_wearable_input_object *_static_ip_wearable_input_create(app_object return wearable_input; } +static const gchar *_static_ipv6_get_menu_text_by_menu_type(wifi_address_object *address, + static_ip_menu_type type) +{ + switch (type) { + case STATIC_IP_ITEM_IP_ADDRESS: + return wifi_address_get_ipv6_address(address); + + case STATIC_IP_ITEM_SUBNET_MASK: + return wifi_address_get_prefix_length(address); + + case STATIC_IP_ITEM_GATEWAY: + return wifi_address_get_ipv6_gateway_address(address); + + case STATIC_IP_ITEM_DNS1: + return wifi_address_get_ipv6_dns_address(address, 1); + + case STATIC_IP_ITEM_DNS2: + return wifi_address_get_ipv6_dns_address(address, 2); + + default: + WIFI_LOG_ERR("Invalid menu type. type = %d", type); + return NULL; + } +} + static const gchar *_static_ip_get_menu_text_by_menu_type(wifi_address_object *address, static_ip_menu_type type) { @@ -2797,6 +3148,30 @@ static const gchar *_static_ip_get_menu_text_by_menu_type(wifi_address_object *a } } +static const gchar *_static_ipv6_get_menu_guide_text_by_menu_type(static_ip_menu_type type) +{ + switch (type) { + case STATIC_IP_ITEM_IP_ADDRESS: + return DEFAULT_GUIDE_IPV6_ADDRESS; + + case STATIC_IP_ITEM_SUBNET_MASK: + return DEFAULT_GUIDE_NETWORK_PREFIX_LENGTH; + + case STATIC_IP_ITEM_GATEWAY: + return DEFAULT_GUIDE_IPV6_ADDRESS; + + case STATIC_IP_ITEM_DNS1: + return DEFAULT_GUIDE_IPV6_ADDRESS; + + case STATIC_IP_ITEM_DNS2: + return DEFAULT_GUIDE_IPV6_ADDRESS; + + default: + WIFI_LOG_ERR("Invalid menu type. type = %d", type); + return "0000:0000:0000:0000:0000:0000:0000:0000"; + } +} + static const gchar *_static_ip_get_menu_guide_text_by_menu_type(static_ip_menu_type type) { switch (type) { @@ -2821,6 +3196,49 @@ static const gchar *_static_ip_get_menu_guide_text_by_menu_type(static_ip_menu_t } } +static void __static_ipv6_menu_tap_cb(void *data, Evas_Object *obj, void *event_info) +{ + app_object *app_obj = data; + Elm_Object_Item *item = event_info; + static_ip_menu_type menu_item_type; + const gchar *ip_address_text; + + __WIFI_FUNC_ENTER__; + + WIFI_RET_IF_FAIL(app_obj); + WIFI_RET_IF_FAIL(item); + elm_genlist_item_selected_set(item, EINA_FALSE); + + WIFI_RET_IF_FAIL(app_obj->wearable_input == NULL); + + menu_item_type = layout_static_ip_get_menu_type(app_obj->static_ip, item); + if (menu_item_type <= STATIC_IP_ITEM_NONE || + menu_item_type >= STATIC_IP_ITEM_SIZE) { + WIFI_LOG_ERR("Invalid menu type. type = %d", menu_item_type); + return; + } + + ip_address_text = _static_ipv6_get_menu_text_by_menu_type(app_obj->address_for_edit, + menu_item_type); + if (ip_address_text != NULL) { + app_obj->wearable_input = _static_ipv6_wearable_input_create(app_obj, + ip_address_text, FALSE, menu_item_type); + } else { + app_obj->wearable_input = _static_ipv6_wearable_input_create(app_obj, + _static_ipv6_get_menu_guide_text_by_menu_type(menu_item_type), TRUE, + menu_item_type); + } + + if (app_obj->wearable_input) { + view_base_conformant_add_virtualkeypad_size_changed_cb(app_obj->base, + __virtualkeypad_size_changed_cb, app_obj); + layout_static_ip_select_menu(app_obj->static_ip, menu_item_type); + layout_static_ip_deactivate_rotary_event(app_obj->static_ip, EINA_TRUE); + layout_wearable_input_show(app_obj->wearable_input); + layout_wearable_input_set_input_focus(app_obj->wearable_input, EINA_TRUE); + } +} + static void __static_ip_menu_tap_cb(void *data, Evas_Object *obj, void *event_info) { app_object *app_obj = data; @@ -2844,27 +3262,51 @@ static void __static_ip_menu_tap_cb(void *data, Evas_Object *obj, void *event_in } ip_address_text = _static_ip_get_menu_text_by_menu_type(app_obj->address_for_edit, - menu_item_type); + menu_item_type); if (ip_address_text != NULL) { app_obj->wearable_input = _static_ip_wearable_input_create(app_obj, - ip_address_text, - FALSE); + ip_address_text, + FALSE); } else { app_obj->wearable_input = _static_ip_wearable_input_create(app_obj, - _static_ip_get_menu_guide_text_by_menu_type(menu_item_type), - TRUE); + _static_ip_get_menu_guide_text_by_menu_type(menu_item_type), + TRUE); } if (app_obj->wearable_input) { view_base_conformant_add_virtualkeypad_size_changed_cb(app_obj->base, __virtualkeypad_size_changed_cb, app_obj); layout_static_ip_select_menu(app_obj->static_ip, menu_item_type); - layout_static_ip_deactivate_rotary_event(app_obj->static_ip); + layout_static_ip_deactivate_rotary_event(app_obj->static_ip, EINA_FALSE); layout_wearable_input_show(app_obj->wearable_input); layout_wearable_input_set_input_focus(app_obj->wearable_input, EINA_TRUE); } } +static void __static_ipv6_save_button_tap_cb(void *data, Evas_Object *obj, void *event_info) +{ + app_object *app_obj = data; + + __WIFI_FUNC_ENTER__; + WIFI_RET_IF_FAIL(app_obj != NULL); + + wifi_address_set_static_ipv6(app_obj->address_for_connect, TRUE); + wifi_address_set_static_ip(app_obj->address_for_connect, TRUE); + wifi_address_set_ipv6_address(app_obj->address_for_connect, + wifi_address_get_ipv6_address(app_obj->address_for_edit)); + wifi_address_set_ipv6_gateway_address(app_obj->address_for_connect, + wifi_address_get_ipv6_gateway_address(app_obj->address_for_edit)); + wifi_address_set_prefix_length(app_obj->address_for_connect, + wifi_address_get_prefix_length(app_obj->address_for_edit)); + wifi_address_set_ipv6_dns_address(app_obj->address_for_connect, + wifi_address_get_ipv6_dns_address(app_obj->address_for_edit, 1), 1); + wifi_address_set_ipv6_dns_address(app_obj->address_for_connect, + wifi_address_get_ipv6_dns_address(app_obj->address_for_edit, 2), 2); + + layout_ap_info_pop_to(app_obj->ap_info); + layout_ap_info_menu_update(app_obj->ap_info, AP_INFO_MENU_STATIC); +} + static void __static_ip_save_button_tap_cb(void *data, Evas_Object *obj, void *event_info) { app_object *app_obj = data; @@ -2874,6 +3316,7 @@ static void __static_ip_save_button_tap_cb(void *data, Evas_Object *obj, void *e WIFI_RET_IF_FAIL(app_obj != NULL); wifi_address_set_static_ip(app_obj->address_for_connect, TRUE); + wifi_address_set_static_ipv6(app_obj->address_for_connect, FALSE); wifi_address_set_ip_address(app_obj->address_for_connect, wifi_address_get_ip_address(app_obj->address_for_edit)); wifi_address_set_gateway_address(app_obj->address_for_connect, @@ -2891,50 +3334,92 @@ static void __static_ip_save_button_tap_cb(void *data, Evas_Object *obj, void *e static layout_static_ip_object *_static_ip_create(app_object *app_obj) { + gboolean is_ipv6 = FALSE; layout_static_ip_object *static_ip = layout_static_ip_new(app_obj->base); if (!static_ip) { WIFI_LOG_ERR("layout_static_ip_new() is failed."); return NULL; } + if (elm_check_state_get(app_obj->checkbox_ipv6)) + is_ipv6 = TRUE; + + layout_static_ip_set_is_ipv6(static_ip, is_ipv6); + layout_static_ip_set_del_cb(static_ip, __static_ip_del_cb, app_obj); - layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_TITLE, - __general_title_menu_item_display_ssid_text_get_cb, NULL, NULL, NULL, app_obj); + if (!is_ipv6) { + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_TITLE, + __general_title_menu_item_display_ssid_text_get_cb, NULL, NULL, NULL, app_obj); + + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_IP_ADDRESS, + __static_ip_menu_ip_address_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_IP_ADDRESS, + __static_ip_menu_tap_cb, app_obj); + + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_SUBNET_MASK, + __static_ip_menu_subnet_mask_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_SUBNET_MASK, + __static_ip_menu_tap_cb, app_obj); + + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_GATEWAY, + __static_ip_menu_gateway_address_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_GATEWAY, + __static_ip_menu_tap_cb, app_obj); + + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_DNS1, + __static_ip_menu_dns1_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_DNS1, + __static_ip_menu_tap_cb, app_obj); + + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_DNS2, + __static_ip_menu_dns2_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_DNS2, + __static_ip_menu_tap_cb, app_obj); + } else { + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_TITLE, + __general_title_menu_item_display_ssid_text_get_cb, NULL, NULL, NULL, app_obj); + + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_IP_ADDRESS, + __static_ip_menu_ipv6_address_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_IP_ADDRESS, + __static_ipv6_menu_tap_cb, app_obj); - layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_IP_ADDRESS, - __static_ip_menu_ip_address_text_get_cb, NULL, NULL, NULL, app_obj); - layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_IP_ADDRESS, - __static_ip_menu_tap_cb, app_obj); + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_SUBNET_MASK, + __static_ip_menu_network_prefix_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_SUBNET_MASK, + __static_ipv6_menu_tap_cb, app_obj); - layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_SUBNET_MASK, - __static_ip_menu_subnet_mask_text_get_cb, NULL, NULL, NULL, app_obj); - layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_SUBNET_MASK, - __static_ip_menu_tap_cb, app_obj); + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_GATEWAY, + __static_ipv6_menu_gateway_address_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_GATEWAY, + __static_ipv6_menu_tap_cb, app_obj); - layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_GATEWAY, - __static_ip_menu_gateway_address_text_get_cb, NULL, NULL, NULL, app_obj); - layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_GATEWAY, - __static_ip_menu_tap_cb, app_obj); + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_DNS1, + __static_ipv6_menu_dns1_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_DNS1, + __static_ipv6_menu_tap_cb, app_obj); - layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_DNS1, - __static_ip_menu_dns1_text_get_cb, NULL, NULL, NULL, app_obj); - layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_DNS1, - __static_ip_menu_tap_cb, app_obj); + layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_DNS2, + __static_ipv6_menu_dns2_text_get_cb, NULL, NULL, NULL, app_obj); + layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_DNS2, + __static_ipv6_menu_tap_cb, app_obj); + } - layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_DNS2, - __static_ip_menu_dns2_text_get_cb, NULL, NULL, NULL, app_obj); - layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_DNS2, - __static_ip_menu_tap_cb, app_obj); layout_static_ip_set_menu_cb(static_ip, STATIC_IP_ITEM_EMPTY, NULL, NULL, NULL, NULL, NULL); layout_static_ip_set_tap_menu_cb(static_ip, STATIC_IP_ITEM_EMPTY, NULL, NULL); - layout_static_ip_set_tap_save_button_cb(static_ip, - __static_ip_save_button_tap_cb, app_obj); + + if (!is_ipv6) + layout_static_ip_set_tap_save_button_cb(static_ip, + __static_ip_save_button_tap_cb, app_obj); + else + layout_static_ip_set_tap_save_button_cb(static_ip, + __static_ipv6_save_button_tap_cb, app_obj); if (!layout_static_ip_create(static_ip)) { WIFI_LOG_ERR("layout_static_ip_create() is failed."); @@ -3017,15 +3502,16 @@ static void _wifi_address_for_edit_init_use_address(app_object *app_obj, wifi_ad { WIFI_RET_IF_FAIL(app_obj != NULL); + gboolean is_ipv6 = layout_static_ip_get_is_ipv6(app_obj->static_ip); + if (app_obj->address_for_edit) wifi_address_free(app_obj->address_for_edit); - app_obj->address_for_edit = wifi_address_clone(address); + app_obj->address_for_edit = wifi_address_clone(address, is_ipv6); } static void __ap_info_menu_static_checkbox_changed_cb(void *data, Evas_Object *obj, void *event_info) { app_object *app_obj = data; - __WIFI_FUNC_ENTER__; WIFI_RET_IF_FAIL(app_obj != NULL); @@ -3034,7 +3520,7 @@ static void __ap_info_menu_static_checkbox_changed_cb(void *data, Evas_Object *o app_obj->static_ip = _static_ip_create(app_obj); if (app_obj->static_ip) { _wifi_address_for_edit_init_use_address(app_obj, - app_obj->address_for_connect); + app_obj->address_for_connect); if (!wifi_address_is_static_ip(app_obj->address_for_edit)) layout_static_ip_save_button_set_disable(app_obj->static_ip); @@ -3046,6 +3532,15 @@ static void __ap_info_menu_static_checkbox_changed_cb(void *data, Evas_Object *o } } +static void __ap_info_menu_static_ipv6_checkbox_changed_cb(void *data, Evas_Object *obj, void *event_info) +{ + app_object *app_obj = data; + + __WIFI_FUNC_ENTER__; + WIFI_RET_IF_FAIL(app_obj != NULL); + +} + static char *__ap_info_menu_static_text_get_cb(void *data, Evas_Object *obj, const char *part) { gchar *tts_text; @@ -3065,6 +3560,52 @@ static char *__ap_info_menu_static_text_get_cb(void *data, Evas_Object *obj, con return g_strdup(STR_STATIC_IP); } +static char *__ap_info_menu_ipv6_text_get_cb(void *data, Evas_Object *obj, const char *part) +{ + gchar *tts_text; + app_object *app_obj = data; + WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL); + + if (elm_check_state_get(app_obj->checkbox_ipv6)) { + tts_text = g_strdup_printf("%s, %s", + STR_ON_FOR_TTS, STR_SWITCH_FOR_TTS); + } else { + tts_text = g_strdup_printf("%s, %s", + STR_OFF_FOR_TTS, STR_SWITCH_FOR_TTS); + } + layout_ap_info_menu_set_access_info(app_obj->ap_info, AP_INFO_MENU_IPV6, + ELM_ACCESS_CONTEXT_INFO, tts_text); + g_free(tts_text); + return g_strdup(STR_IPV6); +} + +static Evas_Object *__ap_info_menu_ipv6_content_get_cb(void *data, Evas_Object *obj, const char *part) +{ + app_object *app_obj = data; + WIFI_RET_VAL_IF_FAIL(app_obj != NULL, NULL); + + gboolean is_ipv6 = layout_static_ip_get_is_ipv6(app_obj->static_ip); + + if (!g_strcmp0(part, "elm.icon")) { + Evas_Object *checkbox = elm_check_add(obj); + elm_object_style_set(checkbox, "on&off/list"); + elm_check_state_set(checkbox, is_ipv6); + elm_access_object_unregister(checkbox); + + evas_object_propagate_events_set(checkbox, EINA_FALSE); + evas_object_size_hint_weight_set(checkbox, + EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(checkbox, + EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_smart_callback_add(checkbox, "changed", + __ap_info_menu_static_ipv6_checkbox_changed_cb, app_obj); + + app_obj->checkbox_ipv6 = checkbox; + return checkbox; + } + return NULL; +} + static Evas_Object *__ap_info_menu_static_content_get_cb(void *data, Evas_Object *obj, const char *part) { app_object *app_obj = data; @@ -3104,7 +3645,7 @@ static void __ap_info_menu_static_tap_cb(void *data, Evas_Object *obj, void *eve app_obj->static_ip = _static_ip_create(app_obj); if (app_obj->static_ip) { _wifi_address_for_edit_init_use_address(app_obj, - app_obj->address_for_connect); + app_obj->address_for_connect); if (!wifi_address_is_static_ip(app_obj->address_for_edit)) layout_static_ip_save_button_set_disable(app_obj->static_ip); layout_static_ip_show(app_obj->static_ip); @@ -3426,7 +3967,7 @@ static void __ap_info_menu_proxy_checkbox_changed_cb(void *data, Evas_Object *ob app_obj->proxy_setting = _proxy_setting_create(app_obj); if (app_obj->proxy_setting) { _wifi_address_for_edit_init_use_address(app_obj, - app_obj->address_for_connect); + app_obj->address_for_connect); layout_proxy_setting_show(app_obj->proxy_setting); } } else { @@ -3496,7 +4037,7 @@ static void __ap_info_menu_proxy_tap_cb(void *data, Evas_Object *obj, void *even app_obj->proxy_setting = _proxy_setting_create(app_obj); if (app_obj->proxy_setting) { _wifi_address_for_edit_init_use_address(app_obj, - app_obj->address_for_connect); + app_obj->address_for_connect); layout_proxy_setting_show(app_obj->proxy_setting); } } @@ -3575,6 +4116,11 @@ static layout_ap_info_object *_ap_info_create(app_object *app_obj, wifi_ap_objec __ap_info_menu_static_content_get_cb, NULL, NULL, __ap_info_menu_static_tap_cb, app_obj); + layout_ap_info_set_menu_cb(ap_info_obj, AP_INFO_MENU_IPV6, + __ap_info_menu_ipv6_text_get_cb, + __ap_info_menu_ipv6_content_get_cb, + NULL, NULL, + NULL, app_obj); layout_ap_info_set_menu_cb(ap_info_obj, AP_INFO_MENU_PROXY, __ap_info_menu_proxy_text_get_cb, __ap_info_menu_proxy_content_get_cb, diff --git a/sources/wearable/src/wearable-circle/view/base.c b/sources/wearable/src/wearable-circle/view/base.c index 50bd5d8..020b59a 100755 --- a/sources/wearable/src/wearable-circle/view/base.c +++ b/sources/wearable/src/wearable-circle/view/base.c @@ -294,6 +294,42 @@ gl_realized_cb(void *data, Evas_Object *obj, void *event_info) elm_object_item_signal_emit(it, "elm,action,title,slide,start", "elm"); } +Evas_Object *view_base_add_genlist_2text_multiline(view_base_object *self, Evas_Object *parent) +{ + Evas_Object *genlist = NULL; + WIFI_RET_VAL_IF_FAIL(self, NULL); + WIFI_RET_VAL_IF_FAIL(parent, NULL); + + genlist = create_genlist_use_edj_file(parent); + WIFI_RET_VAL_IF_FAIL(genlist, NULL); + + elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); + evas_object_smart_callback_add(genlist, "realized", gl_realized_cb, NULL); + + return genlist; +} + +Evas_Object *view_base_add_2text_multiline_genlist_for_circle(view_base_object *self, + Evas_Object *parent, Evas_Object **circle_genlist) +{ + Evas_Object *genlist = NULL; + WIFI_RET_VAL_IF_FAIL(self, NULL); + WIFI_RET_VAL_IF_FAIL(parent, NULL); + + genlist = view_base_add_genlist_2text_multiline(self, parent); + WIFI_RET_VAL_IF_FAIL(genlist, NULL); + *circle_genlist = eext_circle_object_genlist_add(genlist, self->circle_surface); + if (!(*circle_genlist)) { + evas_object_del(genlist); + return NULL; + } + eext_circle_object_genlist_scroller_policy_set(*circle_genlist, + ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); + eext_rotary_object_event_activated_set(*circle_genlist, EINA_TRUE); + + return genlist; +} + Evas_Object *view_base_add_genlist(view_base_object *self, Evas_Object *parent) { Evas_Object *genlist = NULL; diff --git a/sources/wearable/src/wearable-circle/view/layout_ap_info.c b/sources/wearable/src/wearable-circle/view/layout_ap_info.c index 8050a0b..70d3476 100755 --- a/sources/wearable/src/wearable-circle/view/layout_ap_info.c +++ b/sources/wearable/src/wearable-circle/view/layout_ap_info.c @@ -148,6 +148,7 @@ static void _append_menu(layout_ap_info_object *self, ap_info_menu_type type, break; case AP_INFO_MENU_STATIC: + case AP_INFO_MENU_IPV6: case AP_INFO_MENU_PROXY: itc = create_genlist_itc("1text.1icon.1", self->menu_cb[type].text_get, self->menu_cb[type].content_get, NULL, NULL); @@ -242,6 +243,7 @@ void layout_ap_info_open_show(layout_ap_info_object *self, void *menu_data) __WIFI_FUNC_ENTER__; _append_menu(self, AP_INFO_MENU_TITLE, menu_data); + _append_menu(self, AP_INFO_MENU_IPV6, menu_data); _append_menu(self, AP_INFO_MENU_STATIC, menu_data); _append_menu(self, AP_INFO_MENU_PROXY, menu_data); _append_menu(self, AP_INFO_MENU_EMPTY, menu_data); @@ -260,6 +262,7 @@ void layout_ap_info_wps_show(layout_ap_info_object *self, void *menu_data) _append_menu(self, AP_INFO_MENU_TITLE, menu_data); _append_menu(self, AP_INFO_MENU_PASSWORD, menu_data); _append_menu(self, AP_INFO_MENU_WPS, menu_data); + _append_menu(self, AP_INFO_MENU_IPV6, menu_data); _append_menu(self, AP_INFO_MENU_STATIC, menu_data); _append_menu(self, AP_INFO_MENU_PROXY, menu_data); _append_menu(self, AP_INFO_MENU_EMPTY, menu_data); @@ -278,6 +281,7 @@ void layout_ap_info_eap_show(layout_ap_info_object *self, void *menu_data) _append_menu(self, AP_INFO_MENU_TITLE, menu_data); _append_menu(self, AP_INFO_MENU_EAP, menu_data); + _append_menu(self, AP_INFO_MENU_IPV6, menu_data); _append_menu(self, AP_INFO_MENU_STATIC, menu_data); _append_menu(self, AP_INFO_MENU_PROXY, menu_data); _append_menu(self, AP_INFO_MENU_EMPTY, menu_data); @@ -296,6 +300,7 @@ void layout_ap_info_security_show(layout_ap_info_object *self, void *menu_data) _append_menu(self, AP_INFO_MENU_TITLE, menu_data); _append_menu(self, AP_INFO_MENU_PASSWORD, menu_data); + _append_menu(self, AP_INFO_MENU_IPV6, menu_data); _append_menu(self, AP_INFO_MENU_STATIC, menu_data); _append_menu(self, AP_INFO_MENU_PROXY, menu_data); _append_menu(self, AP_INFO_MENU_EMPTY, menu_data); diff --git a/sources/wearable/src/wearable-circle/view/layout_static_ip.c b/sources/wearable/src/wearable-circle/view/layout_static_ip.c index ac54ca7..de09a1e 100755 --- a/sources/wearable/src/wearable-circle/view/layout_static_ip.c +++ b/sources/wearable/src/wearable-circle/view/layout_static_ip.c @@ -37,6 +37,7 @@ struct _layout_static_ip_object { Elm_Object_Item *menu_item[STATIC_IP_ITEM_SIZE]; Evas_Object *save_button; static_ip_menu_type selected_menu; + gboolean is_ipv6; struct { Evas_Object_Event_Cb func; @@ -81,7 +82,11 @@ static Evas_Object *_create_menu_list(layout_static_ip_object *self, Evas_Object { Evas_Object *menu_list = NULL; - menu_list = view_base_add_genlist_for_circle(self->base, parent, &(self->menu_list_circle)); + if (layout_static_ip_get_is_ipv6(self)) + menu_list = view_base_add_2text_multiline_genlist_for_circle(self->base, parent, &(self->menu_list_circle)); + else + menu_list = view_base_add_genlist_for_circle(self->base, parent, &(self->menu_list_circle)); + WIFI_RET_VAL_IF_FAIL(menu_list, NULL); evas_object_show(menu_list); @@ -292,10 +297,24 @@ void layout_static_ip_activate_rotary_event(layout_static_ip_object *self) eext_rotary_object_event_activated_set(self->menu_list_circle, EINA_TRUE); } -void layout_static_ip_deactivate_rotary_event(layout_static_ip_object *self) +void layout_static_ip_deactivate_rotary_event(layout_static_ip_object *self, Eina_Bool val) +{ + WIFI_RET_IF_FAIL(self); + eext_rotary_object_event_activated_set(self->menu_list_circle, val); +} + +void layout_static_ip_set_is_ipv6(layout_static_ip_object *self, gboolean is_ipv6) { WIFI_RET_IF_FAIL(self); - eext_rotary_object_event_activated_set(self->menu_list_circle, EINA_FALSE); + + self->is_ipv6 = is_ipv6; +} + +gboolean layout_static_ip_get_is_ipv6(layout_static_ip_object *self) +{ + WIFI_RET_VAL_IF_FAIL(self, FALSE); + + return self->is_ipv6; } void layout_static_ip_set_del_cb(layout_static_ip_object *self, diff --git a/sources/wearable/src/wearable-circle/view/layout_wearable_input.c b/sources/wearable/src/wearable-circle/view/layout_wearable_input.c index 48aa795..bdfe452 100755 --- a/sources/wearable/src/wearable-circle/view/layout_wearable_input.c +++ b/sources/wearable/src/wearable-circle/view/layout_wearable_input.c @@ -234,6 +234,17 @@ gboolean layout_wearable_input_create(layout_wearable_input_object *self) return TRUE; } +gboolean layout_wearable_input_filter_set(layout_wearable_input_object *self, void *accept_set) +{ + + WIFI_RET_VAL_IF_FAIL(self, FALSE); + + WIFI_RET_VAL_IF_FAIL(self->editfield, FALSE); + elm_entry_markup_filter_append(self->editfield, elm_entry_filter_accept_set, accept_set); + return TRUE; +} + + void layout_wearable_input_destroy(layout_wearable_input_object *self) { WIFI_RET_IF_FAIL(self); diff --git a/sources/wearable/src/wearable-circle/view/util/efl_helper.c b/sources/wearable/src/wearable-circle/view/util/efl_helper.c index c869998..7042f6c 100755 --- a/sources/wearable/src/wearable-circle/view/util/efl_helper.c +++ b/sources/wearable/src/wearable-circle/view/util/efl_helper.c @@ -78,6 +78,12 @@ gboolean get_edj_circle_button_path(gchar *edj_path, gsize edj_path_length) edj_path, edj_path_length, EDJ_PATH, EDJ_CIRCLE_BUTTON_FILE); } +gboolean get_edj_genlist_path(gchar *edj_path, gsize edj_path_length) +{ + return _make_path_append_to_app_resource_path( + edj_path, edj_path_length, EDJ_PATH, EDJ_GENLIST); +} + gboolean get_image_path(gchar *image_path, gsize image_path_length, const gchar *image_file) { @@ -152,3 +158,21 @@ Evas_Object *create_circle_button_use_edj_file(Evas_Object *parent) return button; } + +Evas_Object *create_genlist_use_edj_file(Evas_Object *parent) +{ + Evas_Object *genlist = NULL; + gchar edj_path[PATH_MAX] = { 0, }; + WIFI_RET_VAL_IF_FAIL(parent, NULL); + WIFI_RET_VAL_IF_FAIL(get_edj_genlist_path(edj_path, sizeof(edj_path)), NULL); + + WIFI_LOG_INFO("genlist path (%s)", edj_path); + elm_theme_extension_add(NULL, edj_path); + + genlist = elm_genlist_add(parent); + WIFI_RET_VAL_IF_FAIL(genlist, NULL); + + elm_object_style_set(genlist, "static_genlist"); + + return genlist; +} |