*/
extern char *util_safe_str(const char *str, const char *str_search);
+/**
+ * @brief Checks if @a str starts with @a prefix
+ *
+ * @param[in] prefix prefix candidate
+ * @param[in] str string to examine
+ *
+ * @return true if @a prefix is a prefix of @a str, false otherwise
+ */
+bool util_string_prefix_check(const char *prefix, const char *str);
+
#ifdef _SUPPORT_SCREEN_READER
extern Evas_Object *util_access_object_register(Evas_Object *object, Evas_Object *layout);
extern void util_access_object_unregister(Evas_Object *object);
.fini = unregister_noti_module
};
+typedef struct {
+ char *name;
+ int priority;
+} minictrl_prop;
+
+static minictrl_prop noti_minictrl_app_list[] = {
+ {"call", 1},
+ {"call_mute", 2},
+ {"call_speaker", 3},
+ {"music", 4},
+ {"video", 5},
+ {"voice_recorder", 6},
+ /* {"3rd_party", 7} TODO This will be handled later*/
+};
+
struct noti_status {
notification_h noti;
icon_s *icon;
}
+static int noti_icon_priority_get(const char *tag)
+{
+ int i;
+ int minictrl_len = strlen("minicontrol_");
+ for (i = 0; i < ARRAY_SIZE(noti_minictrl_app_list); i++){
+ if (!strcmp(tag + minictrl_len, noti_minictrl_app_list[i].name)) {
+ _D("Sufix is is:%s", noti_minictrl_app_list[i].name);
+ return noti_minictrl_app_list[i].priority;
+ }
+ }
+ return 0;
+}
+
+
+static void _noti_minicontrol_set(struct noti_status *noti_data)
+{
+ const char *tag = NULL;
+ int ret;
+
+ ret = notification_get_tag(noti_data->noti, &tag);
+ retm_if(ret != NOTIFICATION_ERROR_NONE,
+ "notification_get_tag failed[%d]:%s", ret, get_error_message(ret));
+
+ if (util_string_prefix_check("minicontrol", tag)){
+ int p = noti_icon_priority_get(tag);
+ if(p) {
+ _D("The icon is for minicontrol area.");
+ noti_data->icon->priority = p;
+ noti_data->icon->area = INDICATOR_ICON_AREA_MINICTRL;
+ }
+ }
+}
+
+
static void _icon_add(struct noti_status *noti_data, const char *name, void *data)
{
retm_if(noti_data == NULL || data == NULL, "Invalid parameter!");
obj->exist_in_view = EINA_FALSE;
noti_data->icon = obj;
+
+ _noti_minicontrol_set(noti_data);
}
return;
if (!_is_exist_by_privid(prev_id_str)) {
status = calloc(1, sizeof(struct noti_status));
- _icon_add(status, prev_id_str, data);
ret = notification_clone(noti, &status->noti);
- retm_if(ret != NOTIFICATION_ERROR_NONE, "notification_clone failed[%d]:%s", ret , get_error_message(ret));
+ retm_if(ret != NOTIFICATION_ERROR_NONE,
+ "notification_clone failed[%d]:%s", ret , get_error_message(ret));
+ _icon_add(status, prev_id_str, data);
insert_icon_list(status);
status_list = eina_list_append(status_list, status);
show_image_icon(status);
ret = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR, &indicator_path);
retm_if(ret != NOTIFICATION_ERROR_NONE, "notification_get_image failed[%d]:%s", ret , get_error_message(ret));
- if (!indicator_path) {
+ if (!indicator_path)
_E("The icon path is NULL");
return;
- }
if (ecore_file_exists(indicator_path) ||
util_check_noti_ani(indicator_path) ||
}
} else
_E("The path is invalid:%s", icon_path);
-
if (icon_path) {
free(icon_path);
icon_path = NULL;
}
+
return;
}