/*
 * Copyright (C) 2009 Google Inc. All rights reserved.
 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

[
    Conditional=NOTIFICATIONS,
    ActiveDOMObject,
    ExportMacro=WEBCORE_EXPORT,
] interface Notification : EventTarget {
    [CallWith=Document] constructor(DOMString title, optional NotificationOptions options);

    [CallWith=Document] static readonly attribute NotificationPermission permission;
    [CallWith=Document] static void requestPermission(optional NotificationPermissionCallback? deprecatedCallback); // FIXME: This should return a Promise<NotificationPermission>.

    // static readonly attribute unsigned long maxActions;

    attribute EventHandler onclick;
    attribute EventHandler onerror;

    readonly attribute DOMString title;
    readonly attribute NotificationDirection dir;
    readonly attribute DOMString lang;
    readonly attribute DOMString body;
    readonly attribute DOMString tag;
    // readonly attribute USVString image;
    readonly attribute USVString icon;
    // readonly attribute USVString badge;
    // readonly attribute USVString sound;
    // [SameObject] readonly attribute FrozenArray<unsigned long> vibrate;
    // readonly attribute DOMTimeStamp timestamp;
    // readonly attribute boolean renotify;
    // readonly attribute boolean silent;
    // readonly attribute boolean requireInteraction;
    // [SameObject] readonly attribute any data;
    // [SameObject] readonly attribute FrozenArray<NotificationAction> actions;

    void close();

    // Legacy. Not in the specification.
    void show();

    attribute EventHandler onclose;
    [ImplementedAs=onshow] attribute EventHandler ondisplay;
    attribute EventHandler onshow;
};

[
    Conditional=NOTIFICATIONS
] dictionary NotificationOptions {
    NotificationDirection dir = "auto";
    DOMString lang = "";
    DOMString body = "";
    DOMString tag = "";
    // USVString image;
    USVString icon;
    // USVString badge;
    // USVString sound;
    // VibratePattern vibrate;
    // DOMTimeStamp timestamp;
    // boolean renotify = false;
    // boolean silent = false;
    // boolean requireInteraction = false;
    // any data = null;
    // sequence<NotificationAction> actions = [];
};

[
    Conditional=NOTIFICATIONS
] enum NotificationDirection {
    "auto",
    "ltr",
    "rtl"
};
