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.
21 #include "indicator.h"
22 #include "indicator_ui.h"
24 #include "indicator_icon_util.h"
26 #define ICON_PRIORITY INDICATOR_PRIORITY_NON_FIXED_6
27 #define MODULE_NAME "mmc"
28 #define TIMER_INTERVAL 0.3
30 static int register_mmc_module(void *data);
31 static int unregister_mmc_module(void);
33 Indicator_Icon_Object mmc = {
35 .priority = ICON_PRIORITY,
36 .always_top = EINA_TRUE,
37 .exist_in_view = EINA_FALSE,
40 .obj_exist = EINA_FALSE,
42 .init = register_mmc_module,
43 .fini = unregister_mmc_module
46 static const char *icon_path[] = {
47 "Background_playing/B03_Memorycard.png",
51 static void indicator_mmc_change_cb(keynode_t *node, void *data)
56 retif(data == NULL, , "Invalid parameter!");
58 ret = vconf_get_int(VCONFKEY_FILEMANAGER_DB_STATUS, &status);
60 ERR("Failed to get VCONFKEY_MMC_STATE!");
65 case VCONFKEY_FILEMANAGER_DB_UPDATING:
67 mmc.img_obj.data = icon_path[0];
68 indicator_util_icon_show(&mmc);
69 indicator_util_icon_animation_set(&mmc, ICON_ANI_BLINK);
72 case VCONFKEY_FILEMANAGER_DB_UPDATED:
74 indicator_util_icon_hide(&mmc);
79 static int register_mmc_module(void *data)
83 retif(data == NULL, FAIL, "Invalid parameter!");
85 ret = vconf_notify_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS,
86 indicator_mmc_change_cb, data);
88 ERR("Failed to register mmcback!");
90 indicator_mmc_change_cb(NULL, data);
95 static int unregister_mmc_module(void)
99 ret = vconf_ignore_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS,
100 indicator_mmc_change_cb);
102 ERR("Failed to unregister mmcback!");
104 indicator_util_icon_hide(&mmc);