michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_ModuleLoader_h michael@0: #define mozilla_ModuleLoader_h michael@0: michael@0: #include "nsISupports.h" michael@0: #include "mozilla/Module.h" michael@0: #include "mozilla/FileLocation.h" michael@0: michael@0: #define MOZILLA_MODULELOADER_PSEUDO_IID \ michael@0: { 0xD951A8CE, 0x6E9F, 0x464F, \ michael@0: { 0x8A, 0xC8, 0x14, 0x61, 0xC0, 0xD3, 0x63, 0xC8 } } michael@0: michael@0: namespace mozilla { michael@0: michael@0: /** michael@0: * Module loaders are responsible for loading a component file. The static michael@0: * component loader is special and does not use this abstract interface. michael@0: * michael@0: * @note Implementations of this interface should be threadsafe, michael@0: * methods may be called from any thread. michael@0: */ michael@0: class ModuleLoader : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_MODULELOADER_PSEUDO_IID) michael@0: michael@0: /** michael@0: * Return the module for a specified file. The caller should cache michael@0: * the module: the implementer should not expect for the same file michael@0: * to be loaded multiple times. The Module object should either be michael@0: * statically or permanently allocated; it will not be freed. michael@0: */ michael@0: virtual const Module* LoadModule(mozilla::FileLocation &aFile) = 0; michael@0: }; michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(ModuleLoader, MOZILLA_MODULELOADER_PSEUDO_IID) michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_ModuleLoader_h