summaryrefslogtreecommitdiffstats
path: root/widget/nsISound.idl
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /widget/nsISound.idl
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'widget/nsISound.idl')
-rw-r--r--widget/nsISound.idl67
1 files changed, 67 insertions, 0 deletions
diff --git a/widget/nsISound.idl b/widget/nsISound.idl
new file mode 100644
index 000000000..6f9acc2ce
--- /dev/null
+++ b/widget/nsISound.idl
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * 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 "nsISupports.idl"
+
+interface nsIURL;
+
+[scriptable, uuid(C3C28D92-A17F-43DF-976D-4EEAE6F995FC)]
+interface nsISound : nsISupports
+{
+ void play(in nsIURL aURL);
+ /**
+ * for playing system sounds
+ *
+ * NS_SYSSOUND_* params are obsolete. The new events will not be supported by
+ * this method. You should use playEventSound method instaed.
+ */
+ void playSystemSound(in AString soundAlias);
+ void beep();
+
+ /**
+ * Not strictly necessary, but avoids delay before first sound.
+ * The various methods on nsISound call Init() if they need to.
+ */
+ void init();
+
+ /**
+ * 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.
+ */
+ const unsigned long EVENT_NEW_MAIL_RECEIVED = 0;
+ const unsigned long EVENT_ALERT_DIALOG_OPEN = 1;
+ 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;
+ const unsigned long EVENT_EDITOR_MAX_LEN = 7;
+ void playEventSound(in unsigned long aEventId);
+};
+
+%{C++
+
+/**
+ * NS_SYSSOUND_* can be used for playSystemSound but they are obsolete.
+ * Use nsISound::playEventSound instead.
+ */
+#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")
+#define NS_SYSSOUND_MENU_EXECUTE NS_LITERAL_STRING("_moz_menucommand")
+#define NS_SYSSOUND_MENU_POPUP NS_LITERAL_STRING("_moz_menupopup")
+
+#define NS_IsMozAliasSound(aSoundAlias) \
+ StringBeginsWith(aSoundAlias, NS_SYSSOUND_PREFIX)
+
+%}