2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-04-10 18:40:07 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIPrompt;
|
|
|
|
|
2008-03-11 03:14:10 +03:00
|
|
|
[scriptable, uuid(358089f9-ee4b-4711-82fd-bcd07fc62061)]
|
2001-04-10 18:40:07 +04:00
|
|
|
interface nsIAuthPrompt : nsISupports
|
|
|
|
{
|
2012-08-22 19:56:38 +04:00
|
|
|
const uint32_t SAVE_PASSWORD_NEVER = 0;
|
|
|
|
const uint32_t SAVE_PASSWORD_FOR_SESSION = 1;
|
|
|
|
const uint32_t SAVE_PASSWORD_PERMANENTLY = 2;
|
2001-04-10 18:40:07 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Puts up a text input dialog with OK and Cancel buttons.
|
2008-03-02 15:24:24 +03:00
|
|
|
* Note: prompt uses separate args for the "in" and "out" values of the
|
|
|
|
* input field, whereas the other functions use a single inout arg.
|
|
|
|
* @param dialogText The title for the dialog.
|
|
|
|
* @param text The text to display in the dialog.
|
|
|
|
* @param passwordRealm The "realm" the password belongs to: e.g.
|
|
|
|
* ldap://localhost/dc=test
|
|
|
|
* @param savePassword One of the SAVE_PASSWORD_* options above.
|
|
|
|
* @param defaultText The default text to display in the text input box.
|
|
|
|
* @param result The value entered by the user if OK was
|
|
|
|
* selected.
|
2001-04-10 18:40:07 +04:00
|
|
|
* @return true for OK, false for Cancel
|
|
|
|
*/
|
|
|
|
boolean prompt(in wstring dialogTitle,
|
|
|
|
in wstring text,
|
|
|
|
in wstring passwordRealm,
|
2012-08-22 19:56:38 +04:00
|
|
|
in uint32_t savePassword,
|
2001-04-10 18:40:07 +04:00
|
|
|
in wstring defaultText,
|
|
|
|
out wstring result);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Puts up a username/password dialog with OK and Cancel buttons.
|
2008-03-02 15:24:24 +03:00
|
|
|
* Puts up a password dialog with OK and Cancel buttons.
|
|
|
|
* @param dialogText The title for the dialog.
|
|
|
|
* @param text The text to display in the dialog.
|
|
|
|
* @param passwordRealm The "realm" the password belongs to: e.g.
|
|
|
|
* ldap://localhost/dc=test
|
|
|
|
* @param savePassword One of the SAVE_PASSWORD_* options above.
|
|
|
|
* @param user The username entered in the dialog.
|
|
|
|
* @param pwd The password entered by the user if OK was
|
|
|
|
* selected.
|
2001-04-10 18:40:07 +04:00
|
|
|
* @return true for OK, false for Cancel
|
|
|
|
*/
|
|
|
|
boolean promptUsernameAndPassword(in wstring dialogTitle,
|
|
|
|
in wstring text,
|
|
|
|
in wstring passwordRealm,
|
2012-08-22 19:56:38 +04:00
|
|
|
in uint32_t savePassword,
|
2008-03-11 03:14:10 +03:00
|
|
|
inout wstring user,
|
2008-03-02 15:24:24 +03:00
|
|
|
inout wstring pwd);
|
2001-04-10 18:40:07 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Puts up a password dialog with OK and Cancel buttons.
|
2008-03-02 15:24:24 +03:00
|
|
|
* @param dialogText The title for the dialog.
|
|
|
|
* @param text The text to display in the dialog.
|
|
|
|
* @param passwordRealm The "realm" the password belongs to: e.g.
|
2008-03-11 03:14:10 +03:00
|
|
|
* ldap://localhost/dc=test. If a username is
|
|
|
|
* specified (http://user@site.com) it will be used
|
|
|
|
* when matching existing logins or saving new ones.
|
|
|
|
* If no username is specified, only password-only
|
|
|
|
* logins will be matched or saved.
|
2009-01-15 16:16:34 +03:00
|
|
|
* Note: if a username is specified, the username
|
|
|
|
* should be escaped.
|
2008-03-02 15:24:24 +03:00
|
|
|
* @param savePassword One of the SAVE_PASSWORD_* options above.
|
|
|
|
* @param pwd The password entered by the user if OK was
|
|
|
|
* selected.
|
2001-04-10 18:40:07 +04:00
|
|
|
* @return true for OK, false for Cancel
|
|
|
|
*/
|
|
|
|
boolean promptPassword(in wstring dialogTitle,
|
|
|
|
in wstring text,
|
|
|
|
in wstring passwordRealm,
|
2012-08-22 19:56:38 +04:00
|
|
|
in uint32_t savePassword,
|
2008-03-02 15:24:24 +03:00
|
|
|
inout wstring pwd);
|
2001-04-10 18:40:07 +04:00
|
|
|
};
|