tizen 2.4 release
[apps/home/settings.git] / setting-font / src / setting-font.c
index eb0aeeb..807e980 100644 (file)
@@ -64,6 +64,7 @@ setting_view *__default_view_state(void *data, app_control_h service)
                setting_view_node_table_register(&setting_view_font_font_size, &setting_view_font_main);
                setting_view_node_table_register(&setting_view_font_main, NULL);
                FREE(category);
+               FREE(viewtype);
                return &setting_view_font_main;
        }
 }
@@ -84,16 +85,14 @@ setting_view *__app_control_get_operation_handler(void *data, app_control_h serv
 
        if (ret == APP_CONTROL_ERROR_NONE) {
                /*SETTING_TRACE(" >>>>>>>>>>>>>>>>>>> (%s) ", output_url); */
-               if (0 == safeStrCmp(output_url, "http://tizen.org/appcontrol/operation/configure/font/type")
-                   || 0 == safeStrCmp(output_url, "http://samsung.com/appcontrol/operation/configure/font/type")) {
+               if (0 == safeStrCmp(output_url, "http://tizen.org/appcontrol/operation/configure/font/type")) {
                        fontUG->viewmode = FONT_SEL_VIEW_APPCONTROL;
                        setting_view_node_table_register(&setting_view_font_font_size, &setting_view_font_main);
                        setting_view_node_table_register(&setting_view_font_main, NULL);
 
                        FREE(output_url);
                        return &setting_view_font_main;
-               } else if (0 == safeStrCmp(output_url, "http://tizen.org/appcontrol/operation/configure/font/size")
-                          || 0 == safeStrCmp(output_url, "http://tizen.org/appcontrol/operation/configure/font/size")) {
+               } else if (0 == safeStrCmp(output_url, "http://tizen.org/appcontrol/operation/configure/font/size")) {
                        fontUG->viewmode = FONT_SIZE_VIEW_APPCONTROL;
                        setting_view_node_table_register(&setting_view_font_font_size, NULL);
 
@@ -134,8 +133,7 @@ setting_view *__get_font_view_to_load(void *data, app_control_h service)
 
        /* service OK, but there's no argument */
        if ((ret == APP_CONTROL_ERROR_NONE)
-           && (0 == safeStrCmp(output_url, "http://tizen.org/appcontrol/operation/default")
-               || 0 == safeStrCmp(output_url, "http://samsung.com/appcontrol/operation/default"))) {
+           && (0 == safeStrCmp(output_url, "http://tizen.org/appcontrol/operation/default"))) {
                FREE(output_url);
                return __default_view_state(fontUG, service);
 
@@ -176,12 +174,12 @@ static void *setting_font_ug_on_create(ui_gadget_h ug, enum ug_mode mode,
        setting_retvm_if(fontUG->win_main_layout == NULL, NULL,
                         "cannot get main window ");
 
-       setting_create_Gendial_itc("2line.top", &(fontUG->itc_2text_3_parent));
-       setting_create_Gendial_itc("2line.top", &(fontUG->itc_1icon_1text_sub));
+       setting_create_Gendial_itc(SETTING_GENLIST_2LINE_STYLE, &(fontUG->itc_2text_3_parent));
+       setting_create_Gendial_itc(SETTING_GENLIST_2LINE_STYLE, &(fontUG->itc_1icon_1text_sub));
        /*setting_create_Gendial_itc("dialogue/2text.3", &(fontUG->itc_2text_2)); */
-       setting_create_Gendial_itc("2line.top", &(fontUG->itc_2text_2));
-       setting_create_Gendial_itc("groupindex", &(fontUG->itc_group_item));
-       setting_create_Gendial_itc("multiline", &(fontUG->itc_bg_1icon));
+       setting_create_Gendial_itc(SETTING_GENLIST_2LINE_STYLE, &(fontUG->itc_2text_2));
+       setting_create_Gendial_itc(SETTING_GENLIST_GROUP_INDEX_STYLE, &(fontUG->itc_group_item));
+       setting_create_Gendial_itc("1icon", &(fontUG->itc_1icon));
 
        /* view type checking */
        fontUG->view_to_load = __get_font_view_to_load(fontUG, service);
@@ -190,6 +188,8 @@ static void *setting_font_ug_on_create(ui_gadget_h ug, enum ug_mode mode,
        setting_view_node_set_cur_view(fontUG->view_to_load);
        setting_view_create(fontUG->view_to_load, (void *)fontUG);
 
+       elm_theme_extension_add(NULL, SETTING_5STEP_SLIDER_EDJ_NAME);
+
        /*  creating a view. */
        /*setting_view_create(&setting_view_font_main, (void *)fontUG); */
        evas_object_event_callback_add(fontUG->win_main_layout, EVAS_CALLBACK_RESIZE, setting_font_ug_cb_resize, fontUG);
@@ -326,6 +326,29 @@ UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
  *
  ***************************************************/
 
+/**
+* Reset function to 'reset' the settings of the UG, it will be invoked by 'Reset' UG
+*/
+UG_MODULE_API int setting_plugin_reset(app_control_h service, void *priv)
+{
+       SETTING_TRACE_BEGIN;
+       int ret = 0;
+
+       /* reset font type, default is HelveticaNeue */
+       /*font_config_set("HelveticaNeue"); */
+       char *default_font_name = NULL;
+       default_font_name = _get_default_font();
+       if (NULL != default_font_name) {
+               ret += system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, default_font_name);
+       } else {
+               SETTING_TRACE_ERROR("Failed to get default font type");
+       }
+       ret += vconf_set_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, SYSTEM_SETTINGS_FONT_SIZE_NORMAL);
+       setting_retvm_if(ret == -1, ret, "Failed to set vconf");
+       font_size_set();
+
+       return ret;
+}
 static Setting_Cfg_Node_T s_cfg_node_array[] = {
        {"IDS_ST_BODY_FONT_TYPE", NULL, "viewtype:FontType_expand;tab:first;keyword:IDS_ST_BODY_FONT_TYPE", 0, 0, 0, Cfg_Item_View_Node, NULL, NULL, NULL, NULL},
        {"IDS_ST_MBODY_FONT_SIZE", NULL, "viewtype:FontSize_expand;tab:first;keyword:IDS_ST_MBODY_FONT_SIZE", 0, 0, 0, Cfg_Item_View_Node, NULL, NULL, NULL, NULL},