extra: import at 3.0.1 beta 1
[mozilla-extra.git] / extensions / wallet / src / wallet.h
blob24889950867c388d9bf6d83e1cd7ad40254e8ef0
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
13 * License.
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.
22 * Contributor(s):
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.
44 #ifndef _WALLET_H
45 #define _WALLET_H
47 #include "prtypes.h"
48 #include "nsIPresShell.h"
49 #include "nsString.h"
50 #include "nsIPrompt.h"
52 class nsIInputStream;
53 class nsIOutputStream;
54 class nsIFile;
55 class nsIDOMWindowInternal;
56 class nsIDOMNode;
57 class nsIDOMHTMLFormElement;
59 PR_BEGIN_EXTERN_C
61 #define HEADER_VERSION "#2c"
63 #define YES_BUTTON 0
64 #define NO_BUTTON 1
65 #define NEVER_BUTTON 2
67 #define pref_Crypto "wallet.crypto"
68 #define pref_AutoCompleteOverride "wallet.crypto.autocompleteoverride"
70 extern void
71 WLLT_ChangePassword(PRBool* status);
73 extern void
74 WLLT_DeleteAll();
76 extern void
77 WLLT_ClearUserData();
79 extern void
80 WLLT_DeletePersistentUserData();
82 extern void
83 WLLT_PreEdit(nsAString& walletList);
85 extern void
86 WLLT_PostEdit(const nsAString& walletList);
88 extern void
89 WLLT_PrefillReturn(const nsAString& results);
91 extern void
92 WLLT_RequestToCapture(nsIPresShell* shell, nsIDOMWindowInternal * win, PRUint32* status);
94 extern nsresult
95 WLLT_PrefillOneElement
96 (nsIDOMWindowInternal* win, nsIDOMNode* elementNode, nsAString& compositeValue);
98 extern nsresult
99 WLLT_Prefill(nsIPresShell* shell, PRBool quick, nsIDOMWindowInternal* win);
101 extern void
102 WLLT_GetNopreviewListForViewer(nsAString& aNopreviewList);
104 extern void
105 WLLT_GetNocaptureListForViewer(nsAString& aNocaptureList);
107 extern void
108 WLLT_GetPrefillListForViewer(nsAString& aPrefillList);
110 extern void
111 WLLT_OnSubmit(nsIDOMHTMLFormElement* formNode, nsIDOMWindowInternal* window);
113 extern void
114 WLLT_ExpirePassword(PRBool* status);
116 extern void
117 WLLT_ExpirePasswordOnly(PRBool* status);
119 extern void
120 WLLT_InitReencryptCallback(nsIDOMWindowInternal* window);
122 extern nsresult
123 Wallet_Encrypt(const nsAString& text, nsAString& crypt);
125 extern nsresult
126 Wallet_Decrypt(const nsAString& crypt, nsAString& text);
128 extern nsresult
129 wallet_GetLine(nsIInputStream* strm, nsACString& line);
132 * Writes a line to a stream, including a newline character.
133 * parameter should not include '\n'
135 extern void
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);
153 extern void
154 Wallet_SignonViewerReturn(const nsAString& results);
156 extern void
157 Wallet_ReleaseAllLists();
159 PR_END_EXTERN_C
161 #endif /* !_WALLET_H */