home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 December / PCWorld_2006-12_cd.bin / komunikace / netscape / nsb-install-8-1-2.exe / components / nsJSAimOdirEntry.js < prev    next >
Text File  |  2006-01-06  |  2KB  |  51 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 = compMgr.QueryInterface(Components.interfaces.nsIComponentManagerObsolete);
  13.         compMgr.registerComponentWithType(this.myCID,
  14.                                           "nsJSAimOdirEntry",
  15.                                           "@netscape.com/js/aim/odirentry;1",
  16.                                           fileSpec, location, true, true, 
  17.                                           type);
  18.     },
  19.  
  20.     getClassObject: function (compMgr, cid, iid) {
  21.         if (!cid.equals(this.myCID))
  22.             throw Components.results.NS_ERROR_NO_INTERFACE;
  23.         
  24.         if (!iid.equals(Components.interfaces.nsIFactory))
  25.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  26.  
  27.         return this.myFactory;
  28.     },
  29.  
  30.     canUnload: function () {
  31.     },
  32.     
  33.     myCID: Components.ID("{95A3F539-C85F-11d3-B9FF-0010833594E9}"),
  34.     
  35.     myFactory: {
  36.         createInstance: function (outer, iid) {
  37.             if (outer != null)
  38.                 throw Components.results.NS_ERROR_NO_AGGREGATION;
  39.             
  40.             if (!(iid.equals(Components.interfaces.nsIAimOdirEntry) ||
  41.                   iid.equals(Components.interfaces.nsISupports))) {
  42.                 throw Components.results.NS_ERROR_INVALID_ARG;
  43.             }
  44.  
  45.             return new nsJSAimOdirEntry();
  46.         }
  47.     }
  48. };
  49.  
  50. function NSGetModule(compMgr, fileSpec) { return module; }
  51.