1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * *
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/
9 *
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
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by Netscape are Copyright (C) 2002
20 * Netscape Communications Corporation. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
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.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 #include "nsISupports.idl"
39
40 /**
41 * An optional interface for obtaining fields of
42 * logins that were collected by the password manager
43 */
44
45 interface nsIFile;
46
47 [scriptable, uuid(a448531f-dc92-4dc1-9012-da841febcbe0)]
48 interface nsIPasswordManagerInternal : nsISupports
49 {
50
51 /**
52 * A Call to find a login in the password manager list that matches the
53 * specified parameters. If any input parameter is null, it is
54 * not tested for when looking for the match.
55 *
56 * @param aHostURI The uri part of a login to search for, or null
57 * @param aUsername The username part of a login to search for, or null
58 * @param aPassword The password part of a login to search for, or null
59 * @param aHostURIFound The uri found in the login
60 * @param aUsernameFound The username found in the login
61 * @param aPasswordFound The password found in the login
62 */
63 void findPasswordEntry
64 (in AUTF8String aHostURI, in AString aUsername, in AString aPassword,
65 out AUTF8String aHostURIFound, out AString aUsernameFound, out AString aPasswordFound);
66
67 /**
68 * Called to add an individual login to the list of saved logins.
69 * All parameters are clear text.
70 *
71 * @param aKey The key for which the login is being remembered (often the page URI)
72 * @param aUser The username portion of the login
73 * @param aPassword The password portion of the login
74 * @param aUserFieldName The name of the field that contained the username
75 * @param aPassFieldName The name of the field that contained the password
76 */
77 void addUserFull(in AUTF8String aKey,
78 in AString aUser,
79 in AString aPassword,
80 in AString aUserFieldName,
81 in AString aPassFieldName);
82
83 void addUserFull2(in AUTF8String aKey,
84 in AString aUser,
85 in AString aPassword,
86 in AString aUserFieldName,
87 in AString aPassFieldName,
88 in AUTF8String ActionURL);
89
90 /**
91 * Reads logins from a Mozilla Password Manager file, augmenting the current
92 * in-memory set. If a duplicate entry is encountered, the data from the file
93 * being read replaces that currently held.
94 *
95 * @param aPasswordFile The file to read logins from.
96 */
97 void readPasswords(in nsIFile aPasswordFile);
98 };