|
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 << 24; |
|
53 const unsigned long BUTTON_POS_1_DEFAULT = 1 << 24; |
|
54 const unsigned long BUTTON_POS_2_DEFAULT = 2 << 24; |
|
55 |
|
56 /* used for security dialogs, buttons are initially disabled */ |
|
57 const unsigned long BUTTON_DELAY_ENABLE = 1 << 26; |
|
58 |
|
59 const unsigned long STD_OK_CANCEL_BUTTONS = (BUTTON_TITLE_OK * BUTTON_POS_0) + |
|
60 (BUTTON_TITLE_CANCEL * BUTTON_POS_1); |
|
61 const unsigned long STD_YES_NO_BUTTONS = (BUTTON_TITLE_YES * BUTTON_POS_0) + |
|
62 (BUTTON_TITLE_NO * BUTTON_POS_1); |
|
63 |
|
64 int32_t confirmEx(in wstring dialogTitle, |
|
65 in wstring text, |
|
66 in unsigned long buttonFlags, |
|
67 in wstring button0Title, |
|
68 in wstring button1Title, |
|
69 in wstring button2Title, |
|
70 in wstring checkMsg, |
|
71 inout boolean checkValue); |
|
72 |
|
73 boolean prompt(in wstring dialogTitle, |
|
74 in wstring text, |
|
75 inout wstring value, |
|
76 in wstring checkMsg, |
|
77 inout boolean checkValue); |
|
78 |
|
79 boolean promptPassword(in wstring dialogTitle, |
|
80 in wstring text, |
|
81 inout wstring password, |
|
82 in wstring checkMsg, |
|
83 inout boolean checkValue); |
|
84 |
|
85 boolean promptUsernameAndPassword(in wstring dialogTitle, |
|
86 in wstring text, |
|
87 inout wstring username, |
|
88 inout wstring password, |
|
89 in wstring checkMsg, |
|
90 inout boolean checkValue); |
|
91 |
|
92 boolean select(in wstring dialogTitle, |
|
93 in wstring text, |
|
94 in uint32_t count, |
|
95 [array, size_is(count)] in wstring selectList, |
|
96 out long outSelection); |
|
97 }; |