2 * Copyright (c) 2010 Samsung Electronics, Inc.
5 * This software is a confidential and proprietary information
6 * of Samsung Electronics, Inc. ("Confidential Information"). You
7 * shall not disclose such Confidential Information and shall use
8 * it only in accordance with the terms of the license agreement
9 * you entered into with Samsung Electronics.
14 * Created on: Nov 21, 2013
20 #include <unicode/unum.h>
25 char *setting_gettext(const char *s)
27 /* fisrt find in app pg */
33 char *p = dgettext(SETTING_PACKAGE, s);
35 if (!strcmp(s, p)) { /* not found */
36 /* find in system pkg */
37 p = dgettext(SYSTEM_PACKAGE, s);
42 char * replace( char * str, char * orig, char * repl)
44 static char buffer[124];
46 if( !(ch = strstr(str, orig)))
50 strncpy(buffer, str, ch - str);
52 sprintf(buffer + (ch - str), "%s%s", repl, ch + strlen(orig));
57 void setting_popup_back_cb(void *data, Evas_Object *obj, void *event_info)
59 appdata *ad = (appdata *)data;
65 evas_object_del(ad->popup);
73 vconf_get_bool(VCONFKEY_WMS_WMANAGER_CONNECTED, &enable);
78 bool colorstr_to_decimal(char *color, int *R, int *G, int *B)
80 DBG("_colorstr_to_decimal");
86 value = strtol(color, &ptr, 16);
87 *R = (value>>16)&0xFF;
93 char *_get_strnum_from_icu(int number)
95 char *locale_tmp = vconf_get_str(VCONFKEY_REGIONFORMAT);
96 char locale[32] = {0,};
98 strcpy(locale, locale_tmp);
100 if (locale[0] != '\0') {
101 p = strstr(locale, ".UTF-8");
107 char *ret_str = NULL;
108 UErrorCode status = U_ZERO_ERROR;
110 UNumberFormat *num_fmt;
111 UChar result[20] = { 0, };
112 char res[20] = { 0, };
113 int32_t len = (int32_t) (sizeof(result) / sizeof((result)[0]));
115 num_fmt = unum_open(UNUM_DEFAULT, NULL, -1, locale, NULL, &status);
116 unum_format(num_fmt, number, result, len, NULL, &status);
118 u_austrcpy(res, result);
122 ret_str = strdup(res);
126 bool is_file_exist(char * file_path)
130 if( !file_path && !strlen(file_path) )
132 DBG("Setting - file path is wrong!!");
136 if( (fd = open(file_path, O_RDONLY)) == -1)
138 DBG("Setting - file(%s) do not exist!!", file_path);
142 DBG("Setting - file exist!!");