2
* Copyright (C) 2009 Google Inc. All rights reserved.
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions are
8
* * Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* * Redistributions in binary form must reproduce the above
11
* copyright notice, this list of conditions and the following disclaimer
12
* in the documentation and/or other materials provided with the
14
* * Neither the name of Google Inc. nor the names of its
15
* contributors may be used to endorse or promote products derived from
16
* this software without specific prior written permission.
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
@category WebDesktopNotification
38
@discussion A class that represents a notification being shown
39
on the user's desktop. It provides the contents of the notification
40
and receives events related to the display.
41
@interface NSObject (WebDesktopNotificationProvider)
46
uuid(0A0AAFA8-C698-4cff-BD28-39614622EEA4),
47
pointer_default(unique)
49
interface IWebDesktopNotification : IUnknown
51
HRESULT isHTML([out, retval] BOOL* result);
52
HRESULT contentsURL([out, retval] BSTR* result);
53
HRESULT iconURL([out, retval] BSTR* result);
54
HRESULT title([out, retval] BSTR* result);
55
HRESULT text([out, retval] BSTR* result);
57
HRESULT notifyDisplay();
58
HRESULT notifyError();
59
HRESULT notifyClose([in] BOOL xplicit);
63
@category WebDesktopNotificationsDelegate
64
@discussion A class that implements WebDesktopNotificationProvider provides
65
methods that may be used by Javascript to display notifications ("toasts")
66
on the user's desktop.
67
@interface NSObject (WebDesktopNotificationProvider)
72
uuid(09DA073E-38B3-466a-9828-B2915FDD2ECB),
73
pointer_default(unique)
76
interface IWebDesktopNotificationsDelegate : IUnknown
79
@method showDesktopNotification:
80
@abstract Show a notification.
81
@param notification The Notification to be shown.
83
HRESULT showDesktopNotification([in] IWebDesktopNotification* notification);
86
@method cancelDesktopNotification:
87
@abstract Cancel showing a notification (or take it down if it's shown).
88
@param notification The Notification to be canceled.
90
HRESULT cancelDesktopNotification([in] IWebDesktopNotification* notification);
93
@method notificationDestroyed:
94
@abstract Notify the presenter that the object has been destroyed. The
95
notification need not be un-shown, but events should not be invoked.
96
@param notification The Notification that was destroyed.
98
HRESULT notificationDestroyed([in] IWebDesktopNotification* notification);
101
@method checkNotificationPermission:
102
@abstract See if the origin context is allowed to show notifications.
103
@param origin The origin to be checked.
104
@param result A value from WebCore::NotificationProvider::Permission enum.
106
HRESULT checkNotificationPermission([in] BSTR origin, [out, retval] int* result);
109
@method requestNotificationPermission:
110
@abstract Request permission to show notifications on a given origin.
111
@param origin The origin to be requested.
113
HRESULT requestNotificationPermission([in] BSTR origin);