nsIPrompt.idl (4685B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 /** 7 * This is the prompt interface which can be used without knowlege of a 8 * parent window. The parentage is hidden by the GetInterface though 9 * which it is gotten. This interface is identical to nsIPromptService 10 * but without the parent nsIDOMWindow parameter. See nsIPromptService 11 * for all documentation. 12 * 13 * Accesskeys can be attached to buttons and checkboxes by inserting 14 * an & before the accesskey character. For a real &, use && instead. 15 */ 16 17 #include "nsISupports.idl" 18 19 [scriptable, uuid(a63f70c0-148b-11d3-9333-00104ba0fd40)] 20 interface nsIPrompt : nsISupports 21 { 22 void alert(in wstring dialogTitle, 23 in wstring text); 24 25 void alertCheck(in wstring dialogTitle, 26 in wstring text, 27 in wstring checkMsg, 28 inout boolean checkValue); 29 30 boolean confirm(in wstring dialogTitle, 31 in wstring text); 32 33 boolean confirmCheck(in wstring dialogTitle, 34 in wstring text, 35 in wstring checkMsg, 36 inout boolean checkValue); 37 38 const unsigned long BUTTON_POS_0 = 1; 39 const unsigned long BUTTON_POS_1 = 1 << 8; 40 const unsigned long BUTTON_POS_2 = 1 << 16; 41 42 const unsigned long BUTTON_TITLE_OK = 1; 43 const unsigned long BUTTON_TITLE_CANCEL = 2; 44 const unsigned long BUTTON_TITLE_YES = 3; 45 const unsigned long BUTTON_TITLE_NO = 4; 46 const unsigned long BUTTON_TITLE_SAVE = 5; 47 const unsigned long BUTTON_TITLE_DONT_SAVE = 6; 48 const unsigned long BUTTON_TITLE_REVERT = 7; 49 50 const unsigned long BUTTON_TITLE_IS_STRING = 127; 51 52 const unsigned long BUTTON_POS_0_DEFAULT = 0; 53 const unsigned long BUTTON_POS_1_DEFAULT = 1 << 24; 54 const unsigned long BUTTON_POS_2_DEFAULT = 1 << 25; 55 56 /* used for security dialogs, buttons are initially disabled */ 57 const unsigned long BUTTON_DELAY_ENABLE = 1 << 26; 58 59 const unsigned long SHOW_SPINNER = 1 << 27; 60 61 // Part of BUTTON_NONE. This is not a button flag. 62 const unsigned long BUTTON_NONE_ENABLE_BIT = 1 << 28; 63 64 const unsigned long BUTTON_NONE = 65 BUTTON_NONE_ENABLE_BIT | 66 BUTTON_TITLE_IS_STRING * BUTTON_POS_0; 67 68 const unsigned long BUTTON_POS_1_IS_SECONDARY = 1 << 29; 69 70 const unsigned long BUTTON_DEFAULT_IS_DESTRUCTIVE = 1 << 30; 71 72 const unsigned long STD_OK_CANCEL_BUTTONS = (BUTTON_TITLE_OK * BUTTON_POS_0) + 73 (BUTTON_TITLE_CANCEL * BUTTON_POS_1); 74 const unsigned long STD_YES_NO_BUTTONS = (BUTTON_TITLE_YES * BUTTON_POS_0) + 75 (BUTTON_TITLE_NO * BUTTON_POS_1); 76 77 78 // Indicates whether a prompt should be shown in-content, on tab level or as a separate window 79 const unsigned long MODAL_TYPE_CONTENT = 1; 80 const unsigned long MODAL_TYPE_TAB = 2; 81 const unsigned long MODAL_TYPE_WINDOW = 3; 82 // Like MODAL_TYPE_WINDOW, but shown inside a parent window (with similar 83 // styles as _TAB and _CONTENT types) rather than as a new window: 84 const unsigned long MODAL_TYPE_INTERNAL_WINDOW = 4; 85 86 int32_t confirmEx(in wstring dialogTitle, 87 in wstring text, 88 in unsigned long buttonFlags, 89 in wstring button0Title, 90 in wstring button1Title, 91 in wstring button2Title, 92 in wstring checkMsg, 93 inout boolean checkValue); 94 95 boolean prompt(in wstring dialogTitle, 96 in wstring text, 97 inout wstring value, 98 in wstring checkMsg, 99 inout boolean checkValue); 100 101 boolean promptPassword(in wstring dialogTitle, 102 in wstring text, 103 inout wstring password); 104 105 boolean promptUsernameAndPassword(in wstring dialogTitle, 106 in wstring text, 107 inout wstring username, 108 inout wstring password); 109 110 boolean select(in wstring dialogTitle, 111 in wstring text, 112 in Array<AString> selectList, 113 out long outSelection); 114 };