PageRenderTime 15ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_sdk/idl/nsIComponentRegistrar.idl

http://firefox-mac-pdf.googlecode.com/
IDL | 242 lines | 30 code | 27 blank | 185 comment | 0 complexity | b12ad63b4aa30bbb79e7c717e2f39e7f MD5 | raw file
  1/* ***** BEGIN LICENSE BLOCK *****
  2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3 *
  4 * The contents of this file are subject to the Mozilla Public License Version
  5 * 1.1 (the "License"); you may not use this file except in compliance with
  6 * the License. You may obtain a copy of the License at
  7 * http://www.mozilla.org/MPL/
  8 *
  9 * Software distributed under the License is distributed on an "AS IS" basis,
 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 11 * for the specific language governing rights and limitations under the
 12 * License.
 13 *
 14 * The Original Code is XPCOM.
 15 *
 16 * The Initial Developer of the Original Code is Netscape Communications.
 17 * Portions created by the Initial Developer are Copyright (C) 2001
 18 * the Initial Developer. All Rights Reserved.
 19 *
 20 * Contributor(s):
 21 *
 22 * Alternatively, the contents of this file may be used under the terms of
 23 * either the GNU General Public License Version 2 or later (the "GPL"), or
 24 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 25 * in which case the provisions of the GPL or the LGPL are applicable instead
 26 * of those above. If you wish to allow use of your version of this file only
 27 * under the terms of either the GPL or the LGPL, and not to allow others to
 28 * use your version of this file under the terms of the MPL, indicate your
 29 * decision by deleting the provisions above and replace them with the notice
 30 * and other provisions required by the GPL or the LGPL. If you do not delete
 31 * the provisions above, a recipient may use your version of this file under
 32 * the terms of any one of the MPL, the GPL or the LGPL.
 33 *
 34 * ***** END LICENSE BLOCK ***** */
 35
 36/**
 37 * The nsIComponentRegistrar interface.
 38 * @status FROZEN
 39 */
 40
 41#include "nsISupports.idl"
 42
 43interface nsIFile;
 44interface nsIFactory;
 45interface nsISimpleEnumerator;
 46
 47[scriptable, uuid(2417cbfe-65ad-48a6-b4b6-eb84db174392)]
 48interface nsIComponentRegistrar : nsISupports
 49{
 50    /**
 51     * autoRegister
 52     *
 53     * Register a component file or all component files in a directory.  
 54     *
 55     * Component files must have an associated loader and export the required
 56     * symbols which this loader defines.  For example, if the given file is a
 57     * native library (which is built into XPCOM), it must export the symbol 
 58     * "NSGetModule".  Other loaders may have different semantics.
 59     *
 60     * This method may only be called from the main thread.
 61     * 
 62     * @param aSpec    : Filename spec for component file's location. If aSpec 
 63     *                   is a directory, then every component file in the
 64     *                   directory will be registered. 
 65     *                   If aSpec is null, static components, GRE components,
 66     *                   and the application's component directories will be
 67     *                   registered. See NS_GRE_DIR, NS_XPCOM_COMPONENT_DIR,
 68     *                   and NS_XPCOM_COMPONENT_DIR_LIST in
 69     *                   nsDirectoryServiceDefs.h.
 70     */
 71    void autoRegister(in nsIFile aSpec);
 72
 73    /**
 74     * autoUnregister
 75     *
 76     * Unregister a component file or all component files in a directory.  
 77     * This method may only be called from the main thread.
 78     *
 79     * @param aSpec    : Filename spec for component file's location. If aSpec 
 80     *                   is a directory, the every component file in the directory 
 81     *                   will be registered.  
 82     *                   If aSpec is null, then the application component's 
 83     *                   directory as defined by NS_XPCOM_COMPONENT_DIR will be 
 84     *                   registered. (see nsIDirectoryService.idl)
 85     *
 86     * @return NS_OK     Unregistration was successful.
 87     *         NS_ERROR* Method failure.
 88     */
 89    void autoUnregister(in nsIFile aSpec);
 90
 91
 92    /**
 93     * registerFactory
 94     *
 95     * Register a factory with a given ContractID, CID and Class Name.
 96     *
 97     * @param aClass      : CID of object
 98     * @param aClassName  : Class Name of CID
 99     * @param aContractID : ContractID associated with CID aClass
100     * @param aFactory    : Factory that will be registered for CID aClass
101     *
102     * @return NS_OK        Registration was successful.
103     *         NS_ERROR*    method failure.
104     */
105    void registerFactory(in nsCIDRef aClass, 
106                         in string aClassName,
107                         in string aContractID, 
108                         in nsIFactory aFactory);
109
110    /**
111     * unregisterFactory
112     *
113     * Unregister a factory associated with CID aClass.
114     *
115     * @param aClass   : CID being unregistered
116     * @param aFactory : Factory previously registered to create instances of
117     *                   CID aClass.
118     *
119     * @return NS_OK     Unregistration was successful.
120     *         NS_ERROR* Method failure.
121     */    
122    void unregisterFactory(in nsCIDRef aClass, 
123                           in nsIFactory aFactory);
124
125    /**
126     * registerFactoryLocation
127     *
128     * Register a factory with a given ContractID, CID and Class Name
129     *
130     * @param aClass      : CID of object
131     * @param aClassName  : Class Name of CID
132     * @param aContractID : ContractID associated with CID aClass
133     * @param aFile       : Component File. This file must have an associated 
134     *                      loader and export the required symbols which this 
135     *                      loader specifies.
136     * @param aLoaderStr  : Opaque loader specific string.  This value is
137     *                      passed into the nsIModule's registerSelf
138     *                      callback and must be fowarded unmodified when
139     *                      registering factories via their location.
140     * @param aType       : Component Type of CID aClass.  This value is
141     *                      passed into the nsIModule's registerSelf
142     *                      callback and must be fowarded unmodified when
143     *                      registering factories via their location.
144     *
145     * @return NS_OK        Registration was successful.
146     *         NS_ERROR*    Method failure.
147     */
148    void registerFactoryLocation(in nsCIDRef aClass, 
149                                 in string aClassName,
150                                 in string aContractID, 
151                                 in nsIFile aFile,
152                                 in string aLoaderStr, 
153                                 in string aType);
154
155    /**
156     * unregisterFactoryLocation
157     *
158     * Unregister a factory associated with CID aClass.
159     *
160     * @param aClass   : CID being unregistered
161     * @param aFile    : Component File previously registered
162     *
163     * @return NS_OK     Unregistration was successful.
164     *         NS_ERROR* Method failure.
165     */    
166    void unregisterFactoryLocation(in nsCIDRef aClass, 
167                                   in nsIFile aFile);
168
169    /**
170     * isCIDRegistered
171     *
172     * Returns true if a factory is registered for the CID.
173     *
174     * @param aClass : CID queried for registeration
175     * @return       : true if a factory is registered for CID 
176     *                 false otherwise.
177     */
178    boolean isCIDRegistered(in nsCIDRef aClass);
179    
180    /**
181     * isContractIDRegistered
182     *
183     * Returns true if a factory is registered for the contract id.
184     *
185     * @param aClass : contract id queried for registeration
186     * @return       : true if a factory is registered for contract id 
187     *                 false otherwise.
188     */
189    boolean isContractIDRegistered(in string aContractID);
190
191    /**
192     * enumerateCIDs
193     *
194     * Enumerate the list of all registered CIDs.
195     *
196     * @return : enumerator for CIDs.  Elements of the enumeration can be QI'ed
197     *           for the nsISupportsID interface.  From the nsISupportsID, you 
198     *           can obtain the actual CID.
199     */
200    nsISimpleEnumerator enumerateCIDs();
201
202    /**
203     * enumerateContractIDs
204     *
205     * Enumerate the list of all registered ContractIDs.
206     *
207     * @return : enumerator for ContractIDs. Elements of the enumeration can be 
208     *           QI'ed for the nsISupportsCString interface.  From  the
209     *           nsISupportsCString interface, you can obtain the actual 
210     *           Contract ID string.
211     */
212    nsISimpleEnumerator enumerateContractIDs();
213
214    /**
215     * CIDToContractID
216     *
217     * Returns the Contract ID for a given CID, if one exists and is registered.
218     *
219     * @return : Contract ID.
220     */
221    string   CIDToContractID(in nsCIDRef aClass);
222
223    /**
224     * contractIDToCID
225     *
226     * Returns the CID for a given Contract ID, if one exists and is registered.
227     *
228     * @return : Contract ID.
229     */
230    nsCIDPtr contractIDToCID(in string aContractID);
231
232};
233
234
235
236
237
238
239
240
241
242