1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/public/nsIAuthPrompt.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,80 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIPrompt; 1.12 + 1.13 +[scriptable, uuid(358089f9-ee4b-4711-82fd-bcd07fc62061)] 1.14 +interface nsIAuthPrompt : nsISupports 1.15 +{ 1.16 + const uint32_t SAVE_PASSWORD_NEVER = 0; 1.17 + const uint32_t SAVE_PASSWORD_FOR_SESSION = 1; 1.18 + const uint32_t SAVE_PASSWORD_PERMANENTLY = 2; 1.19 + 1.20 + /** 1.21 + * Puts up a text input dialog with OK and Cancel buttons. 1.22 + * Note: prompt uses separate args for the "in" and "out" values of the 1.23 + * input field, whereas the other functions use a single inout arg. 1.24 + * @param dialogText The title for the dialog. 1.25 + * @param text The text to display in the dialog. 1.26 + * @param passwordRealm The "realm" the password belongs to: e.g. 1.27 + * ldap://localhost/dc=test 1.28 + * @param savePassword One of the SAVE_PASSWORD_* options above. 1.29 + * @param defaultText The default text to display in the text input box. 1.30 + * @param result The value entered by the user if OK was 1.31 + * selected. 1.32 + * @return true for OK, false for Cancel 1.33 + */ 1.34 + boolean prompt(in wstring dialogTitle, 1.35 + in wstring text, 1.36 + in wstring passwordRealm, 1.37 + in uint32_t savePassword, 1.38 + in wstring defaultText, 1.39 + out wstring result); 1.40 + 1.41 + /** 1.42 + * Puts up a username/password dialog with OK and Cancel buttons. 1.43 + * Puts up a password dialog with OK and Cancel buttons. 1.44 + * @param dialogText The title for the dialog. 1.45 + * @param text The text to display in the dialog. 1.46 + * @param passwordRealm The "realm" the password belongs to: e.g. 1.47 + * ldap://localhost/dc=test 1.48 + * @param savePassword One of the SAVE_PASSWORD_* options above. 1.49 + * @param user The username entered in the dialog. 1.50 + * @param pwd The password entered by the user if OK was 1.51 + * selected. 1.52 + * @return true for OK, false for Cancel 1.53 + */ 1.54 + boolean promptUsernameAndPassword(in wstring dialogTitle, 1.55 + in wstring text, 1.56 + in wstring passwordRealm, 1.57 + in uint32_t savePassword, 1.58 + inout wstring user, 1.59 + inout wstring pwd); 1.60 + 1.61 + /** 1.62 + * Puts up a password dialog with OK and Cancel buttons. 1.63 + * @param dialogText The title for the dialog. 1.64 + * @param text The text to display in the dialog. 1.65 + * @param passwordRealm The "realm" the password belongs to: e.g. 1.66 + * ldap://localhost/dc=test. If a username is 1.67 + * specified (http://user@site.com) it will be used 1.68 + * when matching existing logins or saving new ones. 1.69 + * If no username is specified, only password-only 1.70 + * logins will be matched or saved. 1.71 + * Note: if a username is specified, the username 1.72 + * should be escaped. 1.73 + * @param savePassword One of the SAVE_PASSWORD_* options above. 1.74 + * @param pwd The password entered by the user if OK was 1.75 + * selected. 1.76 + * @return true for OK, false for Cancel 1.77 + */ 1.78 + boolean promptPassword(in wstring dialogTitle, 1.79 + in wstring text, 1.80 + in wstring passwordRealm, 1.81 + in uint32_t savePassword, 1.82 + inout wstring pwd); 1.83 +};