michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsILoginInfo; michael@0: interface nsIDOMWindow; michael@0: michael@0: [scriptable, uuid(68b3cb59-51b8-4c57-bd7f-b2ce955a593d)] michael@0: michael@0: interface nsILoginManagerPrompter : nsISupports { michael@0: /** michael@0: * Initialize the prompter. Must be called before using other interfaces. michael@0: * michael@0: * @param aWindow michael@0: * The in which the user is doing some login-related action that's michael@0: * resulting in a need to prompt them for something. The prompt michael@0: * will be associated with this window (or, if a notification bar michael@0: * is being used, topmost opener in some cases). michael@0: */ michael@0: void init(in nsIDOMWindow aWindow); michael@0: michael@0: /** michael@0: * Ask the user if they want to save a login (Yes, Never, Not Now) michael@0: * michael@0: * @param aLogin michael@0: * The login to be saved. michael@0: */ michael@0: void promptToSavePassword(in nsILoginInfo aLogin); michael@0: michael@0: /** michael@0: * Ask the user if they want to change a login's password. If the michael@0: * user consents, modifyLogin() will be called. michael@0: * michael@0: * @param aOldLogin michael@0: * The existing login (with the old password). michael@0: * @param aNewLogin michael@0: * The new login. michael@0: */ michael@0: void promptToChangePassword(in nsILoginInfo aOldLogin, michael@0: in nsILoginInfo aNewLogin); michael@0: michael@0: /** michael@0: * Ask the user if they want to change the password for one of michael@0: * multiple logins, when the caller can't determine exactly which michael@0: * login should be changed. If the user consents, modifyLogin() will michael@0: * be called. michael@0: * michael@0: * @param logins michael@0: * An array of existing logins. michael@0: * @param count michael@0: * (length of the array) michael@0: * @param aNewLogin michael@0: * The new login. michael@0: * michael@0: * Note: Because the caller does not know the username of the login michael@0: * to be changed, aNewLogin.username and aNewLogin.usernameField michael@0: * will be set (using the user's selection) before modifyLogin() michael@0: * is called. michael@0: */ michael@0: void promptToChangePasswordWithUsernames( michael@0: [array, size_is(count)] in nsILoginInfo logins, michael@0: in uint32_t count, michael@0: in nsILoginInfo aNewLogin); michael@0: }; michael@0: %{C++ michael@0: michael@0: #define NS_LOGINMANAGERPROMPTER_CONTRACTID "@mozilla.org/login-manager/prompter/;1" michael@0: michael@0: %}