home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 January / 01_02.iso / software / netscape62win / nim.xpi / bin / components / nsJSAimKeywords.js < prev    next >
Text File  |  2000-09-13  |  2KB  |  56 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.  
  7. function nsJSAimKeywords() {
  8.     this.keywords = new Array(0);
  9.  
  10.     this.AddKeyword = function(keyword) {
  11.         var size = this.keywords.length; 
  12.         this.keywords[size] = keyword;
  13.     }
  14. }
  15.  
  16. var module = {
  17.     registerSelf: function (compMgr, fileSpec, location, type) {
  18.         compMgr.registerComponentWithType(this.myCID,
  19.                                           "nsJSAimKeywords",
  20.                                           "@netscape.com/js/aim/keywords;1",
  21.                                           fileSpec, location, true, true, 
  22.                                           type);
  23.     },
  24.  
  25.     getClassObject: function (compMgr, cid, iid) {
  26.         if (!cid.equals(this.myCID))
  27.             throw Components.results.NS_ERROR_NO_INTERFACE;
  28.         
  29.         if (!iid.equals(Components.interfaces.nsIFactory))
  30.             throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
  31.  
  32.         return this.myFactory;
  33.     },
  34.  
  35.     canUnload: function () {
  36.     },
  37.     
  38.     myCID: Components.ID("{95A3F53C-C85F-11d3-B9FF-0010833594E9}"),
  39.     
  40.     myFactory: {
  41.         createInstance: function (outer, iid) {
  42.             if (outer != null)
  43.                 throw Components.results.NS_ERROR_NO_AGGREGATION;
  44.             
  45.             if (!(iid.equals(Components.interfaces.nsIAimKeywords) ||
  46.                   iid.equals(Components.interfaces.nsISupports))) {
  47.                 throw Components.results.NS_ERROR_INVALID_ARG;
  48.             }
  49.  
  50.             return new nsJSAimKeywords();
  51.         }
  52.     }
  53. };
  54.  
  55. function NSGetModule(compMgr, fileSpec) { return module; }
  56.