Fix coding rule detected by coding rule checker
[platform/core/uifw/inputdelegator.git] / src / w-input-stt-tos.cpp
index 908038c..3ee5215 100755 (executable)
@@ -46,7 +46,7 @@ static Evas_Object *g_circle_object_first = NULL;
 
 #define N66_URL   "https://account.samsung.com/membership/pp"
 
-char *nuance_support_language[12][2] = {
+const char *nuance_support_language[12][2] = {
         {"en_GB", "en"}, // fallback
         {"de_DE", "de"},
         {"en_US", "en"},
@@ -101,9 +101,8 @@ static void __bt_connection_result_cb(app_control_h request, app_control_h reply
     }
 }
 
-void launch_bt_connection_popup(App_Data* data){
-    App_Data* ad = (App_Data*)data;
-
+void launch_bt_connection_popup(App_Data* data)
+{
     PRINTFUNC(DLOG_DEBUG, "Need to launch BT connection popup");
     app_control_h app_control;
     app_control_create(&app_control);
@@ -115,7 +114,6 @@ void launch_bt_connection_popup(App_Data* data){
     app_control_destroy(app_control);
 }
 
-
 Eina_Bool set_tos_N66_agreed(Eina_Bool bSet)
 {
     int ret = vconf_set_bool(VCONFKEY_USER_AGREEMENT, bSet);
@@ -207,8 +205,6 @@ static void show_terms(void *data, Evas_Object *obj, void *event_info)
     if (!data) return;
     if (!event_info) return;
 
-    Evas_Object *parent_win = (Evas_Object *)data;
-
     int wms_connected = 0;
     vconf_get_int(VCONFKEY_WMS_WMANAGER_CONNECTED, &wms_connected);
 
@@ -306,7 +302,7 @@ _naviframe_pop_cb(void *data , Elm_Object_Item *it)
 std::string getColorStyle(const char *code)
 {
     std::string strRet;
-    int r, g, b, a;
+    int r = 0xFF, g = 0xFF, b = 0xFF, a = 0xFF;
     char strColor[256];
 //    ea_theme_color_get(code, &r, &g, &b, &a, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
     snprintf(strColor, 256, "<color=#%02x%02x%02x%02x>", r, g, b, a);
@@ -318,16 +314,16 @@ std::string getColorStyle(const char *code)
 std::string getFontStyle(const char *code)
 {
     std::string strRet;
-    int r, g, b, a;
-    char *fontStyle;
-    int  fontSize;
-    char strColor[256];
-    char strFont[256];
+//    int r = 0xFF, g = 0xFF, b = 0xFF, a = 0xFF;
+//    char *fontStyle;
+//    int  fontSize;
+//    char strColor[256];
+//    char strFont[256];
 //    ea_theme_color_get(code, &r, &g, &b, &a, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
-    snprintf(strColor, 256, "<color=#%02x%02x%02x%02x>", r, g, b, a);
+//    snprintf(strColor, 256, "<color=#%02x%02x%02x%02x>", r, g, b, a);
 
 //    ea_theme_font_get(code,&fontStyle,&fontSize);
-
+/*
     if (fontStyle) {
         snprintf(strFont, 256, "<font=Tizen:style=%s><font_size=%d>", fontStyle, fontSize);
     } else {
@@ -341,6 +337,7 @@ std::string getFontStyle(const char *code)
         free(fontStyle);
         fontStyle = NULL;
     }
+*/
     return strRet;
 }
 
@@ -382,13 +379,12 @@ static void _language_changed_cb(void *_data, Evas_Object *_obj, void *_event_in
 
     int index = (int)_data;
     std::string terms = "";
-    Elm_Object_Item *navi_it = NULL;
 
     char body_str[40000];
 
     switch (index) {
         case 1:
-            sprintf(body_str, gettext("LDS_IME_BODY_INFORMATION_PROVISION_AGREEMENT_P1_LEGALPHRASE_WC1"), " <a href=\"file://local-nuance-tos\">","</a>","<a href=\"http://www.vlingo.com/wap/samsung-asr-privacy-addendum\">","</a>");
+            snprintf(body_str, sizeof(body_str), gettext("LDS_IME_BODY_INFORMATION_PROVISION_AGREEMENT_P1_LEGALPHRASE_WC1"), " <a href=\"file://local-nuance-tos\">", "</a>", "<a href=\"http://www.vlingo.com/wap/samsung-asr-privacy-addendum\">", "</a>");
             terms = tagging(std::string(body_str));
             terms = replaceAll(terms , std::string("\n"), std::string("<br>"));
             elm_entry_entry_set(elm_layout_content_get(_obj, "elm.swallow.content"), terms.c_str());
@@ -642,62 +638,6 @@ static void _response_n66_cb(void *data, Evas_Object *obj, void *event_info)
 
 static void _n66_language_changed_cb(void *_data, Evas_Object *_obj, void *_event_info)
 {
-    std::string terms = "";
-
-    Evas_Object* entry = elm_layout_content_get(_obj, "elm.swallow.content");
-
-    // 1. Get Country Code
-    char *country_code = NULL;
-//    country_code = vconf_get_str(VCONFKEY_CSC_COUNTRY_ISO);
-
-    // 2. Set String ID depend on Count Code
-    char* popup_title_id = NULL;
-    char* popup_body_id = NULL;
-    if (country_code) {
-        if (!strcmp(country_code, "CN")) {
-            popup_title_id = TOS_TITLE_CHN;
-            popup_body_id = TOS_N66_BODY_CHN;
-        } else {
-            popup_title_id = TOS_TITLE;
-            popup_body_id = TOS_N66_BODY;
-        }
-    } else {
-        PRINTFUNC(DLOG_ERROR, "Getting Count Code is Error!!! Set default TOS Text!");
-        popup_title_id = TOS_TITLE;
-        popup_body_id = TOS_N66_BODY;
-    }
-
-//    ea_cutlink_h cutlink;
-//    ea_cutlink_create(&cutlink, entry, EA_CUTLINK_USER);
-
-    /* add a new scheme */
-//    ea_cutlink_scheme_add(cutlink, "hello:", N66_URL);
-
-    /* set prefix and postfix for a new scheme */
-//    ea_cutlink_prefix_set(cutlink, "hello:",
-//                  "<color=#5BB8FFEF underline=on "
-//                  "underline_color=#5BB8FFEF>");
-//    ea_cutlink_postfix_set(cutlink, "hello:", "</color>");
-
-    char *markup = NULL;
-    char *txt = NULL;
-    /* set text for parsing */
-    markup = elm_entry_utf8_to_markup(gettext(popup_body_id));
-//    ea_cutlink_markup_set(cutlink, markup);
-
-//    ea_cutlink_markup_apply(cutlink, gettext(popup_body_id), &txt);
-    PRINTFUNC(DLOG_DEBUG, "%s", txt);
-
-    terms = tagging(std::string(gettext(txt)));
-    elm_entry_entry_set(entry, terms.c_str());
-
-    if (txt)
-        free(txt);
-
-    if (markup)
-        free(markup);
-    /* destroy cutlink object */
-//    ea_cutlink_destroy(cutlink);
 }
 
 Evas_Object *create_tos_n66_popup(void *data)
@@ -720,25 +660,25 @@ Evas_Object *create_tos_n66_popup(void *data)
     edj_path = edj_path + STT_EDJ_FILE;
 
     // 1. Get Country Code
-    char *country_code = NULL;
+//    char *country_code = NULL;
 //    country_code = vconf_get_str(VCONFKEY_CSC_COUNTRY_ISO);
 
     // 2. Set String ID depend on Count Code
     char* popup_title_id = NULL;
     char* popup_body_id = NULL;
-    if (country_code) {
-        if (!strcmp(country_code, "CN")) {
-            popup_title_id = TOS_TITLE_CHN;
-            popup_body_id = TOS_N66_BODY_CHN;
-        } else {
-            popup_title_id = TOS_TITLE;
-            popup_body_id = TOS_N66_BODY;
-        }
-    } else {
+//    if (country_code) {
+//        if (!strcmp(country_code, "CN")) {
+//            popup_title_id = TOS_TITLE_CHN;
+//            popup_body_id = TOS_N66_BODY_CHN;
+//        } else {
+//            popup_title_id = TOS_TITLE;
+//            popup_body_id = TOS_N66_BODY;
+//        }
+//    } else {
         PRINTFUNC(DLOG_ERROR, "Getting Count Code is Error!!! Set default TOS Text!");
-        popup_title_id = TOS_TITLE;
-        popup_body_id = TOS_N66_BODY;
-    }
+//        popup_title_id = TOS_TITLE;
+//        popup_body_id = TOS_N66_BODY;
+//    }
 
 
 //------------outer layout----------------------
@@ -802,8 +742,8 @@ Evas_Object *create_tos_n66_popup(void *data)
     terms = tagging(std::string(gettext(txt)));
     elm_entry_entry_set(entry, terms.c_str());
 
-    if (txt)
-        free(txt);
+//    if (txt)
+//        free(txt);
 
     if (markup)
         free(markup);