sync with private git
[apps/core/preloaded/quickpanel.git] / daemon / quickpanel-ui.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #ifndef __QUICKPANEL_UI_H__
18 #define __QUICKPANEL_UI_H__
19
20 #include <Elementary.h>
21 #include <Ecore_X.h>
22 #include <X11/Xatom.h>
23 #include "media.h"
24
25 #if !defined(VENDOR)
26 #  define VENDOR "org.tizen"
27 #endif
28 #if !defined(PACKAGE)
29 #  define PACKAGE                       "quickpanel"
30 #endif
31
32 #if !defined(LOCALEDIR)
33 #  define LOCALEDIR                     "/usr/apps/"VENDOR"."PACKAGE"/res/locale"
34 #endif
35
36 #if !defined(EDJDIR)
37 #  define EDJDIR                        "/usr/apps/"VENDOR"."PACKAGE"/res/edje"
38 #endif
39
40 /* EDJ theme */
41 #define DEFAULT_EDJ             EDJDIR"/"PACKAGE".edj"
42 #define DEFAULT_THEME_EDJ       EDJDIR"/"PACKAGE"_theme.edj"
43
44 #define _EDJ(o) elm_layout_edje_get(o)
45 #define _S(str) dgettext("sys_string", str)
46 #undef _
47 #define _(str) gettext(str)
48 #define _NOT_LOCALIZED(str) (str)
49
50 #define STR_ATOM_WINDOW_INPUT_REGION    "_E_COMP_WINDOW_INPUT_REGION"
51 #define STR_ATOM_WINDOW_CONTENTS_REGION "_E_COMP_WINDOW_CONTENTS_REGION"
52
53 #define MAX_NAM_LEN 4096
54
55 #define INDICATOR_COVER_W 82
56 #define INDICATOR_COVER_H 60
57
58 #define _NEWLINE '\n'
59 #define _SPACE ' '
60 #define QP_SETTING_PKG_SETTING  VENDOR".setting"
61 #define QP_SETTING_PKG_SETTING_EMUL     "kto5jikgul.Settings"
62
63 struct appdata {
64         Evas_Object *win;
65 #ifdef QP_INDICATOR_WIDGET_ENABLE
66         Evas_Object *comformant;
67 #endif
68         Evas_Object *ly;
69         Evas *evas;
70
71         Evas_Object *scroller;
72         Evas_Object *list;
73         int angle;
74         double scale;
75         char *theme;
76
77         int win_width;
78         int win_height;
79         int gl_limit_height;
80         int gl_distance_from_top;
81         int gl_distance_to_bottom;
82
83         int is_emul; /* 0 : target, 1 : emul */
84         int is_suspended;
85         int is_opened;
86
87         Ecore_Event_Handler *hdl_client_message;
88         Ecore_Event_Handler *hdl_hardkey;
89
90         E_DBus_Connection *dbus_connection;
91         E_DBus_Signal_Handler *dbus_handler_size;
92         E_DBus_Signal_Handler *dbus_handler_progress;
93         E_DBus_Signal_Handler *dbus_handler_content;
94
95         Evas_Object *cover_indicator_left;
96         Evas_Object *cover_indicator_right;
97         Ecore_X_Atom *E_ILLUME_ATOM_MV_QUICKPANEL_STATE;
98 };
99
100 typedef struct _QP_Module {
101         char *name;
102         /* func */
103         int (*init) (void *);
104         int (*fini) (void *);
105         int (*suspend) (void *);
106         int (*resume) (void *);
107         int (*hib_enter) (void *);
108         int (*hib_leave) (void *);
109         void (*lang_changed) (void *);
110         void (*refresh) (void *);
111         unsigned int (*get_height) (void *);
112         void (*qp_opened) (void *);
113         void (*qp_closed) (void *);
114
115         /* do not modify this area */
116         /* internal data */
117         Eina_Bool state;
118 } QP_Module;
119
120 int quickpanel_launch_app(char *app_id, void *data);
121 void quickpanel_launch_app_inform_result(const char *pkgname, int retcode);
122 int quickpanel_is_emul(void);
123 void quickpanel_init_size_genlist(void *data);
124 void quickpanel_ui_update_height(void *data);
125 void *quickpanel_get_app_data(void);
126 int quickpanel_is_suspended(void);
127 Evas_Object *quickpanel_ui_load_edj(Evas_Object * parent, const char *file,
128                                             const char *group, int is_just_load);
129 void quickpanel_ui_set_indicator_cover(void *data);
130 void quickpanel_close_quickpanel(bool is_check_lock);
131
132 #endif                          /* __QUICKPANEL_UI_H__ */