1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include
"nsISupports.idl"
43 * @status UNDER_REVIEW
45 [scriptable
, uuid(358089f9
-ee4b
-4711-82fd
-bcd07fc62061
)]
46 interface nsIAuthPrompt
: nsISupports
48 const PRUint32 SAVE_PASSWORD_NEVER
= 0;
49 const PRUint32 SAVE_PASSWORD_FOR_SESSION
= 1;
50 const PRUint32 SAVE_PASSWORD_PERMANENTLY
= 2;
53 * Puts up a text input dialog with OK and Cancel buttons.
54 * Note: prompt uses separate args for the "in" and "out" values of the
55 * input field, whereas the other functions use a single inout arg.
56 * @param dialogText The title for the dialog.
57 * @param text The text to display in the dialog.
58 * @param passwordRealm The "realm" the password belongs to: e.g.
59 * ldap://localhost/dc=test
60 * @param savePassword One of the SAVE_PASSWORD_* options above.
61 * @param defaultText The default text to display in the text input box.
62 * @param result The value entered by the user if OK was
64 * @return true for OK, false for Cancel
66 boolean prompt
(in wstring dialogTitle
,
68 in wstring passwordRealm
,
69 in PRUint32 savePassword
,
70 in wstring defaultText
,
74 * Puts up a username/password dialog with OK and Cancel buttons.
75 * Puts up a password dialog with OK and Cancel buttons.
76 * @param dialogText The title for the dialog.
77 * @param text The text to display in the dialog.
78 * @param passwordRealm The "realm" the password belongs to: e.g.
79 * ldap://localhost/dc=test
80 * @param savePassword One of the SAVE_PASSWORD_* options above.
81 * @param user The username entered in the dialog.
82 * @param pwd The password entered by the user if OK was
84 * @return true for OK, false for Cancel
86 boolean promptUsernameAndPassword
(in wstring dialogTitle
,
88 in wstring passwordRealm
,
89 in PRUint32 savePassword
,
94 * Puts up a password dialog with OK and Cancel buttons.
95 * @param dialogText The title for the dialog.
96 * @param text The text to display in the dialog.
97 * @param passwordRealm The "realm" the password belongs to: e.g.
98 * ldap://localhost/dc=test. If a username is
99 * specified (http://user@site.com) it will be used
100 * when matching existing logins or saving new ones.
101 * If no username is specified, only password-only
102 * logins will be matched or saved.
103 * @param savePassword One of the SAVE_PASSWORD_* options above.
104 * @param pwd The password entered by the user if OK was
106 * @return true for OK, false for Cancel
108 boolean promptPassword
(in wstring dialogTitle
,
110 in wstring passwordRealm
,
111 in PRUint32 savePassword
,