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 ***** */
38 #ifndef nsWalletService_h___
39 #define nsWalletService_h___
41 #include "nsIWalletService.h"
42 #include "nsIObserver.h"
43 #include "nsIFormSubmitObserver.h"
44 #include "nsWeakReference.h"
45 #include "nsIPrompt.h"
46 #include "nsIPromptService2.h"
47 #include "nsIDOMWindow.h"
48 #include "nsIDOMWindowInternal.h"
50 #include "nsIWebProgressListener.h"
51 #include "nsIComponentManager.h"
52 #include "nsIGenericFactory.h"
53 #include "nsIAuthPromptWrapper.h"
54 #include "nsIAuthPrompt2.h"
55 #include "nsIPromptFactory.h"
57 class nsWalletlibService
: public nsIWalletService
,
59 public nsIFormSubmitObserver
,
60 public nsIWebProgressListener
,
61 public nsIPromptFactory
,
62 public nsSupportsWeakReference
{
66 NS_DECL_NSIWALLETSERVICE
68 NS_DECL_NSIWEBPROGRESSLISTENER
69 NS_DECL_NSIPROMPTFACTORY
70 // NS_DECL_NSSUPPORTSWEAKREFERENCE
75 // NS_DECL_NSIFORMSUBMITOBSERVER
76 NS_IMETHOD
Notify(nsIDOMHTMLFormElement
* formNode
, nsIDOMWindowInternal
* window
, nsIURI
* actionURL
, PRBool
* cancelSubmit
);
78 // {Un}Register proc that do category {Un}Registration
79 static NS_METHOD
RegisterProc(nsIComponentManager
*aCompMgr
,
81 const char *registryLocation
,
82 const char *componentType
,
83 const nsModuleComponentInfo
*info
);
84 static NS_METHOD
UnregisterProc(nsIComponentManager
*aCompMgr
,
86 const char *registryLocation
,
87 const nsModuleComponentInfo
*info
);
91 virtual ~nsWalletlibService();
94 ////////////////////////////////////////////////////////////////////////////////
96 class nsSingleSignOnPrompt
: public nsIAuthPromptWrapper
100 NS_DECL_NSIAUTHPROMPT
101 NS_DECL_NSIAUTHPROMPTWRAPPER
103 nsSingleSignOnPrompt() { }
104 virtual ~nsSingleSignOnPrompt() {}
109 nsCOMPtr
<nsIPrompt
> mPrompt
;
112 ////////////////////////////////////////////////////////////////////////////////
114 class nsWalletAuthPromptWrapper
: public nsIAuthPrompt2
118 NS_DECL_NSIAUTHPROMPT2
120 nsWalletAuthPromptWrapper(nsIPromptService2
* aService
,
121 nsIDOMWindow
* aParent
)
122 : mService(aService
), mParent(aParent
) {}
124 ~nsWalletAuthPromptWrapper() {}
126 nsCOMPtr
<nsIPromptService2
> mService
;
127 nsCOMPtr
<nsIDOMWindow
> mParent
;
131 #endif /* nsWalletService_h___ */