michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIURL; michael@0: michael@0: [scriptable, uuid(C3C28D92-A17F-43DF-976D-4EEAE6F995FC)] michael@0: interface nsISound : nsISupports michael@0: { michael@0: void play(in nsIURL aURL); michael@0: /** michael@0: * for playing system sounds michael@0: * michael@0: * NS_SYSSOUND_* params are obsolete. The new events will not be supported by michael@0: * this method. You should use playEventSound method instaed. michael@0: */ michael@0: void playSystemSound(in AString soundAlias); michael@0: void beep(); michael@0: michael@0: /** michael@0: * Not strictly necessary, but avoids delay before first sound. michael@0: * The various methods on nsISound call Init() if they need to. michael@0: */ michael@0: void init(); michael@0: michael@0: /** michael@0: * In some situations, playEventSound will be called. Then, each michael@0: * implementations will play a system sound for the event if it's necessary. michael@0: * michael@0: * NOTE: Don't change these values because they are used in michael@0: * nsPIPromptService.idl. So, if they are changed, that makes big impact for michael@0: * the embedders. michael@0: */ michael@0: const unsigned long EVENT_NEW_MAIL_RECEIVED = 0; michael@0: const unsigned long EVENT_ALERT_DIALOG_OPEN = 1; michael@0: const unsigned long EVENT_CONFIRM_DIALOG_OPEN = 2; michael@0: const unsigned long EVENT_PROMPT_DIALOG_OPEN = 3; michael@0: const unsigned long EVENT_SELECT_DIALOG_OPEN = 4; michael@0: const unsigned long EVENT_MENU_EXECUTE = 5; michael@0: const unsigned long EVENT_MENU_POPUP = 6; michael@0: const unsigned long EVENT_EDITOR_MAX_LEN = 7; michael@0: void playEventSound(in unsigned long aEventId); michael@0: }; michael@0: michael@0: %{C++ michael@0: michael@0: /** michael@0: * NS_SYSSOUND_* can be used for playSystemSound but they are obsolete. michael@0: * Use nsISound::playEventSound instead. michael@0: */ michael@0: #define NS_SYSSOUND_PREFIX NS_LITERAL_STRING("_moz_") michael@0: #define NS_SYSSOUND_MAIL_BEEP NS_LITERAL_STRING("_moz_mailbeep") michael@0: #define NS_SYSSOUND_ALERT_DIALOG NS_LITERAL_STRING("_moz_alertdialog") michael@0: #define NS_SYSSOUND_CONFIRM_DIALOG NS_LITERAL_STRING("_moz_confirmdialog") michael@0: #define NS_SYSSOUND_PROMPT_DIALOG NS_LITERAL_STRING("_moz_promptdialog") michael@0: #define NS_SYSSOUND_SELECT_DIALOG NS_LITERAL_STRING("_moz_selectdialog") michael@0: #define NS_SYSSOUND_MENU_EXECUTE NS_LITERAL_STRING("_moz_menucommand") michael@0: #define NS_SYSSOUND_MENU_POPUP NS_LITERAL_STRING("_moz_menupopup") michael@0: michael@0: #define NS_IsMozAliasSound(aSoundAlias) \ michael@0: StringBeginsWith(aSoundAlias, NS_SYSSOUND_PREFIX) michael@0: michael@0: %}