Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / netwerk / base / nsIPrompt.idl
blob46f23ee7c5a9c7eaa92c92f5314f823e2b329c5d
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/. */
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.
13 * Accesskeys can be attached to buttons and checkboxes by inserting
14 * an & before the accesskey character. For a real &, use && instead.
17 #include "nsISupports.idl"
19 [scriptable, uuid(a63f70c0-148b-11d3-9333-00104ba0fd40)]
20 interface nsIPrompt : nsISupports
22 void alert(in wstring dialogTitle,
23 in wstring text);
25 void alertCheck(in wstring dialogTitle,
26 in wstring text,
27 in wstring checkMsg,
28 inout boolean checkValue);
30 boolean confirm(in wstring dialogTitle,
31 in wstring text);
33 boolean confirmCheck(in wstring dialogTitle,
34 in wstring text,
35 in wstring checkMsg,
36 inout boolean checkValue);
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;
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;
50 const unsigned long BUTTON_TITLE_IS_STRING = 127;
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;
56 /* used for security dialogs, buttons are initially disabled */
57 const unsigned long BUTTON_DELAY_ENABLE = 1 << 26;
59 const unsigned long SHOW_SPINNER = 1 << 27;
61 // Part of BUTTON_NONE. This is not a button flag.
62 const unsigned long BUTTON_NONE_ENABLE_BIT = 1 << 28;
64 const unsigned long BUTTON_NONE =
65 BUTTON_NONE_ENABLE_BIT |
66 BUTTON_TITLE_IS_STRING * BUTTON_POS_0;
68 const unsigned long BUTTON_POS_1_IS_SECONDARY = 1 << 29;
70 const unsigned long STD_OK_CANCEL_BUTTONS = (BUTTON_TITLE_OK * BUTTON_POS_0) +
71 (BUTTON_TITLE_CANCEL * BUTTON_POS_1);
72 const unsigned long STD_YES_NO_BUTTONS = (BUTTON_TITLE_YES * BUTTON_POS_0) +
73 (BUTTON_TITLE_NO * BUTTON_POS_1);
76 // Indicates whether a prompt should be shown in-content, on tab level or as a separate window
77 const unsigned long MODAL_TYPE_CONTENT = 1;
78 const unsigned long MODAL_TYPE_TAB = 2;
79 const unsigned long MODAL_TYPE_WINDOW = 3;
80 // Like MODAL_TYPE_WINDOW, but shown inside a parent window (with similar
81 // styles as _TAB and _CONTENT types) rather than as a new window:
82 const unsigned long MODAL_TYPE_INTERNAL_WINDOW = 4;
84 int32_t confirmEx(in wstring dialogTitle,
85 in wstring text,
86 in unsigned long buttonFlags,
87 in wstring button0Title,
88 in wstring button1Title,
89 in wstring button2Title,
90 in wstring checkMsg,
91 inout boolean checkValue);
93 boolean prompt(in wstring dialogTitle,
94 in wstring text,
95 inout wstring value,
96 in wstring checkMsg,
97 inout boolean checkValue);
99 boolean promptPassword(in wstring dialogTitle,
100 in wstring text,
101 inout wstring password);
103 boolean promptUsernameAndPassword(in wstring dialogTitle,
104 in wstring text,
105 inout wstring username,
106 inout wstring password);
108 boolean select(in wstring dialogTitle,
109 in wstring text,
110 in Array<AString> selectList,
111 out long outSelection);