Interface nsIAlertsServiceType

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Close alerts created by the service.

    Parameters

    • aName: string

      The name of the notification to close. If no name is provided then only a notification created with no name (if any) will be closed.

    • aContextClosed: boolean

      The notification was implicitly closed, e.g. by tab or window closure. This is necessary to track as some platforms intentionally leave the notification visible unless explicitly closed, e.g. by notification.close().

    Returns void

  • Parameters

    • aAlert: nsIAlertNotification
    • aAlertListener: nsIObserver

    Returns void

  • Initializes and shows an |nsIAlertNotification| with the given parameters.

    See

    nsIAlertNotification for descriptions of all other parameters.

    Throws

    NS_ERROR_NOT_AVAILABLE If the notification cannot be displayed.

    The following arguments will be passed to the alertListener's observe() method: subject - null topic - "alertfinished" when the alert goes away "alertdisablecallback" when alerts should be disabled for the principal "alertsettingscallback" when alert settings should be opened "alertclickcallback" when the text is clicked "alertshow" when the alert is shown data - the value of the cookie parameter passed to showAlertNotification.

    Note

    Depending on current circumstances (if the user's in a fullscreen application, for instance), the alert might not be displayed at all. In that case, if an alert listener is passed in it will receive the "alertfinished" notification immediately.

    Parameters

    • aImageURL: string
    • aTitle: string
    • aText: string
    • aTextClickable: boolean
    • aCookie: string
    • aAlertListener: nsIObserver

      Used for callbacks. May be null if the caller doesn't care about callbacks.

    • aName: string
    • aDir: string
    • aLang: string
    • aData: string
    • aPrincipal: nsIPrincipal
    • aInPrivateBrowsing: boolean
    • aRequireInteraction: boolean

    Returns void

  • Parameters

    • aPersistentData: string
    • aAlert: nsIAlertNotification
    • aAlertListener: nsIObserver

    Returns void

Generated using TypeDoc