home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hackers Magazine 57
/
CdHackersMagazineNr57.iso
/
Software
/
Copy
/
Alcohol120_trial_1.9.8.7612.exe
/
$TEMP
/
free-downloads.xpi
/
components
/
ConduitToolbar.js
< prev
next >
Wrap
Text File
|
2009-01-15
|
3KB
|
87 lines
const Cc = Components.classes;
const Ci = Components.interfaces;
const CONDUIT_TOOLBAR_COMPONENT_ID = Components.ID("{ecdee021-0d17-467f-a1ff-c7a115230949}");
function loadJSFile(strFileName, bIsFromLibrary)
{
var oFile;
if(bIsFromLibrary)
{
oFile = __LOCATION__.clone().parent.parent;
oFile.append("lib");
oFile.append(strFileName);
}
else
{
oFile = __LOCATION__.clone().parent;
oFile.append(strFileName);
}
var oFilePath = Cc["@mozilla.org/network/protocol;1?name=file"].getService(Ci.nsIFileProtocolHandler).getURLSpecFromFile(oFile);
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader).loadSubScript(oFilePath);
}
loadJSFile("xpcom.js", true);
//main component
function ConduitToolbar() {
this.wrappedJSObject = this;
this.chat = ChatXPCOM;
this.truste = TrusteXPCOM;
this.QueryInterface = function (uuid) {
if (uuid.equals(Components.interfaces.nsIConduitToolbar_CT1098640) ||
uuid.equals(Components.interfaces.nsISupports)) {
return this;
}
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
return null;
};
this.init = function(strOriginalCTID, strCurrentCTID)
{
};
}
var ConduitToolbarModule = {
registerSelf: function (compMgr, fileSpec, location, type) {
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
compMgr.registerFactoryLocation(CONDUIT_TOOLBAR_COMPONENT_ID,
"Conduit toolbar object",
"@conduit.com/toolbar;1=CT1098640",
fileSpec,
location,
type);
},
unregisterSelf: function(aCompMgr, aLocation, aLoaderStr){
},
getClassObject: function (compMgr, cid, iid) {
if (!cid.equals(CONDUIT_TOOLBAR_COMPONENT_ID))
throw Components.results.NS_ERROR_NO_INTERFACE;
if (!iid.equals(Components.interfaces.nsIFactory))
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
return ConduitToolbarFactory;
},
canUnload: function(compMgr) {
return true;
}
};
var ConduitToolbarFactory = {
createInstance: function (outer, iid) {
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
return new ConduitToolbar().QueryInterface(iid);
}
};
function NSGetModule(compMgr, fileSpec) {
return ConduitToolbarModule;
}