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 singsign.h --- prototypes for wallet functions.
48 #include "nsVoidArray.h"
50 #include "nsIDOMWindowInternal.h"
53 class nsIPromptService2
;
55 class nsIAuthInformation
;
57 /* Duplicates defines as in nsIPrompt.idl -- keep in sync! */
58 #define SINGSIGN_SAVE_PASSWORD_NEVER 0
59 #define SINGSIGN_SAVE_PASSWORD_FOR_SESSION 1
60 #define SINGSIGN_SAVE_PASSWORD_PERMANENTLY 2
69 SINGSIGN_UserCount(PRInt32 host
);
72 SINGSIGN_RejectCount();
76 (PRInt32 hostNumber
, PRInt32 userNumber
, PRBool decrypt
, char **host
, PRUnichar
**user
, PRUnichar
**pswd
);
79 SINGSIGN_RejectEnumerate(PRInt32 rejectNumber
, char **host
);
82 SINGSIGN_RestoreSignonData(nsIPrompt
* dialog
, nsIURI
* passwordRealm
, const PRUnichar
* name
, PRUnichar
** value
, PRUint32 formNumber
, PRUint32 elementNumber
);
85 SINGSIGN_PromptUsernameAndPassword
86 (const PRUnichar
*dialogTitle
, const PRUnichar
*text
, PRUnichar
**user
, PRUnichar
**pwd
,
87 const char* passwordRealm
, nsIPrompt
* dialog
, PRBool
*returnValue
,
88 PRUint32 savePassword
= SINGSIGN_SAVE_PASSWORD_PERMANENTLY
);
91 SINGSIGN_PromptPassword
92 (const PRUnichar
*dialogTitle
, const PRUnichar
*text
, PRUnichar
**pwd
,
93 const char* passwordRealm
, nsIPrompt
* dialog
, PRBool
*returnValue
,
94 PRUint32 savePassword
= SINGSIGN_SAVE_PASSWORD_PERMANENTLY
);
98 (const PRUnichar
*dialogTitle
, const PRUnichar
*text
, const PRUnichar
*defaultText
, PRUnichar
**resultText
,
99 const char* passwordRealm
, nsIPrompt
* dialog
, PRBool
*returnValue
,
100 PRUint32 savePassword
= SINGSIGN_SAVE_PASSWORD_PERMANENTLY
);
104 (nsIPromptService2
* aService
, nsIDOMWindow
* aParent
, nsIChannel
* aChannel
,
105 PRUint32 aLevel
, nsIAuthInformation
* aAuthInfo
, PRBool
* retval
);
109 (const char* passwordRealm
, const PRUnichar
*userName
, PRBool notify
);
112 SINGSIGN_RemoveUserAfterLoginFailure
113 (const char* passwordRealm
, const PRUnichar
*userName
, PRBool notify
);
116 SINGSIGN_RemoveReject
124 SINGSIGN_StorePassword
125 (const char* passwordRealm
, const PRUnichar
*userName
, const PRUnichar
*password
);
128 SINGSIGN_HaveData(nsIPrompt
* dialog
, const char* passwordRealm
, const PRUnichar
*userName
, PRBool
*retval
);
131 SI_RegisterCallback(const char* domain
, PrefChangedFunc callback
, void* instance_data
);
134 SI_UnregisterCallback(const char* domain
, PrefChangedFunc callback
, void* instance_data
);
137 SI_GetBoolPref(const char * prefname
, PRBool defaultvalue
);
140 SI_SetBoolPref(const char * prefname
, PRBool prefvalue
);
143 SI_SetCharPref(const char * prefname
, const char * prefvalue
);
146 SI_GetCharPref(const char * prefname
, char** aPrefvalue
);
149 SI_GetLocalizedUnicharPref(const char * prefname
, PRUnichar
** aPrefvalue
);
151 extern void SI_InitSignonFileName();
154 SI_InSequence(const nsString
& sequence
, int number
);
157 SI_FindValueInArgs(const nsAString
& results
, const nsAString
& name
, nsAString
& value
);
166 SI_DeletePersistentUserData();
169 SINGSIGN_ReencryptAll();
172 SINGSIGN_RememberSignonData
173 (nsIPrompt
* dialog
, nsIURI
* uri
, nsVoidArray
* signonData
, nsIDOMWindowInternal
* window
);
180 class si_SignonDataStruct
{
182 si_SignonDataStruct();
183 ~si_SignonDataStruct();
190 #endif /* !_SINGSIGN_H */