tizen 2.3 release
[apps/home/settings.git] / setting-appmgr / include / setting-appmgr-utils.h
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 #ifndef __SETTING_APPMGR_UTILS_H__
20 #define __SETTING_APPMGR_UTILS_H__
21
22 #include "setting-appmgr.h"
23
24 enum {
25         APPMGRUG_SORT_ATOZ,
26         APPMGRUG_SORT_ZTOA,
27         APPMGRUG_SORT_SIZE,
28 };
29
30 GList* appmgrUg_sort_pkg_list(int sorttype, GList *pkg_list);
31 int appmgrUg_get_listinfos(SettingAppMgrUG *ad);
32 void appmgrUg_get_listinfos_cb(int fn_result, SettingAppMgrUG *ad);
33 void appmgrUg_get_runlistinfos_cb(int fn_result, SettingAppMgrUG *ad);
34 void appmgrUg_pkgmgr_subscribe(SettingAppMgrUG *ad);
35 void appmgrUg_pkgmgr_deinit(SettingAppMgrUG *ad);
36 void appmgrUg_get_default_list(SettingAppMgrUG *ad);
37 void appmgrUg_free_listinfos(SettingAppMgrUG *ad);
38 Elm_Object_Item* appmgrUg_append_separator(Evas_Object *genlist,
39                 SettingAppMgrUG *ad);
40 void appmgrUg_size_to_str(int size, char *desc, int desc_size);
41 char* appmgrUg_info_title_gl_label_get(void *data, Evas_Object *obj,
42                 const char *part);
43 Evas_Object* appmgrUg_info_title_gl_icon_get(void *data, Evas_Object *obj,
44                 const char *part);
45 Evas_Object* appmgrUg_info_2button1_gl_icon_get(void *data, Evas_Object *obj,
46                 const char *part);
47 Evas_Object* appmgrUg_info_2button2_gl_icon_get(void *data, Evas_Object *obj,
48                 const char *part);
49 Evas_Object* appmgrUg_info_1button_gl_icon_get(void *data, Evas_Object *obj,
50                         const char *part);
51 void appmgrUg_popup_del(void *data, Evas_Object *obj, void *event_info);
52 void appmgrUg_fail_popup(char *str, SettingAppMgrUG *ad);
53 int appmgrUg_reset_app_settings(SettingAppMgrUG *ad);
54 Evas_Object* appmgrUg_no_item(Evas_Object *parent, const char *text,
55                 const char *help);
56 Evas_Object* appmgrUg_loading_item(Evas_Object *parent, const char *text,
57                 const char *help);
58 gint appmgrUg_compare_pkgname(gconstpointer item, gconstpointer pkg_name);
59 char* appmgrUg_get_defualt_icon(pkgmgrinfo_appinfo_h handle);
60
61 static inline char* appmgrUg_check_icon(const char *icon_path)
62 {
63         if (EINA_TRUE == ecore_file_exists(icon_path))
64                 return strdup(icon_path);
65         else
66                 return NULL;
67 }
68
69
70 #endif //__SETTING_APPMGR_UTILS_H__