PageRenderTime 338ms CodeModel.GetById 138ms app.highlight 106ms RepoModel.GetById 79ms app.codeStats 1ms

/gecko_api/include/nsIComponentRegistrar.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 376 lines | 139 code | 51 blank | 186 comment | 0 complexity | e04f8af6431313b939a04c5561a267a5 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/components/nsIComponentRegistrar.idl
  3 */
  4
  5#ifndef __gen_nsIComponentRegistrar_h__
  6#define __gen_nsIComponentRegistrar_h__
  7
  8
  9#ifndef __gen_nsISupports_h__
 10#include "nsISupports.h"
 11#endif
 12
 13/* For IDL files that don't want to include root IDL files. */
 14#ifndef NS_NO_VTABLE
 15#define NS_NO_VTABLE
 16#endif
 17class nsIFile; /* forward declaration */
 18
 19class nsIFactory; /* forward declaration */
 20
 21class nsISimpleEnumerator; /* forward declaration */
 22
 23
 24/* starting interface:    nsIComponentRegistrar */
 25#define NS_ICOMPONENTREGISTRAR_IID_STR "2417cbfe-65ad-48a6-b4b6-eb84db174392"
 26
 27#define NS_ICOMPONENTREGISTRAR_IID \
 28  {0x2417cbfe, 0x65ad, 0x48a6, \
 29    { 0xb4, 0xb6, 0xeb, 0x84, 0xdb, 0x17, 0x43, 0x92 }}
 30
 31class NS_NO_VTABLE NS_SCRIPTABLE nsIComponentRegistrar : public nsISupports {
 32 public: 
 33
 34  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOMPONENTREGISTRAR_IID)
 35
 36  /**
 37     * autoRegister
 38     *
 39     * Register a component file or all component files in a directory.  
 40     *
 41     * Component files must have an associated loader and export the required
 42     * symbols which this loader defines.  For example, if the given file is a
 43     * native library (which is built into XPCOM), it must export the symbol 
 44     * "NSGetModule".  Other loaders may have different semantics.
 45     *
 46     * This method may only be called from the main thread.
 47     * 
 48     * @param aSpec    : Filename spec for component file's location. If aSpec 
 49     *                   is a directory, then every component file in the
 50     *                   directory will be registered. 
 51     *                   If aSpec is null, static components, GRE components,
 52     *                   and the application's component directories will be
 53     *                   registered. See NS_GRE_DIR, NS_XPCOM_COMPONENT_DIR,
 54     *                   and NS_XPCOM_COMPONENT_DIR_LIST in
 55     *                   nsDirectoryServiceDefs.h.
 56     */
 57  /* void autoRegister (in nsIFile aSpec); */
 58  NS_SCRIPTABLE NS_IMETHOD AutoRegister(nsIFile *aSpec) = 0;
 59
 60  /**
 61     * autoUnregister
 62     *
 63     * Unregister a component file or all component files in a directory.  
 64     * This method may only be called from the main thread.
 65     *
 66     * @param aSpec    : Filename spec for component file's location. If aSpec 
 67     *                   is a directory, the every component file in the directory 
 68     *                   will be registered.  
 69     *                   If aSpec is null, then the application component's 
 70     *                   directory as defined by NS_XPCOM_COMPONENT_DIR will be 
 71     *                   registered. (see nsIDirectoryService.idl)
 72     *
 73     * @return NS_OK     Unregistration was successful.
 74     *         NS_ERROR* Method failure.
 75     */
 76  /* void autoUnregister (in nsIFile aSpec); */
 77  NS_SCRIPTABLE NS_IMETHOD AutoUnregister(nsIFile *aSpec) = 0;
 78
 79  /**
 80     * registerFactory
 81     *
 82     * Register a factory with a given ContractID, CID and Class Name.
 83     *
 84     * @param aClass      : CID of object
 85     * @param aClassName  : Class Name of CID
 86     * @param aContractID : ContractID associated with CID aClass
 87     * @param aFactory    : Factory that will be registered for CID aClass
 88     *
 89     * @return NS_OK        Registration was successful.
 90     *         NS_ERROR*    method failure.
 91     */
 92  /* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory); */
 93  NS_SCRIPTABLE NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) = 0;
 94
 95  /**
 96     * unregisterFactory
 97     *
 98     * Unregister a factory associated with CID aClass.
 99     *
100     * @param aClass   : CID being unregistered
101     * @param aFactory : Factory previously registered to create instances of
102     *                   CID aClass.
103     *
104     * @return NS_OK     Unregistration was successful.
105     *         NS_ERROR* Method failure.
106     */
107  /* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
108  NS_SCRIPTABLE NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) = 0;
109
110  /**
111     * registerFactoryLocation
112     *
113     * Register a factory with a given ContractID, CID and Class Name
114     *
115     * @param aClass      : CID of object
116     * @param aClassName  : Class Name of CID
117     * @param aContractID : ContractID associated with CID aClass
118     * @param aFile       : Component File. This file must have an associated 
119     *                      loader and export the required symbols which this 
120     *                      loader specifies.
121     * @param aLoaderStr  : Opaque loader specific string.  This value is
122     *                      passed into the nsIModule's registerSelf
123     *                      callback and must be fowarded unmodified when
124     *                      registering factories via their location.
125     * @param aType       : Component Type of CID aClass.  This value is
126     *                      passed into the nsIModule's registerSelf
127     *                      callback and must be fowarded unmodified when
128     *                      registering factories via their location.
129     *
130     * @return NS_OK        Registration was successful.
131     *         NS_ERROR*    Method failure.
132     */
133  /* void registerFactoryLocation (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aFile, in string aLoaderStr, in string aType); */
134  NS_SCRIPTABLE NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) = 0;
135
136  /**
137     * unregisterFactoryLocation
138     *
139     * Unregister a factory associated with CID aClass.
140     *
141     * @param aClass   : CID being unregistered
142     * @param aFile    : Component File previously registered
143     *
144     * @return NS_OK     Unregistration was successful.
145     *         NS_ERROR* Method failure.
146     */
147  /* void unregisterFactoryLocation (in nsCIDRef aClass, in nsIFile aFile); */
148  NS_SCRIPTABLE NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) = 0;
149
150  /**
151     * isCIDRegistered
152     *
153     * Returns true if a factory is registered for the CID.
154     *
155     * @param aClass : CID queried for registeration
156     * @return       : true if a factory is registered for CID 
157     *                 false otherwise.
158     */
159  /* boolean isCIDRegistered (in nsCIDRef aClass); */
160  NS_SCRIPTABLE NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) = 0;
161
162  /**
163     * isContractIDRegistered
164     *
165     * Returns true if a factory is registered for the contract id.
166     *
167     * @param aClass : contract id queried for registeration
168     * @return       : true if a factory is registered for contract id 
169     *                 false otherwise.
170     */
171  /* boolean isContractIDRegistered (in string aContractID); */
172  NS_SCRIPTABLE NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) = 0;
173
174  /**
175     * enumerateCIDs
176     *
177     * Enumerate the list of all registered CIDs.
178     *
179     * @return : enumerator for CIDs.  Elements of the enumeration can be QI'ed
180     *           for the nsISupportsID interface.  From the nsISupportsID, you 
181     *           can obtain the actual CID.
182     */
183  /* nsISimpleEnumerator enumerateCIDs (); */
184  NS_SCRIPTABLE NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) = 0;
185
186  /**
187     * enumerateContractIDs
188     *
189     * Enumerate the list of all registered ContractIDs.
190     *
191     * @return : enumerator for ContractIDs. Elements of the enumeration can be 
192     *           QI'ed for the nsISupportsCString interface.  From  the
193     *           nsISupportsCString interface, you can obtain the actual 
194     *           Contract ID string.
195     */
196  /* nsISimpleEnumerator enumerateContractIDs (); */
197  NS_SCRIPTABLE NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) = 0;
198
199  /**
200     * CIDToContractID
201     *
202     * Returns the Contract ID for a given CID, if one exists and is registered.
203     *
204     * @return : Contract ID.
205     */
206  /* string CIDToContractID (in nsCIDRef aClass); */
207  NS_SCRIPTABLE NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) = 0;
208
209  /**
210     * contractIDToCID
211     *
212     * Returns the CID for a given Contract ID, if one exists and is registered.
213     *
214     * @return : Contract ID.
215     */
216  /* nsCIDPtr contractIDToCID (in string aContractID); */
217  NS_SCRIPTABLE NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) = 0;
218
219};
220
221  NS_DEFINE_STATIC_IID_ACCESSOR(nsIComponentRegistrar, NS_ICOMPONENTREGISTRAR_IID)
222
223/* Use this macro when declaring classes that implement this interface. */
224#define NS_DECL_NSICOMPONENTREGISTRAR \
225  NS_SCRIPTABLE NS_IMETHOD AutoRegister(nsIFile *aSpec); \
226  NS_SCRIPTABLE NS_IMETHOD AutoUnregister(nsIFile *aSpec); \
227  NS_SCRIPTABLE NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory); \
228  NS_SCRIPTABLE NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory); \
229  NS_SCRIPTABLE NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType); \
230  NS_SCRIPTABLE NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile); \
231  NS_SCRIPTABLE NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval); \
232  NS_SCRIPTABLE NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval); \
233  NS_SCRIPTABLE NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval); \
234  NS_SCRIPTABLE NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval); \
235  NS_SCRIPTABLE NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval); \
236  NS_SCRIPTABLE NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval); 
237
238/* Use this macro to declare functions that forward the behavior of this interface to another object. */
239#define NS_FORWARD_NSICOMPONENTREGISTRAR(_to) \
240  NS_SCRIPTABLE NS_IMETHOD AutoRegister(nsIFile *aSpec) { return _to AutoRegister(aSpec); } \
241  NS_SCRIPTABLE NS_IMETHOD AutoUnregister(nsIFile *aSpec) { return _to AutoUnregister(aSpec); } \
242  NS_SCRIPTABLE NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) { return _to RegisterFactory(aClass, aClassName, aContractID, aFactory); } \
243  NS_SCRIPTABLE NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) { return _to UnregisterFactory(aClass, aFactory); } \
244  NS_SCRIPTABLE NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) { return _to RegisterFactoryLocation(aClass, aClassName, aContractID, aFile, aLoaderStr, aType); } \
245  NS_SCRIPTABLE NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) { return _to UnregisterFactoryLocation(aClass, aFile); } \
246  NS_SCRIPTABLE NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) { return _to IsCIDRegistered(aClass, _retval); } \
247  NS_SCRIPTABLE NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) { return _to IsContractIDRegistered(aContractID, _retval); } \
248  NS_SCRIPTABLE NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) { return _to EnumerateCIDs(_retval); } \
249  NS_SCRIPTABLE NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) { return _to EnumerateContractIDs(_retval); } \
250  NS_SCRIPTABLE NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) { return _to CIDToContractID(aClass, _retval); } \
251  NS_SCRIPTABLE NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) { return _to ContractIDToCID(aContractID, _retval); } 
252
253/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
254#define NS_FORWARD_SAFE_NSICOMPONENTREGISTRAR(_to) \
255  NS_SCRIPTABLE NS_IMETHOD AutoRegister(nsIFile *aSpec) { return !_to ? NS_ERROR_NULL_POINTER : _to->AutoRegister(aSpec); } \
256  NS_SCRIPTABLE NS_IMETHOD AutoUnregister(nsIFile *aSpec) { return !_to ? NS_ERROR_NULL_POINTER : _to->AutoUnregister(aSpec); } \
257  NS_SCRIPTABLE NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterFactory(aClass, aClassName, aContractID, aFactory); } \
258  NS_SCRIPTABLE NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterFactory(aClass, aFactory); } \
259  NS_SCRIPTABLE NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterFactoryLocation(aClass, aClassName, aContractID, aFile, aLoaderStr, aType); } \
260  NS_SCRIPTABLE NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterFactoryLocation(aClass, aFile); } \
261  NS_SCRIPTABLE NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCIDRegistered(aClass, _retval); } \
262  NS_SCRIPTABLE NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsContractIDRegistered(aContractID, _retval); } \
263  NS_SCRIPTABLE NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateCIDs(_retval); } \
264  NS_SCRIPTABLE NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateContractIDs(_retval); } \
265  NS_SCRIPTABLE NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CIDToContractID(aClass, _retval); } \
266  NS_SCRIPTABLE NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContractIDToCID(aContractID, _retval); } 
267
268#if 0
269/* Use the code below as a template for the implementation class for this interface. */
270
271/* Header file */
272class nsComponentRegistrar : public nsIComponentRegistrar
273{
274public:
275  NS_DECL_ISUPPORTS
276  NS_DECL_NSICOMPONENTREGISTRAR
277
278  nsComponentRegistrar();
279
280private:
281  ~nsComponentRegistrar();
282
283protected:
284  /* additional members */
285};
286
287/* Implementation file */
288NS_IMPL_ISUPPORTS1(nsComponentRegistrar, nsIComponentRegistrar)
289
290nsComponentRegistrar::nsComponentRegistrar()
291{
292  /* member initializers and constructor code */
293}
294
295nsComponentRegistrar::~nsComponentRegistrar()
296{
297  /* destructor code */
298}
299
300/* void autoRegister (in nsIFile aSpec); */
301NS_IMETHODIMP nsComponentRegistrar::AutoRegister(nsIFile *aSpec)
302{
303    return NS_ERROR_NOT_IMPLEMENTED;
304}
305
306/* void autoUnregister (in nsIFile aSpec); */
307NS_IMETHODIMP nsComponentRegistrar::AutoUnregister(nsIFile *aSpec)
308{
309    return NS_ERROR_NOT_IMPLEMENTED;
310}
311
312/* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory); */
313NS_IMETHODIMP nsComponentRegistrar::RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory)
314{
315    return NS_ERROR_NOT_IMPLEMENTED;
316}
317
318/* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
319NS_IMETHODIMP nsComponentRegistrar::UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory)
320{
321    return NS_ERROR_NOT_IMPLEMENTED;
322}
323
324/* void registerFactoryLocation (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aFile, in string aLoaderStr, in string aType); */
325NS_IMETHODIMP nsComponentRegistrar::RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType)
326{
327    return NS_ERROR_NOT_IMPLEMENTED;
328}
329
330/* void unregisterFactoryLocation (in nsCIDRef aClass, in nsIFile aFile); */
331NS_IMETHODIMP nsComponentRegistrar::UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile)
332{
333    return NS_ERROR_NOT_IMPLEMENTED;
334}
335
336/* boolean isCIDRegistered (in nsCIDRef aClass); */
337NS_IMETHODIMP nsComponentRegistrar::IsCIDRegistered(const nsCID & aClass, PRBool *_retval)
338{
339    return NS_ERROR_NOT_IMPLEMENTED;
340}
341
342/* boolean isContractIDRegistered (in string aContractID); */
343NS_IMETHODIMP nsComponentRegistrar::IsContractIDRegistered(const char *aContractID, PRBool *_retval)
344{
345    return NS_ERROR_NOT_IMPLEMENTED;
346}
347
348/* nsISimpleEnumerator enumerateCIDs (); */
349NS_IMETHODIMP nsComponentRegistrar::EnumerateCIDs(nsISimpleEnumerator **_retval)
350{
351    return NS_ERROR_NOT_IMPLEMENTED;
352}
353
354/* nsISimpleEnumerator enumerateContractIDs (); */
355NS_IMETHODIMP nsComponentRegistrar::EnumerateContractIDs(nsISimpleEnumerator **_retval)
356{
357    return NS_ERROR_NOT_IMPLEMENTED;
358}
359
360/* string CIDToContractID (in nsCIDRef aClass); */
361NS_IMETHODIMP nsComponentRegistrar::CIDToContractID(const nsCID & aClass, char **_retval)
362{
363    return NS_ERROR_NOT_IMPLEMENTED;
364}
365
366/* nsCIDPtr contractIDToCID (in string aContractID); */
367NS_IMETHODIMP nsComponentRegistrar::ContractIDToCID(const char *aContractID, nsCID * *_retval)
368{
369    return NS_ERROR_NOT_IMPLEMENTED;
370}
371
372/* End of implementation class template. */
373#endif
374
375
376#endif /* __gen_nsIComponentRegistrar_h__ */