|
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 #include "nsISupports.idl" |
|
7 |
|
8 interface nsIPrompt; |
|
9 |
|
10 [scriptable, uuid(358089f9-ee4b-4711-82fd-bcd07fc62061)] |
|
11 interface nsIAuthPrompt : nsISupports |
|
12 { |
|
13 const uint32_t SAVE_PASSWORD_NEVER = 0; |
|
14 const uint32_t SAVE_PASSWORD_FOR_SESSION = 1; |
|
15 const uint32_t SAVE_PASSWORD_PERMANENTLY = 2; |
|
16 |
|
17 /** |
|
18 * Puts up a text input dialog with OK and Cancel buttons. |
|
19 * Note: prompt uses separate args for the "in" and "out" values of the |
|
20 * input field, whereas the other functions use a single inout arg. |
|
21 * @param dialogText The title for the dialog. |
|
22 * @param text The text to display in the dialog. |
|
23 * @param passwordRealm The "realm" the password belongs to: e.g. |
|
24 * ldap://localhost/dc=test |
|
25 * @param savePassword One of the SAVE_PASSWORD_* options above. |
|
26 * @param defaultText The default text to display in the text input box. |
|
27 * @param result The value entered by the user if OK was |
|
28 * selected. |
|
29 * @return true for OK, false for Cancel |
|
30 */ |
|
31 boolean prompt(in wstring dialogTitle, |
|
32 in wstring text, |
|
33 in wstring passwordRealm, |
|
34 in uint32_t savePassword, |
|
35 in wstring defaultText, |
|
36 out wstring result); |
|
37 |
|
38 /** |
|
39 * Puts up a username/password dialog with OK and Cancel buttons. |
|
40 * Puts up a password dialog with OK and Cancel buttons. |
|
41 * @param dialogText The title for the dialog. |
|
42 * @param text The text to display in the dialog. |
|
43 * @param passwordRealm The "realm" the password belongs to: e.g. |
|
44 * ldap://localhost/dc=test |
|
45 * @param savePassword One of the SAVE_PASSWORD_* options above. |
|
46 * @param user The username entered in the dialog. |
|
47 * @param pwd The password entered by the user if OK was |
|
48 * selected. |
|
49 * @return true for OK, false for Cancel |
|
50 */ |
|
51 boolean promptUsernameAndPassword(in wstring dialogTitle, |
|
52 in wstring text, |
|
53 in wstring passwordRealm, |
|
54 in uint32_t savePassword, |
|
55 inout wstring user, |
|
56 inout wstring pwd); |
|
57 |
|
58 /** |
|
59 * Puts up a password dialog with OK and Cancel buttons. |
|
60 * @param dialogText The title for the dialog. |
|
61 * @param text The text to display in the dialog. |
|
62 * @param passwordRealm The "realm" the password belongs to: e.g. |
|
63 * ldap://localhost/dc=test. If a username is |
|
64 * specified (http://user@site.com) it will be used |
|
65 * when matching existing logins or saving new ones. |
|
66 * If no username is specified, only password-only |
|
67 * logins will be matched or saved. |
|
68 * Note: if a username is specified, the username |
|
69 * should be escaped. |
|
70 * @param savePassword One of the SAVE_PASSWORD_* options above. |
|
71 * @param pwd The password entered by the user if OK was |
|
72 * selected. |
|
73 * @return true for OK, false for Cancel |
|
74 */ |
|
75 boolean promptPassword(in wstring dialogTitle, |
|
76 in wstring text, |
|
77 in wstring passwordRealm, |
|
78 in uint32_t savePassword, |
|
79 inout wstring pwd); |
|
80 }; |