tizen 2.4 release
[apps/home/ug-setting-notification-efl.git] / ug-setting-notification-efl / inc / common-efl.h
1 /*
2  * Copyright (c) 2009 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #ifndef __COMMON_EFL_H__
19 #define __COMMON_EFL_H__
20
21 #include <Evas.h>
22 #include <stdbool.h>
23 #include <notification_setting.h>
24 #include <ui-gadget-module.h>
25 #include <efl_extension.h>
26
27 #include <Elementary.h>
28 #include <package-manager.h>
29 #include <pkgmgr-info.h>
30 #include "log.h"
31 #include "pkgmgr-setting-info.h"
32 #include "notification-setting-info.h"
33
34
35 #define PKGNAME "ug-setting-notification-efl"
36 #define APP_STRING(str)                 dgettext(PKGNAME, str)
37
38
39 typedef struct _data_list data_list_t;
40 struct _data_list
41 {
42         data_list_t *next;
43         int id;
44         int index;
45         char *appid;
46         char *name;
47         char *icon;
48         bool is_app_data;
49 };
50
51 typedef struct item_data
52 {
53         int index;
54         Elm_Object_Item *item;
55         data_list_t *data;
56 } item_data_s;
57
58
59 /* User created ug data */
60 typedef struct ug_data_t
61 {
62         ui_gadget_h ug;
63         Evas_Object *layout;
64         Evas_Object *naviframe;
65         Evas_Object *list_main;
66         Evas_Object *list_sub;
67         Evas_Object *cancel_button;
68         Evas_Object *done_button;
69
70         int mode;
71
72         Elm_Object_Item *navi_item;
73
74 } ug_data;
75
76
77 enum {
78         ITEM_STYLE_DEFAULT = 0,
79         ITEM_STYLE_ONE_LINE,
80         ITEM_STYLE_ONE_ICON,
81 };
82
83
84 Evas_Object *create_layout(Evas_Object *parent);
85 Evas_Object *create_background(Evas_Object *parent);
86 Evas_Object *create_naviframe(Evas_Object *parent);
87
88 void gl_loaded_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED);
89 void gl_realized_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
90 void gl_longpressed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
91
92 void gl_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info);
93 void gl_contracted_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info);
94 void gl_del_cb(void *data, Evas_Object *obj EINA_UNUSED);
95
96 Evas_Object* create_icon(Evas_Object *parent, char* icon);
97
98 void append_gl_group_index(Evas_Object *genlist, char* text);
99 void append_gl_item_list(Evas_Object *genlist, Eina_List* list, int style);
100 void append_gl_start_option(Evas_Object *genlist, char *style, char *ugName);
101
102
103 void back_button_cb(void *data, Evas_Object *obj, void *event_info);
104
105
106 #endif //__COMMON_EFL_H__