summaryrefslogtreecommitdiffstats
path: root/xpcom/components/nsIComponentManager.idl
blob: 9abde9960c7976ce45a8f1da926d7e059f602514 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * The nsIComponentManager interface.
 */

#include "nsISupports.idl"

interface nsIFile;
interface nsIFactory;
interface nsIArray;
interface nsIUTF8StringEnumerator;

[scriptable, builtinclass, uuid(d604ffc3-1ba3-4f6c-b65f-1ed4199364c3)]
interface nsIComponentManager : nsISupports
{
    /**
     * getClassObject
     *
     * Returns the factory object that can be used to create instances of
     * CID aClass
     *
     * @param aClass The classid of the factory that is being requested
     */
    void getClassObject(in nsCIDRef aClass,
                        in nsIIDRef aIID,
                        [iid_is(aIID),retval] out nsQIResult result);

    /**
     * getClassObjectByContractID
     *
     * Returns the factory object that can be used to create instances of
     * CID aClass
     *
     * @param aClass The classid of the factory that is being requested
     */
    void getClassObjectByContractID(in string aContractID,
                                    in nsIIDRef aIID,
                                    [iid_is(aIID),retval] out nsQIResult result);


   /**
     * createInstance
     *
     * Create an instance of the CID aClass and return the interface aIID.
     *
     * @param aClass : ClassID of object instance requested
     * @param aIID : IID of interface requested
     */
    [noscript]
    void createInstance(in nsCIDRef aClass,
                        in nsIIDRef aIID,
                        [iid_is(aIID),retval] out nsQIResult result);

    /**
     * createInstanceByContractID
     *
     * Create an instance of the CID that implements aContractID and return the
     * interface aIID.
     *
     * @param aContractID : aContractID of object instance requested
     * @param aIID : IID of interface requested
     */
    [noscript]
    void createInstanceByContractID(in string aContractID,
                                    in nsIIDRef aIID,
                                    [iid_is(aIID),retval] out nsQIResult result);

    /**
     * addBootstrappedManifestLocation
     *
     * Adds a bootstrapped manifest location on runtime.
     *
     * @param aLocation : A directory where chrome.manifest resides,
     *                    or an XPI with it on the root.
     */
    void addBootstrappedManifestLocation(in nsIFile aLocation);

    /**
     * removeBootstrappedManifestLocation
     *
     * Removes a bootstrapped manifest location on runtime.
     *
     * @param aLocation : A directory where chrome.manifest resides,
     *                    or an XPI with it on the root.
     */
    void removeBootstrappedManifestLocation(in nsIFile aLocation);

    /**
     * getManifestLocations
     *
     * Get an array of nsIURIs of all registered and builtin manifest locations.
     */
    nsIArray getManifestLocations();

    /**
     * Returns a list of JSM URLs which are used to create components. This
     * should only be used in automation.
     */
    nsIUTF8StringEnumerator getComponentJSMs();

    /**
     * Returns a list of ESM URLs which are used to create components. This
     * should only be used in automation.
     */
    nsIUTF8StringEnumerator getComponentESModules();
};


%{ C++
#ifdef MOZILLA_INTERNAL_API
#include "nsComponentManagerUtils.h"
#endif
%} C++