1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* ***** BEGIN LICENSE BLOCK *****
3 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 : *
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/
9 : *
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
13 : * License.
14 : *
15 : * The Original Code is Mozilla XPCOM.
16 : *
17 : * The Initial Developer of the Original Code is
18 : * Benjamin Smedberg <benjamin@smedbergs.us>
19 : *
20 : * Portions created by the Initial Developer are Copyright (C) 2005
21 : * the Mozilla Foundation <http://www.mozilla.org/>. All Rights Reserved.
22 : *
23 : * Contributor(s):
24 : *
25 : * Alternatively, the contents of this file may be used under the terms of
26 : * either the GNU General Public License Version 2 or later (the "GPL"), or
27 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 : * in which case the provisions of the GPL or the LGPL are applicable instead
29 : * of those above. If you wish to allow use of your version of this file only
30 : * under the terms of either the GPL or the LGPL, and not to allow others to
31 : * use your version of this file under the terms of the MPL, indicate your
32 : * decision by deleting the provisions above and replace them with the notice
33 : * and other provisions required by the GPL or the LGPL. If you do not delete
34 : * the provisions above, a recipient may use your version of this file under
35 : * the terms of any one of the MPL, the GPL or the LGPL.
36 : *
37 : * ***** END LICENSE BLOCK ***** */
38 :
39 : #ifndef mozilla_ModuleLoader_h
40 : #define mozilla_ModuleLoader_h
41 :
42 : #include "nsISupports.h"
43 : #include "mozilla/Module.h"
44 : #include "mozilla/FileLocation.h"
45 :
46 : #define MOZILLA_MODULELOADER_PSEUDO_IID \
47 : { 0xD951A8CE, 0x6E9F, 0x464F, \
48 : { 0x8A, 0xC8, 0x14, 0x61, 0xC0, 0xD3, 0x63, 0xC8 } }
49 :
50 : namespace mozilla {
51 :
52 : /**
53 : * Module loaders are responsible for loading a component file. The static
54 : * component loader is special and does not use this abstract interface.
55 : *
56 : * @note Implementations of this interface should be threadsafe,
57 : * methods may be called from any thread.
58 : */
59 : class ModuleLoader : public nsISupports
60 2384 : {
61 : public:
62 : NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_MODULELOADER_PSEUDO_IID)
63 :
64 : /**
65 : * Return the module for a specified file. The caller should cache
66 : * the module: the implementer should not expect for the same file
67 : * to be loaded multiple times. The Module object should either be
68 : * statically or permanently allocated; it will not be freed.
69 : */
70 : virtual const Module* LoadModule(mozilla::FileLocation &aFile) = 0;
71 : };
72 : NS_DEFINE_STATIC_IID_ACCESSOR(ModuleLoader, MOZILLA_MODULELOADER_PSEUDO_IID)
73 :
74 : } // namespace mozilla
75 :
76 : #endif // mozilla_ModuleLoader_h
|