Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/webauthn/     Datei vom 27.6.2026 mit Größe 634 B image not shown  

SSL nsINotificationStorage.idl  Sprache: C


/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "domstubs.idl"

[scriptable, uuid(6b782346-49ec-41dd-8165-171506f8d4f4)]
interface nsINotificationActionStorageEntry : nsISupports {
  readonly attribute AString name;
  readonly attribute AString title;
};

[scriptable, uuid(c772e1b9-d4b0-4e23-8481-4a8b7dbbfe92)]
interface nsINotificationStorageEntry : nsISupports {
  readonly attribute AString id;
  readonly attribute AString title;
  readonly attribute ACString dir;
  readonly attribute AString lang;
  readonly attribute AString body;
  readonly attribute AString tag;
  readonly attribute ACString icon;
  readonly attribute boolean requireInteraction;
  readonly attribute boolean silent;
  readonly attribute AString dataSerialized;
  readonly attribute Array<nsINotificationActionStorageEntry> actions;
  readonly attribute AString serviceWorkerRegistrationScope;
};

[scriptable, function, uuid(c1622232-259c-43b0-b52e-89c39dcd9796)]
interface nsINotificationStorageCallback : nsISupports
{
  /**
   * Callback function used to pass single notification back
   * into C++ land for getNotifications() return data.
   *
   * @param aEntry: the stored notification entries
   */

  void done(in Array<nsINotificationStorageEntry> aEntries);
};

/**
 * Interface for notification persistence layer.
 */

[scriptable, uuid(17f85e52-fe57-440e-9ba1-5c312ca02b95)]
interface nsINotificationStorage : nsISupports
{

  /**
   * Add/replace a notification to the persistence layer.
   *
   * @param aOrigin: the origin of this notification
   * @param aScope: the ServiceWorker registration scope, or empty if unscoped.
   * @param aEntry: the notification data to store
   */

  void put(in AString aOrigin,
           in nsINotificationStorageEntry aEntry,
           in AString aScope);

  /**
   * Retrieve a list of notifications.
   *
   * @param origin: the origin for which to fetch notifications from
   * @param scope: Used to limit for the specific scope.
   *               Pass an empty string for unscoped notifications.
   *               (See bug 1881812 for potential spec changes to how notifications
   *               are associated with ServiceWorker registrations.)
   * @param tag: used to fetch only a specific tag
   * @param callback: nsINotificationStorageCallback, used for
   *                  returning notifications objects
   */

  void get(in AString origin,
           in AString scope,
           in AString tag,
           in nsINotificationStorageCallback aCallback);

  /**
   * Retrieve a notification by ID.
   *
   * @param origin: the origin/app for which to fetch notifications from
   * @param tag: used to fetch only a specific tag
   */

  Promise getById(in AUTF8String origin, in AString id);

  /**
   * Remove a notification from storage.
   *
   * @param origin: the origin to delete the notification from
   * @param id: the uuid for the notification to delete
   */

  void delete(in AString origin,
              in AString id);

  /**
   * Remove all notifications from storage, except the ones in `ids`.
   *
   * This can be used to clean up old notifications that are not known to the
   * system notification backend anymore. It's needed because the backend can
   * discard notifications while Firefox is not running.
   *
   * No `origin` parameter because:
   *
   * 1. This should affect all known origins
   * 2. The IDs are unique and should not collide between origins
   *
   * @param ids: the ids for the notifications to not delete
   */

  void deleteAllExcept(in Array<AString> ids);
};

%{C++
#define NS_NOTIFICATION_STORAGE_CONTRACTID "@mozilla.org/notificationStorage;1"
%}

%{C++
#define NS_MEMORY_NOTIFICATION_STORAGE_CONTRACTID "@mozilla.org/memoryNotificationStorage;1"
%}

Messung
CHZG
939610096

¤ Dauer der Verarbeitung: 0.512 Sekunden  ¤

*© Formatika GbR, Deutschland