1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 *
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
8 *
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
13 *
14 * The Original Code is mozilla.org code.
15 *
16 * The Initial Developer of the Original Code is Mozilla Corporation.
17 * Portions created by the Initial Developer are Copyright (C) 2007
18 * the Initial Developer. All Rights Reserved.
19 *
20 * Contributor(s):
21 * Justin Dolske <dolske@mozilla.com> (original author)
22 *
23 * Alternatively, the contents of this file may be used under the terms of
24 * either the GNU General Public License Version 2 or later (the "GPL"), or
25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 * in which case the provisions of the GPL or the LGPL are applicable instead
27 * of those above. If you wish to allow use of your version of this file only
28 * under the terms of either the GPL or the LGPL, and not to allow others to
29 * use your version of this file under the terms of the MPL, indicate your
30 * decision by deleting the provisions above and replace them with the notice
31 * and other provisions required by the GPL or the LGPL. If you do not delete
32 * the provisions above, a recipient may use your version of this file under
33 * the terms of any one of the MPL, the GPL or the LGPL.
34 *
35 * ***** END LICENSE BLOCK ***** */
36
37
38 #include "nsISupports.idl"
39
40 interface nsILoginInfo;
41 interface nsIDOMWindow;
42
43 [scriptable, uuid(68b3cb59-51b8-4c57-bd7f-b2ce955a593d)]
44
45 interface nsILoginManagerPrompter : nsISupports {
46 /**
47 * Initialize the prompter. Must be called before using other interfaces.
48 *
49 * @param aWindow
50 * The in which the user is doing some login-related action that's
51 * resulting in a need to prompt them for something. The prompt
52 * will be associated with this window (or, if a notification bar
53 * is being used, topmost opener in some cases).
54 */
55 void init(in nsIDOMWindow aWindow);
56
57 /**
58 * Ask the user if they want to save a login (Yes, Never, Not Now)
59 *
60 * @param aLogin
61 * The login to be saved.
62 */
63 void promptToSavePassword(in nsILoginInfo aLogin);
64
65 /**
66 * Ask the user if they want to change a login's password. If the
67 * user consents, modifyLogin() will be called.
68 *
69 * @param aOldLogin
70 * The existing login (with the old password).
71 * @param aNewLogin
72 * The new login.
73 */
74 void promptToChangePassword(in nsILoginInfo aOldLogin,
75 in nsILoginInfo aNewLogin);
76
77 /**
78 * Ask the user if they want to change the password for one of
79 * multiple logins, when the caller can't determine exactly which
80 * login should be changed. If the user consents, modifyLogin() will
81 * be called.
82 *
83 * @param logins
84 * An array of existing logins.
85 * @param count
86 * (length of the array)
87 * @param aNewLogin
88 * The new login.
89 *
90 * Note: Because the caller does not know the username of the login
91 * to be changed, aNewLogin.username and aNewLogin.usernameField
92 * will be set (using the user's selection) before modifyLogin()
93 * is called.
94 */
95 void promptToChangePasswordWithUsernames(
96 [array, size_is(count)] in nsILoginInfo logins,
97 in PRUint32 count,
98 in nsILoginInfo aNewLogin);
99 };
100 %{C++
101
102 #define NS_LOGINMANAGERPROMPTER_CONTRACTID "@mozilla.org/login-manager/prompter/;1"
103
104 %}