2 * Copyright (C) 2012 Samsung Electronics
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef ewk_notification_h
21 #define ewk_notification_h
23 #include "ewk_context.h"
24 #include "ewk_security_origin.h"
31 struct _Ewk_Notification_Permission {
36 typedef struct _Ewk_Notification Ewk_Notification;
37 typedef struct _Ewk_Notification_Permission Ewk_Notification_Permission;
38 typedef struct _Ewk_Notification_Permission_Request Ewk_Notification_Permission_Request;
41 * Requests for getting body of notification.
43 * @param ewk_notification pointer of notificaion data
45 * @return body of notification
47 EAPI const char *ewk_notification_body_get(const Ewk_Notification *ewk_notification);
50 * Notify that notification is clicked.
52 * @param context context object
53 * @param notification_id identifier of notification
55 EAPI void ewk_notification_clicked(Ewk_Context *context, uint64_t notification_id);
58 * Requests for getting icon url of notification.
60 * @param ewk_notification pointer of notification data
62 * @return icon url of notification
64 EAPI const char *ewk_notification_icon_url_get(const Ewk_Notification *ewk_notification);
67 * Requests for getting id of notification.
69 * @param ewk_notification pointer of notification data
71 * @return id of notification
73 EAPI uint64_t ewk_notification_id_get(const Ewk_Notification *ewk_notification);
76 * Requests for setting cached notification permissions.
78 * By calling this notification permission is replaced as passed ewk_notification_permissions.
80 * @param context context object
81 * @param ewk_notification_permissions list of cached permissions(Ewk_Notification_Permission)
83 EAPI void ewk_notification_cached_permissions_set(Ewk_Context *context, Eina_List *ewk_notification_permissions);
86 * Requests for getting origin of notification permission request.
88 * @param request Ewk_Notification_Permission_Request object to get origin for notification permission request
90 * @return security origin of notification permission request
92 EAPI const Ewk_Security_Origin *ewk_notification_permission_request_origin_get(const Ewk_Notification_Permission_Request *request);
95 * Sets permission of notification.
97 * @param request Ewk_Notification_Permission_Request object to allow/deny notification permission
98 * request is freed in this function.
99 * @param allowed @c EINA_TRUE if permission is allowed, @c EINA_FALSE if permission is denied
101 EAPI void ewk_notification_permission_request_set(Ewk_Notification_Permission_Request *request, Eina_Bool allowed);
104 * Suspend the operation for permission request.
106 * This suspends the operation for permission request.
107 * This is very useful to decide the policy from the additional UI operation like the popup.
109 * @param request Ewk_Notification_Permission_Request object to suspend notification permission request
111 EAPI void ewk_notification_permission_request_suspend(Ewk_Notification_Permission_Request *request);
114 * Notify that notification policies are removed.
116 * @param context context object
117 * @param origins list of security origins(made by UAs)
119 EAPI void ewk_notification_policies_removed(Ewk_Context *context, Eina_List *origins);
122 * Requests for getting security origin of notification.
124 * @param ewk_notification pointer of notification data
126 * @return security origin of notification
128 EAPI const Ewk_Security_Origin *ewk_notification_security_origin_get(const Ewk_Notification *ewk_notification);
131 * Notify that notification is showed.
133 * @param context context object
134 * @param notification_id identifier of notification
136 EAPI void ewk_notification_showed(Ewk_Context *context, uint64_t notification_id);
139 * Requests for getting title of notification.
141 * @param ewk_notification pointer of notification data
143 * @return title of notification
145 EAPI const char *ewk_notification_title_get(const Ewk_Notification *ewk_notification);
150 #endif // ewk_notification_h