19064ecacfb6773658b92baefc52e24a8f112292
[apps/home/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 QP_SETTING_SOUND_SIP_PATH \
51         "/usr/apps/com.samsung.quickpanel/data/sip.wav"
52
53 #define STR_ATOM_WINDOW_INPUT_REGION    "_E_COMP_WINDOW_INPUT_REGION"
54 #define STR_ATOM_WINDOW_CONTENTS_REGION "_E_COMP_WINDOW_CONTENTS_REGION"
55
56 #define MAX_NAM_LEN 4096
57
58 #define INDICATOR_COVER_W 82
59 #define INDICATOR_COVER_H 60
60
61 #define _NEWLINE '\n'
62 #define _SPACE ' '
63 #define QP_SETTING_PKG_SETTING  VENDOR".setting"
64 #define QP_SETTING_PKG_SETTING_EMUL     "kto5jikgul.Settings"
65
66 struct appdata {
67         Evas_Object *win;
68 #ifdef QP_INDICATOR_WIDGET_ENABLE
69         Evas_Object *comformant;
70 #endif
71         Evas_Object *ly;
72         Evas *evas;
73
74         Evas_Object *scroller;
75         Evas_Object *list;
76         Evas_Object *popup;
77         int angle;
78         double scale;
79         char *theme;
80
81         int win_width;
82         int win_height;
83         int gl_limit_height;
84         int gl_distance_from_top;
85         int gl_distance_to_bottom;
86
87         int is_emul; /* 0 : target, 1 : emul */
88         int is_suspended;
89         int is_opened;
90
91         Ecore_Event_Handler *hdl_client_message;
92         Ecore_Event_Handler *hdl_hardkey;
93
94         E_DBus_Connection *dbus_connection;
95         E_DBus_Signal_Handler *dbus_handler_size;
96         E_DBus_Signal_Handler *dbus_handler_progress;
97         E_DBus_Signal_Handler *dbus_handler_content;
98
99         Evas_Object *cover_indicator_right;
100
101         Ecore_X_Atom *E_ILLUME_ATOM_MV_QUICKPANEL_STATE;
102 };
103
104 typedef struct _QP_Module {
105         char *name;
106         /* func */
107         int (*init) (void *);
108         int (*fini) (void *);
109         int (*suspend) (void *);
110         int (*resume) (void *);
111         int (*hib_enter) (void *);
112         int (*hib_leave) (void *);
113         void (*lang_changed) (void *);
114         void (*refresh) (void *);
115         unsigned int (*get_height) (void *);
116         void (*qp_opened) (void *);
117         void (*qp_closed) (void *);
118
119         /* do not modify this area */
120         /* internal data */
121         Eina_Bool state;
122 } QP_Module;
123
124 int quickpanel_launch_app(char *app_id, void *data);
125 void quickpanel_launch_app_inform_result(const char *pkgname, int retcode);
126 int quickpanel_is_emul(void);
127 void quickpanel_init_size_genlist(void *data);
128 void quickpanel_ui_update_height(void *data);
129 void *quickpanel_get_app_data(void);
130 int quickpanel_is_suspended(void);
131 Evas_Object *quickpanel_ui_load_edj(Evas_Object * parent, const char *file,
132                                             const char *group, int is_just_load);
133 void quickpanel_ui_set_indicator_cover(void *data);
134 void quickpanel_close_quickpanel(bool is_check_lock);
135 void quickpanel_open_quickpanel(void);
136 void quickpanel_toggle_openning_quickpanel(void);
137
138 #endif                          /* __QUICKPANEL_UI_H__ */