1/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6/**
7 * The nsIComponentManager interface.
8 */
9
10#include "nsISupports.idl"
11
12interface nsIFile;
13interface nsIFactory;
14interface nsIArray;
15
16[scriptable, uuid(d604ffc3-1ba3-4f6c-b65f-1ed4199364c3)]
17interface nsIComponentManager : nsISupports
18{
19    /**
20     * getClassObject
21     *
22     * Returns the factory object that can be used to create instances of
23     * CID aClass
24     *
25     * @param aClass The classid of the factory that is being requested
26     */
27    void getClassObject(in nsCIDRef aClass,
28                        in nsIIDRef aIID,
29                        [iid_is(aIID),retval] out nsQIResult result);
30
31    /**
32     * getClassObjectByContractID
33     *
34     * Returns the factory object that can be used to create instances of
35     * CID aClass
36     *
37     * @param aClass The classid of the factory that is being requested
38     */
39    void getClassObjectByContractID(in string aContractID,
40                                    in nsIIDRef aIID,
41                                    [iid_is(aIID),retval] out nsQIResult result);
42
43
44   /**
45     * createInstance
46     *
47     * Create an instance of the CID aClass and return the interface aIID.
48     *
49     * @param aClass : ClassID of object instance requested
50     * @param aDelegate : Used for aggregation
51     * @param aIID : IID of interface requested
52     */
53    void createInstance(in nsCIDRef aClass,
54                        in nsISupports aDelegate,
55                        in nsIIDRef aIID,
56                        [iid_is(aIID),retval] out nsQIResult result);
57
58    /**
59     * createInstanceByContractID
60     *
61     * Create an instance of the CID that implements aContractID and return the
62     * interface aIID.
63     *
64     * @param aContractID : aContractID of object instance requested
65     * @param aDelegate : Used for aggregation
66     * @param aIID : IID of interface requested
67     */
68    void createInstanceByContractID(in string aContractID,
69                                    in nsISupports aDelegate,
70                                    in nsIIDRef aIID,
71                                    [iid_is(aIID),retval] out nsQIResult result);
72
73    /**
74     * addBootstrappedManifestLocation
75     *
76     * Adds a bootstrapped manifest location on runtime.
77     *
78     * @param aLocation : A directory where chrome.manifest resides,
79     *                    or an XPI with it on the root.
80     */
81    void addBootstrappedManifestLocation(in nsIFile aLocation);
82
83    /**
84     * removeBootstrappedManifestLocation
85     *
86     * Removes a bootstrapped manifest location on runtime.
87     *
88     * @param aLocation : A directory where chrome.manifest resides,
89     *                    or an XPI with it on the root.
90     */
91    void removeBootstrappedManifestLocation(in nsIFile aLocation);
92
93    /**
94     * getManifestLocations
95     *
96     * Get an array of nsIURIs of all registered and builtin manifest locations.
97     */
98    nsIArray getManifestLocations();
99};
100
101
102%{ C++
103#ifdef MOZILLA_INTERNAL_API
104#include "nsComponentManagerUtils.h"
105#endif
106%} C++
107