mashTapeManager.js
Go to the documentation of this file.
1 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
2 Components.utils.import("resource://app/jsmodules/sbLibraryUtils.jsm");
3 Components.utils.import("resource://app/jsmodules/sbProperties.jsm");
4 
5 const Cc = Components.classes;
6 const Ci = Components.interfaces;
7 const Cr = Components.results;
8 
9 const DESCRIPTION = "mashTape Manager";
10 const CID = "{066D6E67-39FE-429B-80D8-99A1CEFF3934}";
11 const CONTRACTID = "@songbirdnest.com/mashTape/manager;1";
12 
13 function mashTapeManager() {
14  this.wrappedJSObject = this;
15  this._listeners = [];
16 }
17 
18 
26 mashTapeManager.prototype.constructor = mashTapeManager;
27 mashTapeManager.prototype = {
29  classID: Components.ID(CID),
31  QueryInterface: XPCOMUtils.generateQI([Ci.sbIMashTapeManager]),
32 
33  addListener : function(aListener) {
34  if (!(aListener instanceof Ci.sbIMashTapeListener))
35  throw Components.results.NS_ERROR_INVALID_ARG;
36 
37  if (this._listeners.indexOf(aListener) == -1) {
38  this._listeners.push(aListener);
39  }
40  },
41 
42  removeListener : function(aListener) {
43  var idx = this._listeners.indexOf(aListener);
44  if (idx > -1)
45  this._listeners.splice(idx, 1);
46  },
47 
48  updateInfo : function(section, data) {
49  try {
50  this._listeners.forEach( function (listener) {
51  listener.onInfoUpdated(section, data);
52  });
53  } catch (e) {
54  dump("Error calling listener.onInfoUpdated: " + e + "\n");
55  }
56  },
57 
58  updatePhotos : function(photos, photoCount) {
59  try {
60  this._listeners.forEach( function (listener) {
61  listener.onPhotosUpdated(photos, photoCount);
62  });
63  } catch (e) {
64  dump("Error calling listener.onPhotosUpdated: " + e + "\n");
65  }
66  }
67 }
68 
70 function NSGetModule(compMgr, fileSpec) {
71  return XPCOMUtils.generateModule([mashTapeManager]);
72 }
73 
const Cr
const Ci
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
const CID
sbOSDControlService prototype QueryInterface
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
Manager class for mashTape.
function NSGetModule(compMgr, fileSpec)
const Cc
const DESCRIPTION
function mashTapeManager()
const CONTRACTID
if(DEBUG_DATAREMOTES)
sbDeviceFirmwareAutoCheckForUpdate prototype classID
observe data
Definition: FeedWriter.js:1329
window addListener("unload", function(){window.removeListener("unload", arguments.callee);document.purge();if(Browser.Engine.trident){CollectGarbage();}})