Tizen 2.0 Release
[apps/home/settings.git] / setting-common / include / setting-common-general-func.h
1 /*
2  * setting
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Flora License, Version 1.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://floralicense.org/license/
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef __SETTING_COMMON_GENERAL_FUNC_H__
18 #define __SETTING_COMMON_GENERAL_FUNC_H__
19
20 #ifdef _
21 #undef _
22 #undef N_
23 #undef S_
24 #endif
25
26 #include <appcore-efl.h>
27
28 #ifdef _
29 #undef _
30 #undef N_
31 #undef S_
32 #endif
33
34 #include <setting-common-data-type.h>
35 #include <aul.h>
36 #include <ui-gadget-module.h>
37
38 #ifndef _EDJ
39 #define _EDJ(o)                            elm_layout_edje_get(o)
40 #endif
41
42 #ifdef _
43 #undef _
44 #undef N_
45 #undef S_
46 #endif
47 #define _(s)                    setting_gettext(s)
48 #define S_(s)              setting_gettext(s)
49
50 #define btn_type(obj) get_popup_btn_response_type(elm_object_text_get(obj))
51
52 extern char *setting_file_basename(char *path);
53
54 /*****/
55 extern char *get_brightness_mode_str();
56 extern char *get_pa_backlight_time_str();
57 extern char *get_pa_powersaving_at_str();
58 extern char *get_pa_screen_timeout_str();
59 extern char *get_pa_display_language_str();
60 extern char *get_pa_Wi_Fi_on_off_str();
61 extern char *get_BT_on_off_str();
62 extern char *get_NFC_on_off_str();
63
64 extern char *get_pa_time_format_str();
65 extern char *get_pa_date_format_str();
66 extern char *get_pa_week_format_str();
67 extern char *get_pa_roaming_network_str();
68 extern char *get_pa_select_network();
69 extern double get_widgets_factor();
70 extern char *setting_gettext(const char *s);
71 extern bool is_digital_str(const char *cstr);
72 extern bool is_substr_ncase(const char *parentstr, const char *substr);
73
74 /* check if partern belongs to array..*/
75 extern bool is_string_belong_to_array(const char *partern, const char **array,
76                                       int array_num);
77 extern int safeStrCmp(const char *s1, const char *s2);
78 extern int safeStrNCmp(const char *s1, const char *s2, int len);
79 extern char *safeStrNCat(char *dst, const char *src, int maxlen);
80 extern char *safeCopyStr(char *dst, const char *src, int maxlen);
81 extern bool isEmptyStr(const char *str);
82 extern bool isSpaceStr(const char *str);
83 extern char *remove_first_substring(const char *parent, const char *pat);
84 extern int safeStrLen(const char *str);
85 extern bool get_substring_int(const char **ipStr, int *ipValue, char delim);
86 extern bool is_ip_string(const char *ipstr);
87 extern int setting_invoke_reset_function(char *ug_name, service_h service, void *ext);
88 extern int excuteCmd(char* exec_path, int option_num, ...);
89 extern void create_fontlink(const char *linkpath, const char *linkname,
90                     const char *fontfilepath, const char *fontfilename);
91
92 extern char* get_icon_path(const char *package);
93
94 extern int is_slp_binary();
95 extern bool isEmulBin();
96 extern int get_popup_btn_response_type(const char *btn_str);
97 extern void clear_system_service_data();
98
99 extern char *cur_font_get();
100 extern void font_config_set(char *font_name);
101 extern void font_size_set();
102
103 extern int setting_set_i18n(char* pkgname, char* localedir);
104 extern void app_launcher(char* pkg_name);
105 extern char* substring(const char* str, size_t begin, size_t len);
106 extern void set_defaultLangICU();
107
108 #endif                          /* __SETTING_COMMON_GENERAL_FUNC_H__ */