1999-09-01 01:40:21 +04:00
|
|
|
/* -*- 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.1 (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) 1999 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsIComponentLoader.h"
|
|
|
|
#include "nsIComponentManager.h"
|
2000-01-25 00:28:28 +03:00
|
|
|
#include "nsIFile.h"
|
|
|
|
#include "nsDirectoryService.h"
|
1999-09-01 01:40:21 +04:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsHashtable.h"
|
1999-11-10 03:28:34 +03:00
|
|
|
#include "nsVoidArray.h"
|
1999-09-01 01:40:21 +04:00
|
|
|
#include "xcDll.h"
|
2003-03-05 06:22:12 +03:00
|
|
|
#include "nsINativeComponentLoader.h"
|
1999-09-01 01:40:21 +04:00
|
|
|
|
|
|
|
#ifndef nsNativeComponentLoader_h__
|
|
|
|
#define nsNativeComponentLoader_h__
|
|
|
|
|
2003-03-05 06:22:12 +03:00
|
|
|
class nsNativeComponentLoader : public nsIComponentLoader, public nsINativeComponentLoader {
|
1999-09-01 01:40:21 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSICOMPONENTLOADER
|
2003-03-05 06:22:12 +03:00
|
|
|
NS_DECL_NSINATIVECOMPONENTLOADER
|
1999-09-01 01:40:21 +04:00
|
|
|
|
|
|
|
nsNativeComponentLoader();
|
2003-05-03 04:54:20 +04:00
|
|
|
|
1999-09-21 00:54:04 +04:00
|
|
|
nsIComponentManager* mCompMgr; // weak reference -- backpointer
|
2003-05-24 02:23:10 +04:00
|
|
|
nsHashtable mLoadedDependentLibs;
|
2003-05-03 04:54:20 +04:00
|
|
|
|
|
|
|
private:
|
2003-05-24 02:23:10 +04:00
|
|
|
nsObjectHashtable mDllStore;
|
1999-11-10 03:28:34 +03:00
|
|
|
nsVoidArray mDeferredComponents;
|
1999-09-01 01:40:21 +04:00
|
|
|
|
2004-01-15 09:14:18 +03:00
|
|
|
~nsNativeComponentLoader() {}
|
|
|
|
|
2002-06-15 01:33:05 +04:00
|
|
|
NS_IMETHOD RegisterComponentsInDir(PRInt32 when, nsIFile *dir);
|
|
|
|
|
|
|
|
nsresult CreateDll(nsIFile *aSpec, const char *aLocation, nsDll **aDll);
|
1999-11-10 03:28:34 +03:00
|
|
|
nsresult SelfRegisterDll(nsDll *dll, const char *registryLocation,
|
|
|
|
PRBool deferred);
|
1999-09-01 01:40:21 +04:00
|
|
|
nsresult SelfUnregisterDll(nsDll *dll);
|
|
|
|
nsresult GetFactoryFromModule(nsDll *aDll, const nsCID &aCID,
|
|
|
|
nsIFactory **aFactory);
|
1999-09-14 17:40:22 +04:00
|
|
|
|
|
|
|
nsresult DumpLoadError(nsDll *dll,
|
|
|
|
const char *aCallerName,
|
|
|
|
const char *aNsprErrorMsg);
|
1999-09-01 01:40:21 +04:00
|
|
|
};
|
|
|
|
|
2002-01-24 04:29:40 +03:00
|
|
|
|
|
|
|
// Exported Function from module dll to Create the nsIModule
|
|
|
|
#define NS_GET_MODULE_SYMBOL "NSGetModule"
|
|
|
|
|
|
|
|
extern "C" NS_EXPORT nsresult PR_CALLBACK
|
|
|
|
NSGetModule(nsIComponentManager *aCompMgr,
|
|
|
|
nsIFile* location,
|
|
|
|
nsIModule** return_cobj);
|
|
|
|
|
|
|
|
typedef nsresult (PR_CALLBACK *nsGetModuleProc)(nsIComponentManager *aCompMgr,
|
|
|
|
nsIFile* location,
|
|
|
|
nsIModule** return_cobj);
|
|
|
|
|
|
|
|
|
1999-09-01 01:40:21 +04:00
|
|
|
#endif /* nsNativeComponentLoader_h__ */
|
2002-06-15 01:33:05 +04:00
|
|
|
|