tizen 2.3.1 release
[apps/home/volume-app.git] / include / main.h
1 /*
2  * Copyright (c) 2009-2014 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 __VOLUME_H__
19 #define __VOLUME_H__
20
21 #include <Elementary.h>
22 #include <sound_manager.h>
23 #include <ui-gadget.h>
24 #include <syspopup.h>
25 #include <appcore-efl.h>
26 #include <Ecore_X.h>
27 #include <notification.h>
28 #include <syspopup_caller.h>
29
30 #if !defined(PACKAGE)
31 #  define PACKAGE "volume"
32 #endif
33
34 #if !defined(RESDIR)
35 #  define RESDIR "/usr/apps/org.tizen.volume/res"
36 #endif
37
38 #if !defined(LOCALEDIR)
39 #  define LOCALEDIR RESDIR"/locale"
40 #endif
41
42 #if !defined(EDJDIR)
43 #  define EDJDIR RESDIR"/edje"
44 #endif
45
46 #if !defined(PKGNAME)
47 #  define PKGNAME "org.tizen.volume"
48 #endif
49
50 #define EDJ_APP EDJDIR"/volume_app.edj"
51
52 #define IMG_VOLUME_ICON "00_volume_icon.png"
53 #define IMG_VOLUME_ICON_CALL "00_volume_icon_call.png"
54 #define IMG_VOLUME_ICON_MUTE "00_volume_icon_mute.png"
55 #define IMG_VOLUME_ICON_VIB "00_volume_icon_vibrat.png"
56 #define IMG_VOLUME_ICON_NOTI "00_volume_icon_notification.png"
57 #define IMG_VOLUME_ICON_NOTI_VIB "00_volume_icon_notification_vibrate.png"
58 #define IMG_VOLUME_ICON_NOTI_MUTE "00_volume_icon_notification_mute.png"
59 #define IMG_VOLUME_ICON_HEADPHONE "00_volume_icon_headphone.png"
60 #define IMG_VOLUME_ICON_MEDIA "00_volume_icon_media.png"
61 #define IMG_VOLUME_ICON_SETTINGS "00_volume_icon_settings.png"
62 #define IMG_VOLUME_ICON_SETTINGS_PRESSED "00_volume_icon_settings_pressed.png"
63 #define IMG_VOLUME_ICON_SETTINGS_DISABLED "00_volume_icon_settings_disabled.png"
64
65 #define _EDJ(x) elm_layout_edje_get(x)
66 #define _X(x) (x) / elm_app_base_scale_get() * elm_config_scale_get()
67
68 #define S_(str) dgettext("sys_string", str)
69 #define T_(str) dgettext(PACKAGE, str)
70 #undef _
71 #define _(str) gettext(str)
72
73 #ifndef VCONFKEY_SETAPPL_ACCESSIBILITY_TURN_OFF_ALL_SOUNDS
74 #define VCONFKEY_SETAPPL_ACCESSIBILITY_TURN_OFF_ALL_SOUNDS VCONFKEY_SETAPPL_PREFIX"/accessibility/turn_off_all_sounds"
75 #endif
76
77 /* Fake-BG : bundle */
78 #define SHOWLOCK "show_lock"
79 #define ISTRUE "TRUE"
80
81 /* For voice control */
82 #define SHOWVOLUME "show_volume"
83
84 #define LOCKSCREEN_PKG "org.tizen.lockscreen"
85
86 #define SCREEN_W_HD 720
87 #define SCREEN_H_HD 1280
88
89 #define SCREEN_W_WVGA 480
90 #define SCREEN_H_WVGA 800
91
92 #define SCREEN_W_FHD 1080
93 #define SCREEN_H_FHD 1920
94
95 #define WIN_WIDTH 456
96 #define WIN_HEIGHT_WITH_WARNING 222
97 #define WIN_HEIGHT 102
98
99 #define WIN_LANDSCAPE_X 79
100 #define WIN_LANDSCAPE_INVERTED_X volume_control_viewport_width_get()-WIN_HEIGHT_WITH_WARNING-WIN_LANDSCAPE_X
101 #define WIN_LANDSCAPE_Y (volume_control_viewport_height_get()-WIN_WIDTH)/2
102 #define WIN_PORTRAIT_X 12
103 #define WIN_PORTRAIT_Y 113
104 #define WIN_SLIDER_TOUCHING_OFFSET 55
105
106 #define SOUND_TYPE_SYSTEM 0
107 #define SOUND_TYPE_NOTIFICATION 1
108 #define SOUND_TYPE_ALARM 2
109 #define SOUND_TYPE_RINGTONE 3
110 #define SOUND_TYPE_MEDIA 4
111 #define SOUND_TYPE_CALL 5
112
113 #define VOLUME_MAX_SAFETY_VOLUME_LEVEL 10
114
115 typedef enum {
116         TYPE_VCONF_SOUND_STATUS = 0,
117         TYPE_VCONF_VIBRATION_STATUS
118 } volume_vconf_type_e;
119
120 /* Volume : return values */
121 typedef enum {
122         VOLUME_ERROR_OK = 0,
123         VOLUME_ERROR_FAIL = -1,
124         VOLUME_ERROR_INVALID_PARAMETER = -2,
125         VOLUME_ERROR_NO_DATA = -3
126 } volume_error_e;
127
128 #endif /* __VOLUME_H__ */
129