Fix N_SE-7996 : An empty window is made by tapping volume hw key when screenlock...
[apps/home/volume-app.git] / src / volume.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://www.tizenopensource.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
18 #ifndef __VOLUME_H__
19 #define __VOLUME_H__
20
21 #include <Elementary.h>
22 #include <mm_sound.h>
23 #include <ui-gadget.h>
24 #include <syspopup.h>
25 #include <appcore-efl.h>
26 #include <Ecore_X.h>
27
28 #if !defined(PACKAGE)
29 #  define PACKAGE "volume"
30 #endif
31
32 #if !defined(RESDIR)
33 #  define RESDIR "/opt/apps/org.tizen.volume/res"
34 #endif
35
36 #if !defined(LOCALEDIR)
37 #  define LOCALEDIR RESDIR"/locale"
38 #endif
39
40 #if !defined(EDJDIR)
41 #  define EDJDIR RESDIR"/edje"
42 #endif
43
44 #define EDJ_FILE EDJDIR"/"PACKAGE".edj"
45 #define GRP_MAIN "main"
46 #define EDJ_THEME EDJDIR"/volume_popup.edj"
47 #define GRP_VOLUME_SLIDER "popup_slider_style"
48 #define GRP_VOLUME_SLIDER_WITH_WARNING "popup_slider_text_style_with_warn_label"
49
50 #define S_(str) dgettext("sys_string", str)
51 #define T_(str) dgettext(PACKAGE, str)
52
53 #define ADD_TIMER(x, time, _timer_cb, data) \
54         x = ecore_timer_add(time, _timer_cb, data);\
55
56 #define DEL_TIMER(x) \
57         if (x) {\
58                 ecore_timer_del(x);\
59                 x = NULL;\
60         }
61
62 struct appdata
63 {
64         Evas_Object *win, *pu, *bt, *sl, *ic, *warn_lb, *warn_ly;
65
66         Ecore_Timer *ptimer;
67         Ecore_Timer *stimer;    /* slider timer */
68         Ecore_Timer *sutimer, *sdtimer, *lutimer, *ldtimer;     /* long press */
69         Ecore_Timer *warntimer; /* warning message timer */
70         volume_type_t type;
71         int step;
72         int before_mute[32];
73
74         /* ug handler */
75         ui_gadget_h ug;
76
77         /* add more variables here */
78         int sh; /* svi handle */
79         int flag_pressing;      /* to set hard key press */
80         int flag_touching;
81         int flag_launching;     /* to block double launching by double click */
82         int flag_deleting;
83         int flag_warning;       /* set device warning flag */
84 };
85
86 #endif /* __VOLUME_H__ */
87