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://floralicense.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 <appcore-common.h>
22 #include <app_service.h>
23 #include <runtime_info.h>
26 #include <unicode/uloc.h>
27 #include <unicode/udat.h>
28 #include <unicode/udatpg.h>
29 #include <unicode/ustring.h>
30 #include "noti_node.h"
31 #include <notification.h>
33 #include "quickpanel-ui.h"
35 #include "list_util.h"
36 #include "quickpanel_theme_def.h"
37 #include "noti_gridbox.h"
41 #ifndef VCONFKEY_QUICKPANEL_STARTED
42 #define VCONFKEY_QUICKPANEL_STARTED "memory/private/"PACKAGE_NAME"/started"
43 #endif /* VCONFKEY_QUICKPANEL_STARTED */
45 #define QP_DEFAULT_ICON ICONDIR"/quickpanel_icon_default.png"
46 #define QP_NOTI_DAY_DEC (24 * 60 * 60)
48 #define QP_NOTI_ONGOING_DBUS_PATH "/dbus/signal"
49 #define QP_NOTI_ONGOING_DBUS_INTERFACE "notification.ongoing"
53 noti_node *g_noti_node;
54 static Eina_List *g_animated_image_list;
56 static Evas_Object *g_noti_gridbox;
57 static Elm_Genlist_Item_Class *itc_noti;
58 static Elm_Genlist_Item_Class *itc_ongoing;
59 static Elm_Genlist_Item_Class *g_itc;
61 static Evas_Object *g_window;
63 static Elm_Object_Item *noti_group;
64 static Elm_Object_Item *ongoing_first;
65 static Elm_Object_Item *noti_first;
67 static int quickpanel_noti_init(void *data);
68 static int quickpanel_noti_fini(void *data);
69 static int quickpanel_noti_suspend(void *data);
70 static int quickpanel_noti_resume(void *data);
71 static void quickpanel_noti_lang_changed(void *data);
72 static void quickpanel_noti_refresh(void *data);
73 static unsigned int quickpanel_noti_get_height(void *data);
77 .init = quickpanel_noti_init,
78 .fini = quickpanel_noti_fini,
79 .suspend = quickpanel_noti_suspend,
80 .resume = quickpanel_noti_resume,
81 .lang_changed = quickpanel_noti_lang_changed,
84 .refresh = quickpanel_noti_refresh,
85 .get_height = quickpanel_noti_get_height,
88 Eina_Bool _quickpanel_noti_update_notibox_idler(void *data)
90 retif(data == NULL, ECORE_CALLBACK_CANCEL, "data is null");
92 Elm_Object_Item *item = data;
93 elm_genlist_item_update(item);
95 return ECORE_CALLBACK_CANCEL;
98 static void _quickpanel_noti_update_notibox(void) {
99 if (noti_group != NULL) {
100 ecore_idler_add(_quickpanel_noti_update_notibox_idler, noti_group);
103 if (noti_first != NULL) {
104 ecore_idler_add(_quickpanel_noti_update_notibox_idler, noti_first);
108 static void _quickpanel_noti_clear_clicked_cb(void *data, Evas_Object * obj,
111 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
113 noti_err = notifiation_clear(NOTIFICATION_TYPE_NOTI);
115 DBG("Clear Clicked : noti_err(%d)", noti_err);
117 quickpanel_play_feedback();
120 static char *_quickpanel_noti_get_progress(notification_h noti, char *buf,
124 double percentage = 0.0;
126 retif(noti == NULL, NULL, "Invalid parameter!");
128 notification_get_size(noti, &size);
129 notification_get_progress(noti, &percentage);
131 if (percentage < 1 && percentage > 0) {
132 if (snprintf(buf, buf_len, "%d%%", (int)(percentage * 100))
137 } else if (size > 0) {
138 if (size > (1 << 30)) {
139 if (snprintf(buf, buf_len, "%.1lfGB",
140 size / 1000000000.0) <= 0)
144 } else if (size > (1 << 20)) {
145 if (snprintf(buf, buf_len, "%.1lfMB",
146 size / 1000000.0) <= 0)
150 } else if (size > (1 << 10)) {
151 if (snprintf(buf, buf_len, "%.1lfKB",
157 if (snprintf(buf, buf_len, "%lfB", size) <= 0)
167 static notification_h _quickpanel_noti_update_item_progress(const char *pkgname,
171 char *noti_pkgname = NULL;
172 int noti_priv_id = 0;
174 noti_node_item *node = noti_node_get(g_noti_node, priv_id);
176 if (node != NULL && node->noti != NULL) {
177 notification_get_pkgname(node->noti, ¬i_pkgname);
178 notification_get_id(node->noti, NULL, ¬i_priv_id);
179 if (!strcmp(noti_pkgname, pkgname)
180 && priv_id == noti_priv_id) {
181 notification_set_progress(node->noti, progress);
189 static notification_h _quickpanel_noti_update_item_size(const char *pkgname,
193 char *noti_pkgname = NULL;
194 int noti_priv_id = 0;
196 noti_node_item *node = noti_node_get(g_noti_node, priv_id);
198 if (node != NULL && node->noti != NULL) {
199 notification_get_pkgname(node->noti, ¬i_pkgname);
200 notification_get_id(node->noti, NULL, ¬i_priv_id);
201 if (!strcmp(noti_pkgname, pkgname)
202 && priv_id == noti_priv_id) {
203 notification_set_size(node->noti, size);
211 static notification_h _quickpanel_noti_update_item_content(const char *pkgname,
215 char *noti_pkgname = NULL;
216 int noti_priv_id = 0;
218 noti_node_item *node = noti_node_get(g_noti_node, priv_id);
220 if (node != NULL && node->noti != NULL) {
221 notification_get_pkgname(node->noti, ¬i_pkgname);
222 notification_get_id(node->noti, NULL, ¬i_priv_id);
223 if (!strcmp(noti_pkgname, pkgname)
224 && priv_id == noti_priv_id) {
225 notification_set_text(node->noti,
226 NOTIFICATION_TEXT_TYPE_CONTENT,
228 NOTIFICATION_VARIABLE_TYPE_NONE);
236 static void _quickpanel_noti_update_progressbar(void *data,
237 notification_h update_noti)
239 struct appdata *ad = NULL;
240 Elm_Object_Item *found = NULL;
242 retif(!data, , "data is NULL");
245 retif(!ad->list, , "ad->list is NULL");
249 if (notification_get_id(update_noti, NULL, &priv_id) == NOTIFICATION_ERROR_NONE) {
250 noti_node_item *node = noti_node_get(g_noti_node, priv_id);
257 retif(!found, , "fail to find %p related gl item", update_noti);
259 elm_genlist_item_fields_update(found, "*", ELM_GENLIST_ITEM_FIELD_ALL);
262 static void _quickpanel_noti_item_progress_update_cb(void *data,
269 notification_h noti = NULL;
271 retif(data == NULL || msg == NULL, , "Invalid parameter!");
273 dbus_error_init(&err);
274 dbus_message_get_args(msg, &err,
275 DBUS_TYPE_STRING, &pkgname,
276 DBUS_TYPE_INT32, &priv_id,
277 DBUS_TYPE_DOUBLE, &progress,
280 if (dbus_error_is_set(&err)) {
281 ERR("dbus err: %s", err.message);
282 dbus_error_free(&err);
286 if (pkgname == NULL) {
287 ERR("pkgname is null");
291 /* check item on the list */
292 noti = _quickpanel_noti_update_item_progress(pkgname,
294 retif(noti == NULL, , "Can not found noti data.");
296 DBG("pkgname[%s], priv_id[%d], progress[%lf]",
297 pkgname, priv_id, progress);
299 _quickpanel_noti_update_progressbar(data, noti);
302 static void _quickpanel_noti_item_size_update_cb(void *data, DBusMessage * msg)
308 notification_h noti = NULL;
310 retif(data == NULL || msg == NULL, , "Invalid parameter!");
312 dbus_error_init(&err);
313 dbus_message_get_args(msg, &err,
314 DBUS_TYPE_STRING, &pkgname,
315 DBUS_TYPE_INT32, &priv_id,
316 DBUS_TYPE_DOUBLE, &size, DBUS_TYPE_INVALID);
317 if (dbus_error_is_set(&err)) {
318 ERR("dbus err: %s", err.message);
319 dbus_error_free(&err);
323 if (pkgname == NULL) {
324 ERR("pkgname is null");
328 /* check item on the list */
329 noti = _quickpanel_noti_update_item_size(pkgname, priv_id, size);
330 retif(noti == NULL, , "Can not found noti data.");
332 DBG("pkgname[%s], priv_id[%d], progress[%lf]",
333 pkgname, priv_id, size);
336 _quickpanel_noti_update_progressbar(data, noti);
339 static void _quickpanel_noti_item_content_update_cb(void *data,
343 char *pkgname = NULL;
345 char *content = NULL;
346 notification_h noti = NULL;
348 retif(data == NULL || msg == NULL, , "Invalid parameter!");
350 dbus_error_init(&err);
351 dbus_message_get_args(msg, &err,
352 DBUS_TYPE_STRING, &pkgname,
353 DBUS_TYPE_INT32, &priv_id,
354 DBUS_TYPE_STRING, &content, DBUS_TYPE_INVALID);
356 if (pkgname == NULL) {
357 ERR("pkgname is null");
360 if (content == NULL) {
361 ERR("content is null");
365 if (dbus_error_is_set(&err)) {
366 ERR("dbus err: %s", err.message);
367 dbus_error_free(&err);
371 DBG("pkgname[%s], priv_id[%d], content[%s]",
372 pkgname, priv_id, content);
374 /* check item on the list */
375 noti = _quickpanel_noti_update_item_content(pkgname, priv_id, content);
376 retif(noti == NULL, , "Can not found noti data.");
379 _quickpanel_noti_update_progressbar(data, noti);
382 char *quickpanel_noti_get_time(time_t t, char *buf, int buf_len)
384 UErrorCode status = U_ZERO_ERROR;
385 UDateTimePatternGenerator *generator;
386 UDateFormat *formatter;
387 UChar skeleton[40] = { 0 };
388 UChar pattern[40] = { 0 };
389 UChar formatted[40] = { 0 };
390 int32_t patternCapacity, formattedCapacity;
391 int32_t skeletonLength, patternLength, formattedLength;
394 const char customSkeleton[] = UDAT_YEAR_NUM_MONTH_DAY;
395 char bf1[32] = { 0, };
396 bool is_24hour_enabled = FALSE;
399 time_t today, yesterday;
403 localtime_r(&today, &loc_time);
407 loc_time.tm_hour = 0;
408 today = mktime(&loc_time);
410 yesterday = today - QP_NOTI_DAY_DEC;
412 localtime_r(&t, &loc_time);
414 if (t >= yesterday && t < today) {
415 ret = snprintf(buf, buf_len, _S("IDS_COM_BODY_YESTERDAY"));
416 } else if (t < yesterday) {
417 /* set UDate from time_t */
418 date = (UDate) t * 1000;
420 /* get default locale */
421 /* for thread saftey */
422 uloc_setDefault(__secure_getenv("LC_TIME"), &status);
423 locale = uloc_getDefault();
425 /* open datetime pattern generator */
426 generator = udatpg_open(locale, &status);
427 if (generator == NULL)
430 /* calculate pattern string capacity */
432 (int32_t) (sizeof(pattern) / sizeof((pattern)[0]));
434 /* ascii to unicode for input skeleton */
435 u_uastrcpy(skeleton, customSkeleton);
437 /* get skeleton length */
438 skeletonLength = strlen(customSkeleton);
440 /* get best pattern using skeleton */
442 udatpg_getBestPattern(generator, skeleton, skeletonLength,
443 pattern, patternCapacity, &status);
445 /* open datetime formatter using best pattern */
447 udat_open(UDAT_IGNORE, UDAT_DEFAULT, locale, NULL, -1,
448 pattern, patternLength, &status);
449 if (formatter == NULL) {
450 udatpg_close(generator);
454 /* calculate formatted string capacity */
456 (int32_t) (sizeof(formatted) / sizeof((formatted)[0]));
458 /* formatting date using formatter by best pattern */
460 udat_format(formatter, date, formatted, formattedCapacity,
463 /* unicode to ascii to display */
464 u_austrcpy(bf1, formatted);
466 /* close datetime pattern generator */
467 udatpg_close(generator);
469 /* close datetime formatter */
470 udat_close(formatter);
472 ret = snprintf(buf, buf_len, "%s", bf1);
474 ret = runtime_info_get_value_bool(
475 RUNTIME_INFO_KEY_24HOUR_CLOCK_FORMAT_ENABLED, &is_24hour_enabled);
476 if (ret == RUNTIME_INFO_ERROR_NONE && is_24hour_enabled == TRUE) {
477 ret = strftime(buf, buf_len, "%H:%M", &loc_time);
479 strftime(bf1, sizeof(bf1), "%l:%M", &loc_time);
481 if (loc_time.tm_hour >= 0 && loc_time.tm_hour < 12)
482 ret = snprintf(buf, buf_len, "%s%s", bf1, "AM");
484 ret = snprintf(buf, buf_len, "%s%s", bf1, "PM");
489 return ret <= 0 ? NULL : buf;
492 static void _quickpanel_noti_ani_image_control(Eina_Bool on)
494 const Eina_List *l = NULL;
495 const Eina_List *ln = NULL;
496 Evas_Object *entry_obj = NULL;
498 retif(g_animated_image_list == NULL, ,"");
500 EINA_LIST_FOREACH_SAFE(g_animated_image_list, l, ln, entry_obj) {
501 if (entry_obj == NULL) continue;
503 if (on == EINA_TRUE) {
504 if (elm_image_animated_play_get(entry_obj) == EINA_FALSE) {
505 elm_image_animated_play_set(entry_obj, EINA_TRUE);
508 if (elm_image_animated_play_get(entry_obj) == EINA_TRUE) {
509 elm_image_animated_play_set(entry_obj, EINA_FALSE);
515 static void _quickpanel_noti_ani_image_deleted_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
517 retif(obj == NULL, , "obj is NULL");
518 retif(g_animated_image_list == NULL, , "list is empty");
520 g_animated_image_list = eina_list_remove(g_animated_image_list, obj);
523 static Evas_Object *_quickpanel_noti_box_gl_get_content(void *data,
524 Evas_Object *obj, const char *part) {
525 retif(part == NULL, NULL, "invalid parameter");
527 if (strcmp(part, "elm.icon") == 0) {
528 DBG("returned:%p", g_noti_gridbox);
529 return g_noti_gridbox;
535 static Evas_Object *_quickpanel_noti_gl_get_content(void *data,
536 Evas_Object *obj, const char *part)
538 qp_item_data *qid = NULL;
539 notification_h noti = NULL;
540 Evas_Object *ic = NULL;
541 char *icon_path = NULL;
542 char *thumbnail_path = NULL;
543 char *ret_path = NULL;
545 double percentage = 0.0;
546 notification_type_e type = NOTIFICATION_TYPE_NONE;
547 char group_name[64] = {0,};
548 notification_ly_type_e layout = NOTIFICATION_LY_NONE ;
550 retif(!data, NULL, "data is NULL");
553 noti = quickpanel_list_util_item_get_data(qid);
554 retif(noti == NULL, NULL, "noti is NULL");
557 (part, "elm.swallow.progress", strlen("elm.swallow.progress"))) {
558 notification_get_type(noti, &type);
559 if (type == NOTIFICATION_TYPE_ONGOING) {
560 notification_get_size(noti, &size);
561 notification_get_progress(noti, &percentage);
562 notification_get_layout(noti, &layout);
564 if (layout != NOTIFICATION_LY_ONGOING_EVENT) {
565 if (percentage > 0 && percentage <= 1) {
566 ic = elm_progressbar_add(obj);
570 elm_object_style_set(ic, "quickpanel/list_progress");
571 elm_progressbar_value_set(ic, percentage);
572 elm_progressbar_horizontal_set(ic, EINA_TRUE);
573 elm_progressbar_pulse(ic, EINA_FALSE);
574 } else if (size > 0) {
575 ic = elm_progressbar_add(obj);
579 elm_object_style_set(ic, "quickpanel/pending_list");
580 elm_progressbar_horizontal_set(ic, EINA_TRUE);
581 elm_progressbar_pulse(ic, EINA_TRUE);
588 ic = elm_image_add(obj);
589 retif(ic == NULL, NULL, "Failed to create elm icon.");
591 notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_THUMBNAIL,
593 notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &icon_path);
595 snprintf(group_name, sizeof(group_name) - 1, "notification_item_%d", eina_list_count(g_animated_image_list));
598 (part, "elm.swallow.thumbnail", strlen("elm.swallow.thumbnail"))) {
599 if (thumbnail_path == NULL)
600 ret_path = icon_path;
602 ret_path = thumbnail_path;
604 elm_image_resizable_set(ic, EINA_FALSE, EINA_TRUE);
607 || (elm_image_file_set(ic, ret_path, group_name) == EINA_FALSE))
608 elm_image_file_set(ic, QP_DEFAULT_ICON, group_name);
609 } else if (!strncmp(part, "elm.swallow.icon",
610 strlen("elm.swallow.icon"))) {
611 if (thumbnail_path == NULL)
614 ret_path = icon_path;
616 if (ret_path != NULL)
617 elm_image_file_set(ic, ret_path, group_name);
620 if (ic != NULL && elm_image_animated_available_get(ic) == EINA_TRUE) {
621 elm_image_animated_set(ic, EINA_TRUE);
622 g_animated_image_list = eina_list_append(g_animated_image_list, ic);
623 evas_object_event_callback_add(ic, EVAS_CALLBACK_DEL, _quickpanel_noti_ani_image_deleted_cb, ic);
626 elm_image_animated_play_set(ic, EINA_TRUE);
631 static char *_quickpanel_ongoing_noti_gl_get_text(void *data, Evas_Object * obj,
634 qp_item_data *qid = NULL;
635 notification_h noti = NULL;
636 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
640 char *pkgname = NULL;
641 char *caller_pkgname = NULL;
642 int group_id = 0, priv_id = 0;
643 char buf[128] = { 0, };
644 notification_type_e type = NOTIFICATION_TYPE_NONE;
646 double percentage = 0.0;
647 int isProgressBarEnabled = 1;
648 notification_ly_type_e layout = NOTIFICATION_LY_NONE ;
650 retif(!data, NULL, "data is NULL");
653 noti = quickpanel_list_util_item_get_data(qid);
654 retif(noti == NULL, NULL, "noti is NULL");
656 /* Set text domain */
657 notification_get_text_domain(noti, &domain, &dir);
658 if (domain != NULL && dir != NULL)
659 bindtextdomain(domain, dir);
661 /* Get pkgname & id */
662 notification_get_pkgname(noti, &pkgname);
663 notification_get_application(noti, &caller_pkgname);
664 notification_get_id(noti, &group_id, &priv_id);
665 notification_get_type(noti, &type);
666 notification_get_size(noti, &size);
667 notification_get_progress(noti, &percentage);
668 notification_get_layout(noti, &layout);
670 DBG("percentage:%f size:%f", percentage, size);
672 if (percentage <= 0.0 && size <= 0.0) {
673 isProgressBarEnabled = 0;
676 if (!strcmp(part, "elm.text.title")) {
677 noti_err = notification_get_text(noti,
678 NOTIFICATION_TEXT_TYPE_TITLE,
680 if (noti_err != NOTIFICATION_ERROR_NONE)
682 } else if (!strcmp(part, "elm.text.content")) {
683 if (layout == NOTIFICATION_LY_ONGOING_EVENT) {
687 noti_err = notification_get_text(noti,
688 NOTIFICATION_TEXT_TYPE_CONTENT,
690 if (noti_err != NOTIFICATION_ERROR_NONE)
692 } else if (!strcmp(part, "elm.text.content.multiline")) {
693 if (layout != NOTIFICATION_LY_ONGOING_EVENT) {
697 noti_err = notification_get_text(noti,
698 NOTIFICATION_TEXT_TYPE_CONTENT,
700 if (noti_err != NOTIFICATION_ERROR_NONE)
702 } else if (!strcmp(part, "elm.text.time")) {
703 if (isProgressBarEnabled == 0)
706 if (layout == NOTIFICATION_LY_ONGOING_EVENT) {
710 text = _quickpanel_noti_get_progress(noti, buf,
720 static Eina_Bool _quickpanel_noti_gl_get_state(void *data, Evas_Object * obj,
723 qp_item_data *qid = NULL;
724 notification_h noti = NULL;
725 char *pkgname = NULL;
726 int group_id = 0, priv_id = 0;
727 char *content = NULL;
729 notification_ly_type_e layout = NOTIFICATION_LY_NONE;
731 retif(!data, EINA_FALSE, "data is NULL");
734 noti = quickpanel_list_util_item_get_data(qid);
735 retif(noti == NULL, EINA_FALSE, "noti is NULL");
737 notification_get_pkgname(noti, &pkgname);
738 notification_get_id(noti, &group_id, &priv_id);
739 notification_get_layout(noti, &layout);
741 if (!strcmp(part, "elm.text.content")) {
742 notification_get_text(noti,
743 NOTIFICATION_TEXT_TYPE_CONTENT, &content);
744 if (content != NULL && layout != NOTIFICATION_LY_ONGOING_EVENT)
746 } else if (!strcmp(part, "elm.text.content.multiline")) {
747 notification_get_text(noti,
748 NOTIFICATION_TEXT_TYPE_CONTENT, &content);
749 if (content != NULL && layout == NOTIFICATION_LY_ONGOING_EVENT)
751 } else if (!strcmp(part, "elm.text.time")) {
752 notification_get_time(noti, &time);
761 static void _quickpanel_do_noti_delete(notification_h noti) {
762 char *pkgname = NULL;
763 char *caller_pkgname = NULL;
764 int flags = 0, priv_id = 0, flag_delete = 0;
765 notification_type_e type = NOTIFICATION_TYPE_NONE;
767 quickpanel_play_feedback();
769 retif(noti == NULL, , "Invalid parameter!");
771 notification_get_pkgname(noti, &caller_pkgname);
772 notification_get_application(noti, &pkgname);
774 pkgname = caller_pkgname;
776 notification_get_id(noti, NULL, &priv_id);
777 notification_get_property(noti, &flags);
778 notification_get_type(noti, &type);
780 if (flags & NOTIFICATION_PROP_PERMANENT_DISPLAY)
785 if (flag_delete == 1 && type == NOTIFICATION_TYPE_NOTI) {
786 notification_delete_by_priv_id(caller_pkgname, NOTIFICATION_TYPE_NOTI,
791 static void _quickpanel_do_noti_press(notification_h noti) {
793 char *pkgname = NULL;
794 char *caller_pkgname = NULL;
796 bundle *group_args = NULL;
797 bundle *single_service_handle = NULL;
798 bundle *multi_service_handle = NULL;
799 int flags = 0, group_id = 0, priv_id = 0, count = 0, flag_launch = 0,
801 notification_type_e type = NOTIFICATION_TYPE_NONE;
803 quickpanel_play_feedback();
805 retif(noti == NULL, , "Invalid parameter!");
807 notification_get_pkgname(noti, &caller_pkgname);
808 notification_get_application(noti, &pkgname);
810 pkgname = caller_pkgname;
812 notification_get_id(noti, &group_id, &priv_id);
813 notification_get_property(noti, &flags);
814 notification_get_type(noti, &type);
816 if (flags & NOTIFICATION_PROP_DISABLE_APP_LAUNCH)
821 if (flags & NOTIFICATION_PROP_DISABLE_AUTO_DELETE)
826 notification_get_execute_option(noti,
827 NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
828 NULL, &single_service_handle);
829 notification_get_execute_option(noti,
830 NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH,
831 NULL, &multi_service_handle);
833 if (flag_launch == 1) {
834 /* Hide quickpanel */
835 quickpanel_close_quickpanel(true);
837 if (group_id != NOTIFICATION_GROUP_ID_NONE)
838 notification_get_count(type,
839 caller_pkgname, group_id,
844 if (count > 1 && multi_service_handle != NULL) {
845 ret = quickpanel_launch_app(NULL, multi_service_handle);
846 quickpanel_launch_app_inform_result(pkgname, ret);
848 else if (single_service_handle != NULL) {
849 ret = quickpanel_launch_app(NULL, single_service_handle);
850 quickpanel_launch_app_inform_result(pkgname, ret);
853 notification_get_args(noti, &args, &group_args);
855 if (count > 1 && group_args != NULL) {
856 ret = quickpanel_launch_app(pkgname, group_args);
857 quickpanel_launch_app_inform_result(pkgname, ret);
859 ret = quickpanel_launch_app(pkgname, args);
860 quickpanel_launch_app_inform_result(pkgname, ret);
866 if (flag_delete == 1 && type == NOTIFICATION_TYPE_NOTI) {
867 notification_delete_by_priv_id(caller_pkgname,
868 NOTIFICATION_TYPE_NOTI,
873 static void quickpanel_notibox_delete_cb(void *data, Evas_Object * obj) {
875 noti_node_item *item = data;
876 retif(item == NULL, , "Invalid parameter!");
878 notification_h noti = item->noti;
879 retif(noti == NULL, , "Invalid parameter!");
881 _quickpanel_do_noti_delete(noti);
885 static void quickpanel_notibox_select_cb(void *data, Evas_Object * obj) {
887 noti_node_item *item = data;
888 retif(item == NULL, , "Invalid parameter!");
890 notification_h noti = item->noti;
891 retif(noti == NULL, , "Invalid parameter!");
893 _quickpanel_do_noti_press(noti);
896 static void quickpanel_noti_select_cb(void *data, Evas_Object * obj,
898 retif(data == NULL, , "Invalid parameter!");
899 notification_h noti = (notification_h) quickpanel_list_util_item_get_data(data);
900 retif(noti == NULL, , "Invalid parameter!");
902 elm_genlist_item_selected_set((Elm_Object_Item *) event_info, EINA_FALSE);
904 _quickpanel_do_noti_press(noti);
907 static Evas_Object *_quickpanel_noti_gl_get_group_content(void *data,
911 Evas_Object *eo = NULL;
913 eo = elm_button_add(obj);
914 retif(eo == NULL, NULL, "Failed to create clear button!");
916 elm_object_style_set(eo, "quickpanel_standard");
918 elm_object_text_set(eo, _S("IDS_COM_BODY_CLEAR_ALL"));
919 evas_object_smart_callback_add(eo, "clicked",
920 _quickpanel_noti_clear_clicked_cb, NULL);
925 static char *_quickpanel_noti_gl_get_group_text(void *data, Evas_Object * obj,
928 char buf[128] = { 0, };
931 if (!strncmp(part, "elm.text", 8)) {
932 char format[256] = { 0, };
933 memset(buf, 0x00, sizeof(buf));
935 if (g_noti_node != NULL) {
937 noti_node_get_item_count(g_noti_node, NOTIFICATION_TYPE_NOTI);
942 snprintf(format, sizeof(format), "%s %%d", _("IDS_QP_BODY_NOTIFICATIONS_ABB2"));
943 snprintf(buf, sizeof(buf), format, noti_count);
951 static void _quickpanel_list_noti_gl_del(void *data, Evas_Object *obj)
953 int noti_priv_id = 0;
954 qp_item_type_e item_type = QP_ITEM_TYPE_NONE;
955 notification_h noti = NULL;
958 noti = quickpanel_list_util_item_get_data(data);
959 item_type = quickpanel_list_util_item_get_item_type(data);
961 DBG("item type:%d", item_type);
963 if (item_type == QP_ITEM_TYPE_ONGOING_NOTI) {
964 notification_get_id(noti, NULL, ¬i_priv_id);
965 noti_node_remove(g_noti_node, noti_priv_id);
966 DBG("noti:%d removed", noti_priv_id);
975 static void _quickpanel_list_noti_group_gl_del(void *data, Evas_Object *obj) {
982 static void _quickpanel_notibox_gl_del(void *data, Evas_Object *obj) {
989 static void _quickpanel_noti_gl_style_init(void)
991 Elm_Genlist_Item_Class *noti = NULL;
992 Elm_Genlist_Item_Class *noti_ongoing = NULL;
993 Elm_Genlist_Item_Class *group = NULL;
995 /* item style for noti items*/
996 noti = elm_genlist_item_class_new();
998 noti->item_style = "qp_notibox/default";
999 noti->func.text_get = NULL;
1000 noti->func.content_get = _quickpanel_noti_box_gl_get_content;
1001 noti->func.state_get = NULL;
1002 noti->func.del = _quickpanel_notibox_gl_del;
1006 noti_ongoing = elm_genlist_item_class_new();
1008 noti_ongoing->item_style = "notification_ongoing_item";
1009 noti_ongoing->func.text_get = _quickpanel_ongoing_noti_gl_get_text;
1010 noti_ongoing->func.content_get = _quickpanel_noti_gl_get_content;
1011 noti_ongoing->func.state_get = _quickpanel_noti_gl_get_state;
1012 noti_ongoing->func.del = _quickpanel_list_noti_gl_del;
1013 itc_ongoing = noti_ongoing;
1016 /* item style for noti group title */
1017 group = elm_genlist_item_class_new();
1019 group->item_style = "qp_group_title";
1020 group->func.text_get = _quickpanel_noti_gl_get_group_text;
1021 group->func.content_get = _quickpanel_noti_gl_get_group_content;
1022 group->func.del = _quickpanel_list_noti_group_gl_del;
1027 static void _quickpanel_noti_gl_style_fini(void)
1030 elm_genlist_item_class_free(itc_noti);
1035 elm_genlist_item_class_free(itc_ongoing);
1040 elm_genlist_item_class_free(g_itc);
1044 if (g_animated_image_list) {
1045 g_animated_image_list = eina_list_free(g_animated_image_list);
1049 static inline void __ongoing_comp_n_copy(notification_h old, notification_h new)
1052 int new_priv_id = 0;
1053 char *pkgname = NULL;
1054 char *new_pkgname = NULL;
1062 notification_get_id(old, NULL, &priv_id);
1063 notification_get_id(new, NULL, &new_priv_id);
1065 notification_get_pkgname(old, &pkgname);
1066 notification_get_pkgname(new, &new_pkgname);
1068 if (!pkgname || !new_pkgname)
1071 if (!strcmp(pkgname, new_pkgname) && priv_id == new_priv_id) {
1072 double percentage = 0.0;
1074 time_t insert_time = 0;
1075 time_t new_insert_time = 0;
1077 notification_get_progress(old, &percentage);
1078 notification_get_size(old, &size);
1079 notification_set_progress(new, percentage);
1080 notification_set_size(new, size);
1081 notification_get_insert_time(old, &insert_time);
1082 notification_get_insert_time(new, &new_insert_time);
1084 if (insert_time == new_insert_time) {
1085 char *content = NULL;
1086 notification_get_text(old,
1087 NOTIFICATION_TEXT_TYPE_CONTENT, &content);
1088 notification_set_text(new,
1089 NOTIFICATION_TEXT_TYPE_CONTENT, content,
1090 NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
1095 static void _quickpanel_noti_clear_ongoinglist(Evas_Object *list)
1103 quickpanel_list_util_item_del_by_type(list, ongoing_first,
1104 QP_ITEM_TYPE_ONGOING_NOTI);
1107 static void _quickpanel_noti_clear_notilist(Evas_Object *list)
1112 if (!g_noti_gridbox)
1115 if (g_noti_gridbox != NULL) {
1116 gridbox_remove(g_noti_gridbox);
1117 g_noti_gridbox = NULL;
1119 if (noti_first != NULL) {
1120 elm_object_item_del(noti_first);
1123 if (noti_group != NULL) {
1124 elm_object_item_del(noti_group);
1129 static void _quickpanel_noti_clear_list_all(Evas_Object *list)
1131 _quickpanel_noti_clear_ongoinglist(list);
1132 ongoing_first = NULL;
1134 _quickpanel_noti_clear_notilist(list);
1137 static void _quickpanel_noti_ongoing_add(Evas_Object *list, void *data)
1139 qp_item_data *qid = NULL;
1140 Elm_Object_Item *it = NULL;
1145 qid = quickpanel_list_util_item_new(QP_ITEM_TYPE_ONGOING_NOTI, data);
1149 it = quickpanel_list_util_sort_insert(list, itc_ongoing, qid, NULL,
1150 ELM_GENLIST_ITEM_NONE, quickpanel_noti_select_cb, qid);
1154 noti_node_add(g_noti_node, (void *)data, (void *)it);
1157 ERR("fail to insert item to list : %p", data);
1159 DBG("noti ongoing[%p] data[%p] added, it[%p]", qid, data, it);
1162 static void _quickpanel_noti_group_add(Evas_Object *list, void *data)
1164 qp_item_data *qid = NULL;
1165 Elm_Object_Item *it = NULL;
1170 qid = quickpanel_list_util_item_new(QP_ITEM_TYPE_NOTI_GROUP, data);
1174 it = quickpanel_list_util_sort_insert(list, g_itc, qid, NULL,
1175 ELM_GENLIST_ITEM_GROUP, NULL, NULL);
1180 ERR("fail to insert item to list : %p", data);
1182 DBG("noti group[%p] data[%p] added, it[%p]", qid, data, it);
1185 void _quickpanel_noti_box_deleted_cb(void *data, Evas_Object *obj) {
1186 DBG("deleting:%p", obj);
1190 retif(data == NULL, , "Invalid parameter!");
1191 retif(obj == NULL, , "Invalid parameter!");
1193 noti_node_item *item = data;
1194 notification_h noti = item->noti;
1197 notification_get_id(noti, NULL, &priv_id);
1198 noti_node_remove(g_noti_node, priv_id);
1202 static void _quickpanel_noti_noti_add(Evas_Object *list, void *data, int is_prepend)
1204 retif(list == NULL, , "Invalid parameter!");
1205 qp_item_data *qid = NULL;
1206 Elm_Object_Item *it = NULL;
1207 notification_h noti = data;
1208 notification_ly_type_e layout = NOTIFICATION_LY_NOTI_EVENT_SINGLE;
1210 qid = quickpanel_list_util_item_new(QP_ITEM_TYPE_NOTI, NULL);
1211 retif(qid == NULL, , "Invalid parameter!");
1214 _quickpanel_noti_group_add(list, NULL);
1216 if (noti_first == NULL) {
1217 if (g_noti_gridbox == NULL) {
1218 g_noti_gridbox = gridbox_create(list, quickpanel_get_app_data());
1219 gridbox_set_item_deleted_cb(g_noti_gridbox, _quickpanel_noti_box_deleted_cb);
1222 it = quickpanel_list_util_sort_insert(list, itc_noti, qid, noti_group,
1223 ELM_GENLIST_ITEM_NONE, NULL, qid);
1228 notification_get_layout(noti, &layout);
1230 Evas_Object *noti_box = noti_box_create(list, layout);
1232 if (noti_box != NULL) {
1233 noti_node_item *item = noti_node_add(g_noti_node, (void*)data, (void*)noti_box);
1235 noti_box_node_set(noti_box, item);
1236 noti_box_set_item_selected_cb(noti_box, quickpanel_notibox_select_cb);
1237 noti_box_set_item_deleted_cb(noti_box, quickpanel_notibox_delete_cb);
1238 gridbox_add_item(g_noti_gridbox, noti_box, is_prepend);
1241 ERR("fail to insert item to list : %p", data);
1243 DBG("noti[%p] data[%p] added, it[%p] of gridbox[%p]",
1244 qid, data, noti_box, g_noti_gridbox);
1248 void _quickpanel_noti_update_notilist(struct appdata *ad)
1250 Evas_Object *list = NULL;
1251 notification_h noti = NULL;
1252 notification_h noti_save = NULL;
1253 notification_list_h get_list = NULL;
1254 int applist = NOTIFICATION_DISPLAY_APP_ALL;
1258 retif(ad == NULL, , "Invalid parameter!");
1261 retif(list == NULL, , "Failed to get noti genlist.");
1263 _quickpanel_noti_clear_list_all(list);
1265 notification_get_list(NOTIFICATION_TYPE_ONGOING, -1, &get_list);
1266 while (get_list != NULL) {
1267 noti = notification_list_get_data(get_list);
1268 notification_get_display_applist(noti, &applist);
1271 NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
1272 notification_clone(noti, ¬i_save);
1273 _quickpanel_noti_ongoing_add(list, noti_save);
1275 get_list = notification_list_get_next(get_list);
1277 notification_free_list(get_list);
1279 notification_get_list(NOTIFICATION_TYPE_NOTI , -1, &get_list);
1280 while (get_list != NULL) {
1281 noti = notification_list_get_data(get_list);
1282 notification_get_display_applist(noti, &applist);
1285 NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
1286 notification_clone(noti, ¬i_save);
1287 _quickpanel_noti_noti_add(list, noti_save, GRIDBOX_APPEND);
1289 get_list = notification_list_get_next(get_list);
1291 notification_free_list(get_list);
1293 if (g_noti_gridbox != NULL) {
1294 elm_box_recalculate(g_noti_gridbox);
1298 static void _quickpanel_noti_delete_volatil_data(void)
1300 notification_list_h noti_list = NULL;
1301 notification_list_h noti_list_head = NULL;
1302 notification_h noti = NULL;
1305 notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
1307 noti_list_head = noti_list;
1309 while (noti_list != NULL) {
1310 noti = notification_list_get_data(noti_list);
1311 notification_get_property(noti, &property);
1313 if (property & NOTIFICATION_PROP_VOLATILE_DISPLAY) {
1314 notification_set_property(noti,
1316 NOTIFICATION_PROP_DISABLE_UPDATE_ON_DELETE);
1317 notification_delete(noti);
1320 noti_list = notification_list_get_next(noti_list);
1323 notification_free_list(noti_list_head);
1325 notification_update(NULL);
1328 static void _quickpanel_noti_detailed_changed_cb(void *data, notification_type_e type, notification_op *op_list, int num_op)
1333 struct appdata *ad = NULL;
1334 notification_h new_noti = NULL;
1335 notification_type_e noti_type = NOTIFICATION_TYPE_NONE;
1336 int noti_applist = NOTIFICATION_DISPLAY_APP_ALL;
1337 notification_ly_type_e noti_layout = NOTIFICATION_LY_NONE;
1339 retif(data == NULL, , "Invalid parameter!");
1342 DBG("test detailed quickpanel:%d", num_op);
1344 for (i = 0; i < num_op; i++) {
1345 notification_op_get_data(op_list + i, NOTIFICATION_OP_DATA_TYPE, &op_type);
1346 DBG("op_type:%d", op_type);
1347 notification_op_get_data(op_list + i, NOTIFICATION_OP_DATA_PRIV_ID, &priv_id);
1348 DBG("op_priv_id:%d", priv_id);
1350 if (op_type == NOTIFICATION_OP_INSERT) {
1351 new_noti = notification_load(NULL, priv_id);
1352 if (new_noti == NULL) continue;
1354 notification_get_type(new_noti, ¬i_type);
1355 notification_get_display_applist(new_noti, ¬i_applist);
1356 notification_get_layout(new_noti, ¬i_layout);
1358 DBG("layout:%d", noti_layout);
1360 if (noti_applist & NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
1361 noti_node_item *node = noti_node_get(g_noti_node, priv_id);
1363 if (noti_type == NOTIFICATION_TYPE_NOTI) {
1364 DBG("cb after inserted:%d", priv_id);
1367 if (noti_type == NOTIFICATION_TYPE_NOTI) {
1368 _quickpanel_noti_noti_add(ad->list, new_noti, GRIDBOX_PREPEND);
1369 } else if (noti_type == NOTIFICATION_TYPE_ONGOING) {
1370 _quickpanel_noti_ongoing_add(ad->list, new_noti);
1373 DBG("%d noti added", priv_id);
1375 notification_free(new_noti);
1378 if (op_type == NOTIFICATION_OP_DELETE) {
1379 noti_node_item *node = noti_node_get(g_noti_node, priv_id);
1381 if (node != NULL && node->noti != NULL) {
1382 notification_h noti = node->noti;
1383 notification_get_type(noti, ¬i_type);
1385 if (noti_type == NOTIFICATION_TYPE_NOTI) {
1386 gridbox_remove_item(g_noti_gridbox, node->view, 0);
1387 } else if (noti_type == NOTIFICATION_TYPE_ONGOING) {
1388 elm_object_item_del(node->view);
1391 DBG("%d noti deleted", priv_id);
1393 if (op_type == NOTIFICATION_OP_UPDATE) {
1394 noti_node_item *node = noti_node_get(g_noti_node, priv_id);
1395 qp_item_data *qid = NULL;
1396 notification_h old_noti = NULL;
1398 new_noti = notification_load(NULL, priv_id);
1399 retif(new_noti == NULL, , "fail to load updated noti");
1401 if (node != NULL && node->view != NULL && node->noti != NULL) {
1402 notification_get_type(new_noti, ¬i_type);
1404 if (noti_type == NOTIFICATION_TYPE_NOTI) {
1405 gridbox_remove_item(g_noti_gridbox, node->view, 0);
1406 _quickpanel_noti_noti_add(ad->list, new_noti, GRIDBOX_PREPEND);
1408 gridbox_remove_and_add_item(g_noti_gridbox, node->view,
1409 _quickpanel_noti_noti_add
1410 ,ad->list, new_noti, GRIDBOX_PREPEND);
1412 } else if (noti_type == NOTIFICATION_TYPE_ONGOING) {
1413 old_noti = node->noti;
1414 node->noti = new_noti;
1416 qid = elm_object_item_data_get(node->view);
1417 retif(qid == NULL, , "noti is already deleted");
1418 quickpanel_list_util_item_set_data(qid, new_noti);
1419 elm_genlist_item_fields_update(node->view, "*",
1420 ELM_GENLIST_ITEM_FIELD_ALL);
1423 if (old_noti != NULL) {
1424 notification_free(old_noti);
1427 notification_get_display_applist(new_noti, ¬i_applist);
1429 if (noti_applist & NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY) {
1431 if (noti_type == NOTIFICATION_TYPE_NOTI) {
1432 _quickpanel_noti_noti_add(ad->list, new_noti, GRIDBOX_PREPEND);
1433 } else if (noti_type == NOTIFICATION_TYPE_ONGOING) {
1434 _quickpanel_noti_ongoing_add(ad->list, new_noti);
1439 DBG("%d noti updated", priv_id);
1443 if (noti_node_get_item_count(g_noti_node, NOTIFICATION_TYPE_NOTI)
1445 struct appdata *ad = quickpanel_get_app_data();
1446 _quickpanel_noti_clear_notilist(ad->list);
1448 if (noti_group != NULL) {
1449 elm_genlist_item_fields_update(noti_group, "*",
1450 ELM_GENLIST_ITEM_FIELD_ALL);
1452 _quickpanel_noti_update_notibox();
1456 static void _quickpanel_noti_update_sim_status_cb(keynode_t *node, void *data)
1458 struct appdata *ad = data;
1460 if (ad != NULL && ad->list != NULL) {
1461 _quickpanel_noti_update_notilist(ad);
1463 _quickpanel_noti_update_notibox();
1467 static int _quickpanel_noti_register_event_handler(struct appdata *ad)
1470 retif(ad == NULL, QP_FAIL, "Invalid parameter!");
1472 /* Add dbus signal */
1474 ad->dbus_connection = e_dbus_bus_get(DBUS_BUS_SYSTEM);
1475 if (ad->dbus_connection == NULL) {
1476 ERR("noti register : failed to get dbus bus");
1480 ad->dbus_handler_size =
1481 e_dbus_signal_handler_add(ad->dbus_connection, NULL,
1482 QP_NOTI_ONGOING_DBUS_PATH,
1483 QP_NOTI_ONGOING_DBUS_INTERFACE, "update_progress",
1484 _quickpanel_noti_item_progress_update_cb,
1486 if (ad->dbus_handler_size == NULL)
1487 ERR("fail to add size signal");
1489 ad->dbus_handler_progress =
1490 e_dbus_signal_handler_add(ad->dbus_connection, NULL,
1491 QP_NOTI_ONGOING_DBUS_PATH,
1492 QP_NOTI_ONGOING_DBUS_INTERFACE, "update_size",
1493 _quickpanel_noti_item_size_update_cb,
1495 if (ad->dbus_handler_progress == NULL)
1496 ERR("fail to add progress signal");
1498 ad->dbus_handler_content =
1499 e_dbus_signal_handler_add(ad->dbus_connection, NULL,
1500 QP_NOTI_ONGOING_DBUS_PATH,
1501 QP_NOTI_ONGOING_DBUS_INTERFACE, "update_content",
1502 _quickpanel_noti_item_content_update_cb,
1504 if (ad->dbus_handler_content == NULL)
1505 ERR("fail to add content signal");
1507 /* Notify vconf key */
1508 ret = vconf_notify_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT,
1509 _quickpanel_noti_update_sim_status_cb,
1512 ERR("Failed to register SIM_SLOT change callback!");
1514 /* Register notification changed cb */
1515 notification_register_detailed_changed_cb(_quickpanel_noti_detailed_changed_cb, ad);
1520 static int _quickpanel_noti_unregister_event_handler(struct appdata *ad)
1524 /* Unregister notification changed cb */
1525 notification_unregister_detailed_changed_cb(_quickpanel_noti_detailed_changed_cb, (void *)ad);
1527 /* Ignore vconf key */
1528 ret = vconf_ignore_key_changed(VCONFKEY_TELEPHONY_SIM_SLOT,
1529 _quickpanel_noti_update_sim_status_cb);
1531 ERR("Failed to ignore SIM_SLOT change callback!");
1533 /* Delete dbus signal */
1534 if (ad->dbus_handler_size != NULL) {
1535 e_dbus_signal_handler_del(ad->dbus_connection,
1536 ad->dbus_handler_size);
1537 ad->dbus_handler_size = NULL;
1539 if (ad->dbus_handler_progress != NULL) {
1540 e_dbus_signal_handler_del(ad->dbus_connection,
1541 ad->dbus_handler_progress);
1542 ad->dbus_handler_progress = NULL;
1544 if (ad->dbus_handler_content != NULL) {
1545 e_dbus_signal_handler_del(ad->dbus_connection,
1546 ad->dbus_handler_content);
1547 ad->dbus_handler_content = NULL;
1550 if (ad->dbus_connection != NULL) {
1551 e_dbus_connection_close(ad->dbus_connection);
1552 ad->dbus_connection = NULL;
1558 static int _quickpanel_noti_check_first_start(void)
1563 ret = vconf_get_bool(VCONFKEY_QUICKPANEL_STARTED, &status);
1565 INFO("fail to get %s", VCONFKEY_QUICKPANEL_STARTED);
1567 ret = vconf_set_bool(VCONFKEY_QUICKPANEL_STARTED, 1);
1568 INFO("set : %s, result : %d", VCONFKEY_QUICKPANEL_STARTED, ret);
1577 static Eina_Bool quickpanel_noti_refresh_gridbox(void *data)
1579 struct appdata *ad = NULL;
1581 retif(data == NULL, EINA_FALSE, "Invalid parameter!");
1586 /* Update notification list */
1587 _quickpanel_noti_update_notilist(ad);
1589 _quickpanel_noti_register_event_handler(ad);
1591 _quickpanel_noti_update_notibox();
1596 static int quickpanel_noti_init(void *data)
1598 struct appdata *ad = data;
1601 retif(ad == NULL, QP_FAIL, "Invalid parameter!");
1605 noti_node_create(&g_noti_node);
1607 is_first = _quickpanel_noti_check_first_start();
1609 /* Remove ongoing and volatile noti data */
1610 notifiation_clear(NOTIFICATION_TYPE_ONGOING);
1611 _quickpanel_noti_delete_volatil_data();
1614 _quickpanel_noti_gl_style_init();
1616 ecore_timer_add(0.200, quickpanel_noti_refresh_gridbox, ad);
1621 static int quickpanel_noti_fini(void *data)
1623 struct appdata *ad = data;
1624 retif(ad == NULL, QP_FAIL, "Invalid parameter!");
1625 if (g_noti_node != NULL) {
1626 noti_node_destroy(&g_noti_node);
1629 /* Unregister event handler */
1630 _quickpanel_noti_unregister_event_handler(data);
1631 _quickpanel_noti_clear_list_all(ad->list);
1632 _quickpanel_noti_gl_style_fini();
1636 static int quickpanel_noti_suspend(void *data)
1638 struct appdata *ad = data;
1639 retif(ad == NULL, QP_FAIL, "Invalid parameter!");
1644 _quickpanel_noti_ani_image_control(EINA_FALSE);
1650 static int quickpanel_noti_resume(void *data)
1652 struct appdata *ad = data;
1653 retif(ad == NULL, QP_FAIL, "Invalid parameter!");
1658 quickpanel_list_util_item_update_by_type(ad->list,
1659 ongoing_first, QP_ITEM_TYPE_ONGOING_NOTI);
1661 _quickpanel_noti_ani_image_control(EINA_TRUE);
1663 _quickpanel_noti_update_notibox();
1669 static void quickpanel_noti_refresh(void *data) {
1670 struct appdata *ad = NULL;
1672 retif(data == NULL, , "Invalid parameter!");
1675 if (g_noti_gridbox != NULL) {
1676 gridbox_rotation(g_noti_gridbox, ad->angle);
1678 _quickpanel_noti_update_notibox();
1681 void quickpanel_noti_lang_changed(void *data)
1683 struct appdata *ad = data;
1685 retif(ad == NULL, , "Invalid parameter!");
1687 _quickpanel_noti_update_notilist(ad);
1689 _quickpanel_noti_update_notibox();
1692 static unsigned int quickpanel_noti_get_height(void *data)
1695 struct appdata *ad = data;
1697 retif(ad == NULL, 0, "Invalid parameter!");
1700 height = QP_THEME_LIST_ITEM_GROUP_HEIGHT;
1703 noti_node_get_item_count(
1705 NOTIFICATION_TYPE_NOTI) * QP_THEME_LIST_ITEM_NOTI_HEIGHT
1706 + noti_node_get_item_count(g_noti_node, NOTIFICATION_TYPE_ONGOING) * (QP_THEME_LIST_ITEM_ONGOING_HEIGHT + QP_THEME_LIST_ITEM_ONGOING_SEPERATOR_HEIGHT);return