Changing wallet directory structure

This commit is contained in:
dp%netscape.com 1999-04-02 23:16:20 +00:00
Родитель 5b7a609d90
Коммит 09bc3aaacc
24 изменённых файлов: 485 добавлений и 21 удалений

Просмотреть файл

@ -21,7 +21,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
DIRS=public src module
DIRS=public src
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk

Просмотреть файл

@ -17,6 +17,6 @@
DEPTH=..\..
DIRS=public src module
DIRS=public src
include <$(DEPTH)\config\rules.mak>

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -21,8 +21,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
EXPORTS = \
singsign.h \
wallet.h \
nsIWalletService.h \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))

Просмотреть файл

@ -20,8 +20,7 @@ IGNORE_MANIFEST=1
DEPTH=..\..\..
EXPORTS = \
singsign.h \
wallet.h \
nsIWalletService.h \
$(NULL)
MODULE = wallet

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -25,9 +25,10 @@ include $(topsrcdir)/config/config.mk
LIBRARY_NAME=wallet
CPPSRCS = \
wallet.cpp \
nsWalletFactory.cpp \
nsWalletService.cpp \
wallet.cpp \
$(NULL)
MODULE=wallet
@ -36,14 +37,4 @@ REQUIRES=wallet
EXPORTS= $(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
INCLUDES += \
-I$(PUBLIC)\raptor \
-I$(PUBLIC)\xpcom \
-I$(PUBLIC)\dom \
-I$(PUBLIC)\js \
-I$(PUBLIC)\netlib \
-I$(PUBLIC)\security \
-I$(PUBLIC)\pref \
-I$(PUBLIC)\wallet
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -18,10 +18,15 @@
DEPTH=..\..\..
LIBRARY_NAME=wallet
CPP_OBJS= .\$(OBJDIR)\wallet.obj
CSRCS = wallet.cpp
CPP_OBJS= .\$(OBJDIR)\wallet.obj \
.\$(OBJDIR)\nsWalletFactory.obj \
.\$(OBJDIR)\nsWalletService.obj
$(NULL)
CPPSRCS = \
CPPSRCS = \
nsWalletFactory.cpp \
nsWalletService.cpp \
wallet.cpp \
$(NULL)
MODULE=wallet

Просмотреть файл

@ -0,0 +1,34 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
// This header file just contains prototypes for the factory methods
// for "builtin" data sources that are included in walletlib.dll. Each of
// these data sources is exposed to the external world via its CID in
// ../include/nsIWalletService.h.
#ifndef nsBuiltinDataSources_h__
#define nsBuiltinDataSources_h__
//#include "nsError.h"
//class nsIWalletDataSource;
//class nsIWalletDataBase;
nsresult NS_NewWalletService(nsIWalletServiceDataSource** result);
#endif // nsBuiltinDataSources_h__

Просмотреть файл

@ -0,0 +1,163 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIWalletService.h"
//#include "nsIServiceManager.h"
//#include "nsRepository.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
static NS_DEFINE_CID(kWalletServiceCID, NS_WALLETSERVICE_CID);
//#if defined(HAS_C_PLUS_PLUS_CASTS)
//#define NS_STATIC_CAST(__type, __ptr) static_cast<__type>(__ptr)
//#else
//#define NS_STATIC_CAST(__type, __ptr) ((__type)(__ptr))
//#endif
// factory functions
nsresult NS_NewWalletService(nsIWalletService** result);
class WalletFactoryImpl : public nsIFactory
{
public:
WalletFactoryImpl(const nsCID &aClass);
// nsISupports methods
NS_DECL_ISUPPORTS
// nsIFactory methods
NS_IMETHOD CreateInstance(nsISupports *aOuter,
const nsIID &aIID,
void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
protected:
virtual ~WalletFactoryImpl();
private:
nsCID mClassID;
};
////////////////////////////////////////////////////////////////////////
WalletFactoryImpl::WalletFactoryImpl(const nsCID &aClass)
{
NS_INIT_REFCNT();
mClassID = aClass;
}
WalletFactoryImpl::~WalletFactoryImpl()
{
NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction");
}
NS_IMETHODIMP
WalletFactoryImpl::QueryInterface(const nsIID &aIID,
void **aResult)
{
if (! aResult)
return NS_ERROR_NULL_POINTER;
// Always NULL result, in case of failure
*aResult = nsnull;
if (aIID.Equals(kISupportsIID)) {
*aResult = NS_STATIC_CAST(nsISupports*, this);
AddRef();
return NS_OK;
} else if (aIID.Equals(kIFactoryIID)) {
*aResult = NS_STATIC_CAST(nsIFactory*, this);
AddRef();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(WalletFactoryImpl);
NS_IMPL_RELEASE(WalletFactoryImpl);
NS_IMETHODIMP
WalletFactoryImpl::CreateInstance(nsISupports *aOuter,
const nsIID &aIID,
void **aResult)
{
if (! aResult)
return NS_ERROR_NULL_POINTER;
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
*aResult = nsnull;
nsresult rv;
PRBool wasRefCounted = PR_TRUE;
nsISupports *inst = nsnull;
if (mClassID.Equals(kWalletServiceCID)) {
if (NS_FAILED(rv = NS_NewWalletService((nsIWalletService**) &inst)))
return rv;
}
else {
return NS_ERROR_NO_INTERFACE;
}
if (! inst)
return NS_ERROR_OUT_OF_MEMORY;
if (NS_FAILED(rv = inst->QueryInterface(aIID, aResult)))
// We didn't get the right interface, so clean up
delete inst;
if (wasRefCounted)
NS_IF_RELEASE(inst);
return rv;
}
nsresult WalletFactoryImpl::LockFactory(PRBool aLock)
{
// Not implemented in simplest case.
return NS_OK;
}
////////////////////////////////////////////////////////////////////////
// return the proper factory to the caller
extern "C" PR_IMPLEMENT(nsresult)
NSGetFactory(nsISupports* serviceMgr,
const nsCID &aClass,
const char *aClassName,
const char *aProgID,
nsIFactory **aFactory)
{
if (! aFactory)
return NS_ERROR_NULL_POINTER;
WalletFactoryImpl* factory = new WalletFactoryImpl(aClass);
if (factory == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(factory);
*aFactory = factory;
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,128 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
//#include "nsRepository.h"
#include "nsWalletService.h"
//#include "nsINetService.h"
#include "nsIServiceManager.h"
//static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
//static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
//#include "nsIWebShell.h"
//static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
//static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID);
static NS_DEFINE_IID(kIWalletServiceIID, NS_IWALLETSERVICE_IID);
#include "wallet.h"
//#if defined(HAS_C_PLUS_PLUS_CASTS)
//#define NS_STATIC_CAST(__type, __ptr) static_cast<__type>(__ptr)
//#else
//#define NS_STATIC_CAST(__type, __ptr) ((__type)(__ptr))
//#endif
nsWalletlibService::nsWalletlibService()
{
NS_INIT_REFCNT();
}
nsWalletlibService::~nsWalletlibService()
{
}
/* calls into the wallet module */
NS_IMETHODIMP
nsWalletlibService::QueryInterface(REFNSIID iid, void** result)
{
if (! result)
return NS_ERROR_NULL_POINTER;
*result = nsnull;
if (iid.Equals(kIWalletServiceIID)) {
*result = NS_STATIC_CAST(nsIWalletService*, this);
AddRef();
return NS_OK;
}
return NS_NOINTERFACE;
}
NS_IMPL_ADDREF(nsWalletlibService);
NS_IMPL_RELEASE(nsWalletlibService);
NS_IMETHODIMP nsWalletlibService::WALLET_PreEdit(nsIURL* url) {
::WLLT_PreEdit(url);
return NS_OK;
}
NS_IMETHODIMP nsWalletlibService::WALLET_Prefill(nsIPresShell* shell, PRBool quick) {
::WLLT_Prefill(shell, quick);
return NS_OK;
}
NS_IMETHODIMP nsWalletlibService::WALLET_OKToCapture
(PRBool* result, PRInt32 count, char* URLName) {
::WLLT_OKToCapture(result, count, URLName);
return NS_OK;
}
NS_IMETHODIMP nsWalletlibService::WALLET_Capture(
nsIDocument* doc,
nsString name,
nsString value) {
::WLLT_Capture(doc, name, value);
return NS_OK;
}
#ifdef junk
NS_IMETHODIMP
nsWalletlibService::SI_DisplaySignonInfoAsHTML(){
::SI_DisplaySignonInfoAsHTML();
return NS_OK;
}
NS_IMETHODIMP
nsWalletlibService::SI_RememberSignonData
(char* URLName, LO_FormSubmitData *submit) {
::SI_RememberSignonData(URLName, submit);
return NS_OK;
}
NS_IMETHODIMP
nsWalletlibService::SI_RestoreSignonData
(char* URLName, char* name, char** value) {
::SI_RestoreSignonData(URLName, name, value);
return NS_OK;
}
#endif
/* call to create the wallet object */
nsresult
NS_NewWalletService(nsIWalletService** result)
{
nsIWalletService* wallet = new nsWalletlibService();
if (! wallet)
return NS_ERROR_NULL_POINTER;
*result = wallet;
NS_ADDREF(*result);
return NS_OK;
}

Просмотреть файл

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsWalletService_h___
#define nsWalletService_h___
#include "nsIWalletService.h"
class nsWalletlibService : public nsIWalletService {
public:
NS_DECL_ISUPPORTS
nsWalletlibService();
/* Implementation of the nsIWalletService interface */
NS_IMETHOD WALLET_PreEdit(nsIURL* url);
NS_IMETHOD WALLET_Prefill(nsIPresShell* shell, PRBool quick);
NS_IMETHOD WALLET_Capture(nsIDocument* doc, nsString name, nsString value);
NS_IMETHOD WALLET_OKToCapture(PRBool* result, PRInt32 count, char* URLName);
#ifdef junk
NS_IMETHOD SI_DisplaySignonInfoAsHTML();
NS_IMETHOD SI_RememberSignonData
(char* URLName, LO_FormSubmitData *submit);
NS_IMETHOD SI_RestoreSignonData
(char* URLNAME, char* name, char** value);
#endif
protected:
virtual ~nsWalletlibService();
private:
};
#endif /* nsWalletService_h___ */

Просмотреть файл

@ -0,0 +1,44 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
/*
singsign.h --- prototypes for wallet functions.
*/
#ifndef _SINGSIGN_H
#define _SINGSIGNT_H
#include "ntypes.h"
XP_BEGIN_PROTOS
extern void
SI_DisplaySignonInfoAsHTML();
extern void
SI_RememberSignonData(char* URLName, LO_FormSubmitData *submit);
extern void
SI_RestoreSignonData(char* URLName, char* name, char** value);
XP_END_PROTOS
#endif /* !_SINGSIGN_H */

Просмотреть файл

@ -0,0 +1,50 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
/*
wallet.h --- prototypes for wallet functions.
*/
#ifndef _WALLET_H
#define _WALLET_H
#include "ntypes.h"
#include "nsIPresShell.h"
#include "nsString.h"
#include "nsIURL.h"
XP_BEGIN_PROTOS
extern void
WLLT_PreEdit(nsIURL* url);
extern void
WLLT_Prefill(nsIPresShell* shell, PRBool quick);
extern void
WLLT_OKToCapture(PRBool * result, PRInt32 count, char* URLName);
extern void
WLLT_Capture(nsIDocument* doc, nsString name, nsString value);
XP_END_PROTOS
#endif /* !_WALLET_H */