nsIModule.idl 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* -*- Mode: C++; 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. #include "nsISupports.idl"
  6. interface nsIFile;
  7. interface nsIComponentManager;
  8. /**
  9. * The nsIModule interface.
  10. */
  11. [scriptable, uuid(7392D032-5371-11d3-994E-00805FD26FEE)]
  12. interface nsIModule : nsISupports
  13. {
  14. /**
  15. * Object Instance Creation
  16. *
  17. * Obtains a Class Object from a nsIModule for a given CID and IID pair.
  18. * This class object can either be query to a nsIFactory or a may be
  19. * query to a nsIClassInfo.
  20. *
  21. * @param aCompMgr : The global component manager
  22. * @param aClass : ClassID of object instance requested
  23. * @param aIID : IID of interface requested
  24. *
  25. */
  26. void getClassObject(in nsIComponentManager aCompMgr,
  27. in nsCIDRef aClass,
  28. in nsIIDRef aIID,
  29. [retval, iid_is(aIID)] out nsQIResult aResult);
  30. /**
  31. * One time registration callback
  32. *
  33. * When the nsIModule is discovered, this method will be
  34. * called so that any setup registration can be preformed.
  35. *
  36. * @param aCompMgr : The global component manager
  37. * @param aLocation : The location of the nsIModule on disk
  38. * @param aLoaderStr: Opaque loader specific string
  39. * @param aType : Loader Type being used to load this module
  40. */
  41. void registerSelf(in nsIComponentManager aCompMgr,
  42. in nsIFile aLocation,
  43. in string aLoaderStr,
  44. in string aType);
  45. /**
  46. * One time unregistration callback
  47. *
  48. * When the nsIModule is being unregistered, this method will be
  49. * called so that any unregistration can be preformed
  50. *
  51. * @param aCompMgr : The global component manager
  52. * @param aLocation : The location of the nsIModule on disk
  53. * @param aLoaderStr : Opaque loader specific string
  54. *
  55. */
  56. void unregisterSelf(in nsIComponentManager aCompMgr,
  57. in nsIFile aLocation,
  58. in string aLoaderStr);
  59. /**
  60. * Module load management
  61. *
  62. * @param aCompMgr : The global component manager
  63. *
  64. * @return indicates to the caller if the module can be unloaded.
  65. * Returning PR_TRUE isn't a guarantee that the module will be
  66. * unloaded. It constitues only willingness of the module to be
  67. * unloaded. It is very important to ensure that no outstanding
  68. * references to the module's code/data exist before returning
  69. * PR_TRUE.
  70. * Returning PR_FALSE guaratees that the module won't be unloaded.
  71. */
  72. boolean canUnload(in nsIComponentManager aCompMgr);
  73. };