toolkit/components/alerts/nsIAlertsService.idl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6
michael@0 7 #include "nsISupports.idl"
michael@0 8 #include "nsIObserver.idl"
michael@0 9
michael@0 10 interface nsIPrincipal;
michael@0 11
michael@0 12 [scriptable, uuid(160e87e1-d57d-456b-b6ea-17826f6ea7a8)]
michael@0 13 interface nsIAlertsService : nsISupports
michael@0 14 {
michael@0 15 /**
michael@0 16 * Displays a sliding notification window.
michael@0 17 *
michael@0 18 * @param imageUrl A URL identifying the image to put in the alert.
michael@0 19 * The OS X implemenation limits the amount of time it
michael@0 20 * will wait for an icon to load to six seconds. After
michael@0 21 * that time the alert will show with no icon.
michael@0 22 * @param title The title for the alert.
michael@0 23 * @param text The contents of the alert.
michael@0 24 * @param textClickable If true, causes the alert text to look like a link
michael@0 25 * and notifies the listener when user attempts to
michael@0 26 * click the alert text.
michael@0 27 * @param cookie A blind cookie the alert will pass back to the
michael@0 28 * consumer during the alert listener callbacks.
michael@0 29 * @param alertListener Used for callbacks. May be null if the caller
michael@0 30 * doesn't care about callbacks.
michael@0 31 * @param name The name of the notification. This is currently only
michael@0 32 * used on Android and OS X. On Android the name is
michael@0 33 * hashed and used as a notification ID. Notifications
michael@0 34 * will replace previous notifications with the same name.
michael@0 35 * @param dir Bidi override for the title. Valid values are
michael@0 36 * "auto", "ltr" or "rtl". Only available on supported
michael@0 37 * platforms.
michael@0 38 * @param lang Language of title and text of the alert. Only available
michael@0 39 * on supported platforms.
michael@0 40 * @throws NS_ERROR_NOT_AVAILABLE If the notification cannot be displayed.
michael@0 41 *
michael@0 42 * The following arguments will be passed to the alertListener's observe()
michael@0 43 * method:
michael@0 44 * subject - null
michael@0 45 * topic - "alertfinished" when the alert goes away
michael@0 46 * "alertclickcallback" when the text is clicked
michael@0 47 * "alertshow" when the alert is shown
michael@0 48 * data - the value of the cookie parameter passed to showAlertNotification.
michael@0 49 *
michael@0 50 * @note Depending on current circumstances (if the user's in a fullscreen
michael@0 51 * application, for instance), the alert might not be displayed at all.
michael@0 52 * In that case, if an alert listener is passed in it will receive the
michael@0 53 * "alertfinished" notification immediately.
michael@0 54 */
michael@0 55 void showAlertNotification(in AString imageUrl,
michael@0 56 in AString title,
michael@0 57 in AString text,
michael@0 58 [optional] in boolean textClickable,
michael@0 59 [optional] in AString cookie,
michael@0 60 [optional] in nsIObserver alertListener,
michael@0 61 [optional] in AString name,
michael@0 62 [optional] in AString dir,
michael@0 63 [optional] in AString lang,
michael@0 64 [optional] in nsIPrincipal principal);
michael@0 65
michael@0 66 /**
michael@0 67 * Close alerts created by the service.
michael@0 68 *
michael@0 69 * @param name The name of the notification to close. If no name
michael@0 70 * is provided then only a notification created with
michael@0 71 * no name (if any) will be closed.
michael@0 72 */
michael@0 73 void closeAlert([optional] in AString name,
michael@0 74 [optional] in nsIPrincipal principal);
michael@0 75 };
michael@0 76
michael@0 77 [scriptable, uuid(df1bd4b0-3a8c-40e6-806a-203f38b0bd9f)]
michael@0 78 interface nsIAlertsProgressListener : nsISupports
michael@0 79 {
michael@0 80 /**
michael@0 81 * Called to notify the alert service that progress has occurred for the
michael@0 82 * given notification previously displayed with showAlertNotification().
michael@0 83 *
michael@0 84 * @param name The name of the notification displaying the
michael@0 85 * progress. On Android the name is hashed and used
michael@0 86 * as a notification ID.
michael@0 87 * @param progress Numeric value in the range 0 to progressMax
michael@0 88 * indicating the current progress.
michael@0 89 * @param progressMax Numeric value indicating the maximum progress.
michael@0 90 * @param text The contents of the alert. If not provided,
michael@0 91 * the percentage will be displayed.
michael@0 92 */
michael@0 93 void onProgress(in AString name,
michael@0 94 in long long progress,
michael@0 95 in long long progressMax,
michael@0 96 [optional] in AString text);
michael@0 97
michael@0 98 /**
michael@0 99 * Called to cancel and hide the given notification previously displayed
michael@0 100 * with showAlertNotification().
michael@0 101 *
michael@0 102 * @param name The name of the notification.
michael@0 103 */
michael@0 104 void onCancel(in AString name);
michael@0 105 };
michael@0 106

mercurial