widget/nsISound.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #include "nsISupports.idl"
     9 interface nsIURL;
    11 [scriptable, uuid(C3C28D92-A17F-43DF-976D-4EEAE6F995FC)]
    12 interface nsISound : nsISupports
    13 {
    14   void play(in nsIURL aURL);
    15   /**
    16    * for playing system sounds
    17    *
    18    * NS_SYSSOUND_* params are obsolete. The new events will not be supported by
    19    * this method.  You should use playEventSound method instaed.
    20    */
    21   void playSystemSound(in AString soundAlias);  
    22   void beep();
    24   /**
    25     * Not strictly necessary, but avoids delay before first sound.
    26     * The various methods on nsISound call Init() if they need to.
    27 	*/
    28   void init(); 
    30   /**
    31    * In some situations, playEventSound will be called.  Then, each
    32    * implementations will play a system sound for the event if it's necessary.
    33    *
    34    * NOTE: Don't change these values because they are used in
    35    * nsPIPromptService.idl. So, if they are changed, that makes big impact for
    36    * the embedders.
    37    */
    38   const unsigned long EVENT_NEW_MAIL_RECEIVED           = 0;
    39   const unsigned long EVENT_ALERT_DIALOG_OPEN           = 1;
    40   const unsigned long EVENT_CONFIRM_DIALOG_OPEN         = 2;
    41   const unsigned long EVENT_PROMPT_DIALOG_OPEN          = 3;
    42   const unsigned long EVENT_SELECT_DIALOG_OPEN          = 4;
    43   const unsigned long EVENT_MENU_EXECUTE                = 5;
    44   const unsigned long EVENT_MENU_POPUP                  = 6;
    45   const unsigned long EVENT_EDITOR_MAX_LEN              = 7;
    46   void playEventSound(in unsigned long aEventId);
    47 };
    49 %{C++
    51 /**
    52  * NS_SYSSOUND_* can be used for playSystemSound but they are obsolete.
    53  * Use nsISound::playEventSound instead.
    54  */
    55 #define NS_SYSSOUND_PREFIX          NS_LITERAL_STRING("_moz_")
    56 #define NS_SYSSOUND_MAIL_BEEP       NS_LITERAL_STRING("_moz_mailbeep")
    57 #define NS_SYSSOUND_ALERT_DIALOG    NS_LITERAL_STRING("_moz_alertdialog")
    58 #define NS_SYSSOUND_CONFIRM_DIALOG  NS_LITERAL_STRING("_moz_confirmdialog")
    59 #define NS_SYSSOUND_PROMPT_DIALOG   NS_LITERAL_STRING("_moz_promptdialog")
    60 #define NS_SYSSOUND_SELECT_DIALOG   NS_LITERAL_STRING("_moz_selectdialog")
    61 #define NS_SYSSOUND_MENU_EXECUTE    NS_LITERAL_STRING("_moz_menucommand")
    62 #define NS_SYSSOUND_MENU_POPUP      NS_LITERAL_STRING("_moz_menupopup")
    64 #define NS_IsMozAliasSound(aSoundAlias) \
    65           StringBeginsWith(aSoundAlias, NS_SYSSOUND_PREFIX)
    67 %}

mercurial