Fix coverity issue 1149129
[apps/native/volume-app.git] / inc / main.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 __VOLUME_H__
19 #define __VOLUME_H__
20
21 #include <Elementary.h>
22 #include <sound_manager.h>
23 //#include <syspopup.h>
24 //#include <appcore-efl.h>
25 #include <notification.h>
26 #include <syspopup_caller.h>
27
28 #if !defined(PACKAGE)
29 #  define PACKAGE "volume"
30 #endif
31
32 #define RES_DIR "res"
33 #define LOCALE_DIR RESDIR"/locale"
34 #define EDJ_DIR "edje"
35 #define PKG_NAME "org.tizen.volume"
36
37 #define EDJ_APP EDJ_DIR"/volume_app.edj"
38
39 #define IMG_VOLUME_ICON "sound_slider_icon_volume.png"
40 #define IMG_VOLUME_ICON_VIB "sound_slider_icon_volume_vibrate.png"
41 #define IMG_VOLUME_ICON_MUTE "sound_slider_icon_volume_mute.png"
42 #define IMG_VOLUME_ICON_NOTI "sound_slider_icon_notification.png"
43 #define IMG_VOLUME_ICON_NOTI_VIB "sound_slider_icon_notification_vibrate.png"
44 #define IMG_VOLUME_ICON_NOTI_MUTE "sound_slider_icon_notification_mute.png"
45 #define IMG_VOLUME_ICON_HEADPHONE "00_volume_icon_headphone.png"
46 #define IMG_VOLUME_ICON_CALL "sound_slider_icon_incoming_call.png"
47 #define IMG_VOLUME_ICON_SYSTEM "sound_slider_icon_system"
48 #define IMG_VOLUME_ICON_SYSTEM_VIB "sound_slider_icon_system_vibrate"
49 #define IMG_VOLUME_ICON_SYSTEM_MUTE "sound_slider_icon_system_mute"
50 #define IMG_VOLUME_ICON_SETTINGS "sound_volume_ic_setting.png"
51 #define IMG_VOLUME_ICON_SETTINGS_PRESSED "00_volume_icon_settings_pressed.png"
52
53 #define _EDJ(x) elm_layout_edje_get(x)
54 #define _X(x) (x) / elm_app_base_scale_get() * elm_config_scale_get()
55
56 #define S_(str) dgettext("sys_string", str)
57 #define T_(str) dgettext(PACKAGE, str)
58 #undef _
59 #define _(str) gettext(str)
60
61 #ifndef VCONFKEY_SETAPPL_ACCESSIBILITY_TURN_OFF_ALL_SOUNDS
62 #define VCONFKEY_SETAPPL_ACCESSIBILITY_TURN_OFF_ALL_SOUNDS VCONFKEY_SETAPPL_PREFIX"/accessibility/turn_off_all_sounds"
63 #endif
64
65 /* Fake-BG : bundle */
66 #define SHOWLOCK "show_lock"
67 #define ISTRUE "TRUE"
68
69 /* For voice control */
70 #define SHOWVOLUME "show_volume"
71
72 #define LOCKSCREEN_PKG "org.tizen.lockscreen"
73
74 #define SCREEN_W_HD 720
75 #define SCREEN_H_HD 1280
76
77 #define SCREEN_W_WVGA 480
78 #define SCREEN_H_WVGA 800
79
80 #define SCREEN_W_FHD 1080
81 #define SCREEN_H_FHD 1920
82
83 #define WIN_WIDTH 456
84 #define WIN_HEIGHT_WITH_WARNING 222
85 #define WIN_HEIGHT 102
86
87 #define WIN_LANDSCAPE_X 79
88 #define WIN_LANDSCAPE_INVERTED_X volume_control_get_viewport_width()-WIN_HEIGHT_WITH_WARNING-WIN_LANDSCAPE_X
89 #define WIN_LANDSCAPE_Y (volume_control_get_viewport_height()-WIN_WIDTH)/2
90 #define WIN_PORTRAIT_X 12
91 #define WIN_PORTRAIT_Y 113
92 #define WIN_SLIDER_TOUCHING_OFFSET 55
93
94 #define SOUND_TYPE_SYSTEM 0
95 #define SOUND_TYPE_NOTIFICATION 1
96 #define SOUND_TYPE_ALARM 2
97 #define SOUND_TYPE_RINGTONE 3
98 #define SOUND_TYPE_MEDIA 4
99 #define SOUND_TYPE_CALL 5
100
101 #define VOLUME_MAX_SAFETY_VOLUME_LEVEL 10
102
103 typedef enum {
104         TYPE_VCONF_SOUND_STATUS = 0,
105         TYPE_VCONF_VIBRATION_STATUS
106 } volume_vconf_type_e;
107
108 /* Volume : return values */
109 typedef enum {
110         VOLUME_ERROR_OK = 0,
111         VOLUME_ERROR_FAIL = -1,
112         VOLUME_ERROR_INVALID_PARAMETER = -2,
113         VOLUME_ERROR_NO_DATA = -3
114 } volume_error_e;
115
116 #endif /* __VOLUME_H__ */
117