1999-07-23 05:15:58 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
1999-06-16 03:02:41 +00:00
|
|
|
*
|
2012-05-21 11:12:37 +00:00
|
|
|
* 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/. */
|
1999-06-16 03:02:41 +00:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2001-07-16 02:40:48 +00:00
|
|
|
|
|
|
|
interface nsIURL;
|
1999-06-16 03:02:41 +00:00
|
|
|
|
2011-09-08 15:16:33 +00:00
|
|
|
[scriptable, uuid(C3C28D92-A17F-43DF-976D-4EEAE6F995FC)]
|
1999-06-16 03:02:41 +00:00
|
|
|
interface nsISound : nsISupports
|
|
|
|
{
|
2000-06-04 07:13:40 +00:00
|
|
|
void play(in nsIURL aURL);
|
2001-10-10 08:08:22 +00:00
|
|
|
/**
|
|
|
|
* for playing system sounds
|
2009-07-09 01:55:46 +00:00
|
|
|
*
|
|
|
|
* NS_SYSSOUND_* params are obsolete. The new events will not be supported by
|
|
|
|
* this method. You should use playEventSound method instaed.
|
2001-10-10 08:08:22 +00:00
|
|
|
*/
|
2005-09-17 10:11:38 +00:00
|
|
|
void playSystemSound(in AString soundAlias);
|
2000-06-04 07:13:40 +00:00
|
|
|
void beep();
|
2002-12-14 00:27:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Not strictly necessary, but avoids delay before first sound.
|
|
|
|
* The various methods on nsISound call Init() if they need to.
|
|
|
|
*/
|
|
|
|
void init();
|
2009-07-09 01:55:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* In some situations, playEventSound will be called. Then, each
|
|
|
|
* implementations will play a system sound for the event if it's necessary.
|
|
|
|
*
|
|
|
|
* NOTE: Don't change these values because they are used in
|
|
|
|
* nsPIPromptService.idl. So, if they are changed, that makes big impact for
|
|
|
|
* the embedders.
|
|
|
|
*/
|
2009-07-11 01:32:43 +00:00
|
|
|
const unsigned long EVENT_NEW_MAIL_RECEIVED = 0;
|
|
|
|
const unsigned long EVENT_ALERT_DIALOG_OPEN = 1;
|
2009-07-09 01:55:46 +00:00
|
|
|
const unsigned long EVENT_CONFIRM_DIALOG_OPEN = 2;
|
|
|
|
const unsigned long EVENT_PROMPT_DIALOG_OPEN = 3;
|
|
|
|
const unsigned long EVENT_SELECT_DIALOG_OPEN = 4;
|
|
|
|
const unsigned long EVENT_MENU_EXECUTE = 5;
|
|
|
|
const unsigned long EVENT_MENU_POPUP = 6;
|
2011-09-08 15:16:33 +00:00
|
|
|
const unsigned long EVENT_EDITOR_MAX_LEN = 7;
|
2009-07-09 01:55:46 +00:00
|
|
|
void playEventSound(in unsigned long aEventId);
|
1999-06-16 03:02:41 +00:00
|
|
|
};
|
2008-12-05 07:29:17 +00:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
|
2009-07-09 01:55:46 +00:00
|
|
|
/**
|
|
|
|
* NS_SYSSOUND_* can be used for playSystemSound but they are obsolete.
|
|
|
|
* Use nsISound::playEventSound instead.
|
|
|
|
*/
|
2008-12-05 07:29:17 +00:00
|
|
|
#define NS_SYSSOUND_PREFIX NS_LITERAL_STRING("_moz_")
|
|
|
|
#define NS_SYSSOUND_MAIL_BEEP NS_LITERAL_STRING("_moz_mailbeep")
|
|
|
|
#define NS_SYSSOUND_ALERT_DIALOG NS_LITERAL_STRING("_moz_alertdialog")
|
|
|
|
#define NS_SYSSOUND_CONFIRM_DIALOG NS_LITERAL_STRING("_moz_confirmdialog")
|
|
|
|
#define NS_SYSSOUND_PROMPT_DIALOG NS_LITERAL_STRING("_moz_promptdialog")
|
|
|
|
#define NS_SYSSOUND_SELECT_DIALOG NS_LITERAL_STRING("_moz_selectdialog")
|
2008-12-10 17:23:20 +00:00
|
|
|
#define NS_SYSSOUND_MENU_EXECUTE NS_LITERAL_STRING("_moz_menucommand")
|
|
|
|
#define NS_SYSSOUND_MENU_POPUP NS_LITERAL_STRING("_moz_menupopup")
|
2008-12-05 07:29:17 +00:00
|
|
|
|
|
|
|
#define NS_IsMozAliasSound(aSoundAlias) \
|
|
|
|
StringBeginsWith(aSoundAlias, NS_SYSSOUND_PREFIX)
|
|
|
|
|
|
|
|
%}
|