1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
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/
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
15 * The Original Code is Mozilla Communicator client code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
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.
36 * ***** END LICENSE BLOCK ***** */
40 wallet.h --- prototypes for wallet functions.
48 #include "nsIPresShell.h"
50 #include "nsIPrompt.h"
53 class nsIOutputStream
;
55 class nsIDOMWindowInternal
;
57 class nsIDOMHTMLFormElement
;
61 #define HEADER_VERSION "#2c"
65 #define NEVER_BUTTON 2
67 #define pref_Crypto "wallet.crypto"
68 #define pref_AutoCompleteOverride "wallet.crypto.autocompleteoverride"
71 WLLT_ChangePassword(PRBool
* status
);
80 WLLT_DeletePersistentUserData();
83 WLLT_PreEdit(nsAString
& walletList
);
86 WLLT_PostEdit(const nsAString
& walletList
);
89 WLLT_PrefillReturn(const nsAString
& results
);
92 WLLT_RequestToCapture(nsIPresShell
* shell
, nsIDOMWindowInternal
* win
, PRUint32
* status
);
95 WLLT_PrefillOneElement
96 (nsIDOMWindowInternal
* win
, nsIDOMNode
* elementNode
, nsAString
& compositeValue
);
99 WLLT_Prefill(nsIPresShell
* shell
, PRBool quick
, nsIDOMWindowInternal
* win
);
102 WLLT_GetNopreviewListForViewer(nsAString
& aNopreviewList
);
105 WLLT_GetNocaptureListForViewer(nsAString
& aNocaptureList
);
108 WLLT_GetPrefillListForViewer(nsAString
& aPrefillList
);
111 WLLT_OnSubmit(nsIDOMHTMLFormElement
* formNode
, nsIDOMWindowInternal
* window
);
114 WLLT_ExpirePassword(PRBool
* status
);
117 WLLT_ExpirePasswordOnly(PRBool
* status
);
120 WLLT_InitReencryptCallback(nsIDOMWindowInternal
* window
);
123 Wallet_Encrypt(const nsAString
& text
, nsAString
& crypt
);
126 Wallet_Decrypt(const nsAString
& crypt
, nsAString
& text
);
129 wallet_GetLine(nsIInputStream
* strm
, nsACString
& line
);
132 * Writes a line to a stream, including a newline character.
133 * parameter should not include '\n'
136 wallet_PutLine(nsIOutputStream
* strm
, const char* line
);
139 * Gets the current profile directory
141 extern nsresult
Wallet_ProfileDirectory(nsIFile
** aFile
);
143 extern PRUnichar
* Wallet_Localize(const char * genericString
);
145 extern char* Wallet_RandomName(char* suffix
);
147 extern PRBool
Wallet_ConfirmYN(PRUnichar
* szMessage
, nsIDOMWindowInternal
* window
);
149 extern PRInt32
Wallet_3ButtonConfirm(PRUnichar
* szMessage
, nsIDOMWindowInternal
* window
);
151 extern void Wallet_GiveCaveat(nsIDOMWindowInternal
* window
, nsIPrompt
* dialog
);
154 Wallet_SignonViewerReturn(const nsAString
& results
);
157 Wallet_ReleaseAllLists();
161 #endif /* !_WALLET_H */