2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://www.tizenopensource.org/license
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.
16 #ifndef __SETTING_PROFILE_H__
17 #define __SETTING_PROFILE_H__
22 #include <Elementary.h>
23 #include <appcore-efl.h>
25 #include <glib-object.h>
26 #include <ui-gadget.h>
27 #include <ui-gadget-module.h>
30 #include <mm_player.h>
35 #include <devman_haptic.h>
38 #include <setting-common-draw-widget.h>
39 #include <setting-common-view.h>
42 #define HAPTIC_TEST_ITERATION 1
43 #define VOLUME_DEN (15.0) /* ie equals float(SETTING_SOUND_VOL_MAX) */
46 SETTING_PROF_VIEW_VOL = 0,
47 SETTING_PROF_VIEW_RTN,
49 } setting_profile_types;
52 SETTING_VOL_TYPE_RINGTONE = 0,
53 SETTING_VOL_TYPE_NOTIFICATION,
54 SETTING_VOL_TYPE_MEDIA,
55 SETTING_VOL_TYPE_SYSTEM,
56 SETTING_VOL_TYPE_NOTI_VIB,
57 SETTING_VOL_TYPE_HAPTIC_VIB,
59 } setting_volume_types;
62 SETTING_VOL_SOUND_GROUP = 0,
63 SETTING_VOL_VIBRATION_GROUP,
65 } setting_volume_groups;
67 #define SETTING_VIB_VOL_MAX 5
68 #define SETTING_VIB_VOL_MIN 1
69 #define SETTING_SOUND_VOL_MAX 15
70 #define SETTING_SOUND_VOL_MIN 1
71 #define SETTING_SYSTEM_VOL_MAX 15
72 #define SETTING_SYSTEM_VOL_MIN 0
73 #define SETTING_SOUND_CONTROLBAR_ITEM_LEN 10
75 #define SETTING_DEFAULT_RINGTONE_VOL_INT 13
76 #define SETTING_DEFAULT_NOTI_VOL_INT 7
77 #define SETTING_DEFAULT_MEDIA_VOL_INT 7
78 #define SETTING_DEFAULT_SYSTEM_VOL_INT 5
79 #define SETTING_DEFAULT_NOTI_VIB_INT 5
80 #define SETTING_DEFAULT_HAPTIC_VIB_INT 3
81 #define SETTING_DEFAULT_ALERT_REPEAT_TYPE_INT 0
83 #define SETTING_DEFAULT_RINGTONE_PATH "/opt/share/settings/Ringtones/"
84 #define SETTING_DEFAULT_ALERT_PATH "/opt/share/settings/Alerts/"
85 #define SETTING_PROFILE_MMC_PATH "/opt/storage/sdcard/"
87 #define SETTING_DEFAULT_CALL_TONE SETTING_DEFAULT_RINGTONE_PATH"General_Over the horizon.mp3"
88 #define SETTING_DEFAULT_MSG_TONE SETTING_DEFAULT_CALL_TONE
89 #define SETTING_DEFAULT_EMAIL_TONE SETTING_DEFAULT_CALL_TONE
90 #define SETTING_DEFAULT_CALENDAR_TONE SETTING_DEFAULT_CALL_TONE
92 typedef struct _SettingProfileUG SettingProfileUG;
95 * Setting Profile UG context
96 * all UG function has void* as an agument. this is casted back to SettingProfileUG
97 * and the functions access app context.
99 struct _SettingProfileUG {
100 struct ui_gadget *ug;
101 struct ui_gadget *ug_loading;
103 /* add more variables here (move your appdata to here) */
105 Evas_Object *win_main_layout;
106 Evas_Object *win_get;
107 Evas_Object *navi_bar;
108 Evas_Object *ctrl_bar;
109 Evas_Object *ly_main;
111 Elm_Genlist_Item_Class itc_1text_1icon;
112 Elm_Genlist_Item_Class itc_group_item;
113 Elm_Genlist_Item_Class itc_2text_2;
114 Elm_Genlist_Item_Class itc_layout;
115 Elm_Genlist_Item_Class itc_seperator;
116 Elm_Genlist_Item_Class itc_bg_1icon;
117 Elm_Genlist_Item_Class itc_2text_3_parent;
118 Elm_Genlist_Item_Class itc_1icon_1text_sub;
121 Setting_GenGroupItem_Data *data_sound;
122 Setting_GenGroupItem_Data *data_vibration;
123 Setting_GenGroupItem_Data *data_call_volume;
124 Setting_GenGroupItem_Data *data_noti_volume;
125 Setting_GenGroupItem_Data *data_vib_volume;
126 Setting_GenGroupItem_Data *data_touch_volume;
127 Setting_GenGroupItem_Data *data_touch_vib;
128 Setting_GenGroupItem_Data *data_media_volume;
130 MMHandleType *mp_ringtone;
131 MMHandleType *mp_noti;
132 MMHandleType *mp_sys;
133 MMHandleType *mp_media;
135 Ecore_Timer *volume_timer;
136 setting_volume_types cur_vol_type;
144 extern setting_view setting_view_profile_sound_main;
146 void setting_profile_play_sound_origin(MMHandleType **mp_handle, void *data,
147 void *cb, char *ringtone_file, float vol,
148 enum MMSoftwareVolumeTableType table_type);
149 void setting_profile_change_player_volume(MMHandleType **mp_handle, void *data, float vol);
151 int setting_profile_check_file_exist(void *data, const char *file_path);
153 MMHandleType *setting_profile_play_sound(void *data, void *cb,
156 enum MMSoftwareVolumeTableType table_type);
158 int setting_profile_stop_sound(void *data, MMHandleType *player);
159 int setting_profile_close_other_mm_players_but_type(void *data,
161 int setting_profile_close_all_mm_players(void *data);
162 void setting_profile_play_vibration(void *data, int value);
164 int setting_profile_get_call_playing_vib_by_vconf_value(int call_vib_value);