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