3 #include "notification.h"
9 cout << "Notification TestProgram Start=========" << endl;
11 //notification variable declaration
12 notification_error_e err = NOTIFICATION_ERROR_NONE;
13 notification_list_h noti_list = NULL;
15 err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
16 if (err != NOTIFICATION_ERROR_NONE) {
17 cout << "Failed to get notificationList <error code>:"<< err << endl;
21 if (NULL == noti_list){
22 cout <<"Nothing NotificationList" <<endl;
26 printf("gid | typ | pid | %-30s | %-30s | content\n", "pkgname", "title");
27 printf("----+-----+-----+--------------------------------+--------------------------------+--------------------------------\n");
28 //notification_list_h getlist = notification_list_get_head(noti_list);
29 notification_list_h getlist = notification_list_get_tail(noti_list);
31 notification_h noti = notification_list_get_data(getlist);
34 notification_type_e type = NOTIFICATION_TYPE_NONE;
35 err = notification_get_type(noti, &type);
36 if (NOTIFICATION_ERROR_NONE != err) {
37 printf("notification_set_text() failed(%d).\n", err);
43 err = notification_get_id(noti, &grpid, &privid);
44 if (NOTIFICATION_ERROR_NONE != err) {
45 printf("notification_set_text() failed(%d).\n", err);
49 char *caller_pkgname = NULL;
50 err = notification_get_pkgname(noti, &caller_pkgname);
51 if (NOTIFICATION_ERROR_NONE != err) {
52 printf("notification_get_pkgname() failed(%d).\n", err);
57 err = notification_get_text(noti,
58 NOTIFICATION_TEXT_TYPE_TITLE,
60 if (NOTIFICATION_ERROR_NONE != err) {
61 printf("notification_set_text() failed(%d).\n", err);
66 err = notification_get_text(noti,
67 NOTIFICATION_TEXT_TYPE_CONTENT,
69 if (NOTIFICATION_ERROR_NONE != err) {
70 printf("notification_get_text() failed(%d).\n", err);
74 printf("%3d | %3d | %3d | %-30s | %-30s | %-30s\n",
75 grpid, type, privid, caller_pkgname, title, content);
77 //getlist = notification_list_get_next(getlist);
78 getlist = notification_list_get_prev(getlist);
79 } while (getlist != NULL);
82 cout << "Notification_TestProgram End!=========" << endl;