Struct xpcom::interfaces::nsINotificationStorage
[−]
[src]
#[repr(C)]pub struct nsINotificationStorage { /* fields omitted */ }
interface nsINotificationStorage : nsISupports
/**
* Interface for notification persistence layer.
*/
Methods
impl nsINotificationStorage
[src]
pub fn coerce<T: nsINotificationStorageCoerce>(&self) -> &T
[src]
Cast this nsINotificationStorage
to one of its base interfaces.
impl nsINotificationStorage
[src]
pub unsafe fn Put(
&self,
origin: &nsAString,
id: &nsAString,
title: &nsAString,
dir: &nsAString,
lang: &nsAString,
body: &nsAString,
tag: &nsAString,
icon: &nsAString,
alertName: &nsAString,
data: &nsAString,
behavior: &nsAString,
serviceWorkerRegistrationScope: &nsAString
) -> nsresult
[src]
&self,
origin: &nsAString,
id: &nsAString,
title: &nsAString,
dir: &nsAString,
lang: &nsAString,
body: &nsAString,
tag: &nsAString,
icon: &nsAString,
alertName: &nsAString,
data: &nsAString,
behavior: &nsAString,
serviceWorkerRegistrationScope: &nsAString
) -> nsresult
/**
* Add/replace a notification to the persistence layer.
*
* @param origin: the origin/app of this notification
* @param id: a uuid for this notification
* @param title: the notification title
* @param dir: the notification direction,
* possible values are "ltr", "rtl", "auto"
* @param lang: the notification language
* @param body: the notification body
* @param tag: notification tag, will replace any existing
* notifications with same origin/tag pair
* @param alertName: the alert identifier as used by system app.
* Stored in the database to avoid re-computing
* it. Built from origin and tag or id depending
* whether there is a tag defined.
* @param registrationID: Opaque string that identifies the service worker
* registration this Notification is associated with.
* May be empty. Only set for Notifications created by
* showNotification().
*/
void put (in DOMString origin, in DOMString id, in DOMString title, in DOMString dir, in DOMString lang, in DOMString body, in DOMString tag, in DOMString icon, in DOMString alertName, in DOMString data, in DOMString behavior, in DOMString serviceWorkerRegistrationScope);
pub unsafe fn Get(
&self,
origin: &nsAString,
tag: &nsAString,
aCallback: *const nsINotificationStorageCallback
) -> nsresult
[src]
&self,
origin: &nsAString,
tag: &nsAString,
aCallback: *const nsINotificationStorageCallback
) -> nsresult
/**
* Retrieve a list of notifications.
*
* @param origin: the origin/app for which to fetch notifications from
* @param tag: used to fetch only a specific tag
* @param callback: nsINotificationStorageCallback, used for
* returning notifications objects
*/
void get (in DOMString origin, in DOMString tag, in nsINotificationStorageCallback aCallback);
pub unsafe fn GetByID(
&self,
origin: &nsAString,
id: &nsAString,
aCallback: *const nsINotificationStorageCallback
) -> nsresult
[src]
&self,
origin: &nsAString,
id: &nsAString,
aCallback: *const nsINotificationStorageCallback
) -> nsresult
/**
* Retrieve a notification by ID.
*
* @param origin: the origin/app for which to fetch notifications.
* @param id: the id of the notification.
* @param callback: nsINotificationStorageCallback whose Handle method will
* be called *at most once* if the notification with that ID is found. Not
* called if that ID is not found. Done() will be called right after
* Handle().
*/
void getByID (in DOMString origin, in DOMString id, in nsINotificationStorageCallback aCallback);
pub unsafe fn Delete(&self, origin: &nsAString, id: &nsAString) -> nsresult
[src]
/**
* Remove a notification from storage.
*
* @param origin: the origin/app to delete the notification from
* @param id: the uuid for the notification to delete
*/
void delete (in DOMString origin, in DOMString id);
pub unsafe fn CanPut(&self, origin: &nsAString, _retval: *mut bool) -> nsresult
[src]
/**
* Notifications are not supposed to be persistent, according to spec, at
* least for now. But we want to be able to have this behavior on B2G. Thus,
* this method will check if the origin sending the notifications is a valid
* registered app with a manifest or not. Hence, a webpage that has none
* will have its notification sent and available (via Notification.get())
* during the life time of the page.
*
* @param origin: Origin from which the notification is sent.
*
* @return boolean
*/
boolean canPut (in DOMString origin);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsINotificationStorage
[src]
const IID: nsIID
IID: nsIID = nsID(402153042, 65111, 17422, [155, 161, 92, 49, 44, 160, 43, 149])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsINotificationStorage
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsINotificationStorage
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.