home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 January / 01_02.iso / software / netscape62win / nim.xpi / bin / components / nsJSAimOdirEntry.js < prev   
Text File  |  2000-09-13  |  2KB  |  50 lines

  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /*
  3.  * Probably need some copyright here! 
  4.  */
  5.  
  6. function nsJSAimOdirEntry() {
  7. }
  8.  
  9.  
  10. var module = {
  11.     registerSelf: function (compMgr, fileSpec, location, type) {
  12.         compMgr.registerComponentWithType(this.myCID,
  13.                                           "nsJSAimOdirEntry",
  14.                                           "@netscape.com/js/aim/odirentry;1",
  15.                                           fileSpec, location, true, true, 
  16.                                           type);
  17.     },
  18.  
  19.     getClassObject: function (compMgr, cid, iid) {
  20.         if (!cid.equals(this.myCID))
  21.             throw Components.results.NS_ERROR_NO_INTERFACE;
  22.         
  23.         if (!iid.equals(Components.interfaces.nsIFactory))
  24.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  25.  
  26.         return this.myFactory;
  27.     },
  28.  
  29.     canUnload: function () {
  30.     },
  31.     
  32.     myCID: Components.ID("{95A3F539-C85F-11d3-B9FF-0010833594E9}"),
  33.     
  34.     myFactory: {
  35.         createInstance: function (outer, iid) {
  36.             if (outer != null)
  37.                 throw Components.results.NS_ERROR_NO_AGGREGATION;
  38.             
  39.             if (!(iid.equals(Components.interfaces.nsIAimOdirEntry) ||
  40.                   iid.equals(Components.interfaces.nsISupports))) {
  41.                 throw Components.results.NS_ERROR_INVALID_ARG;
  42.             }
  43.  
  44.             return new nsJSAimOdirEntry();
  45.         }
  46.     }
  47. };
  48.  
  49. function NSGetModule(compMgr, fileSpec) { return module; }
  50.