1
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
3
const nsIMozvoikkoHelper = Components.interfaces.nsIMozvoikkoHelper;
4
const CLASS_ID = Components.ID("{aae2f310-dd4b-11df-937b-0800200c9a66}");
5
const CLASS_NAME = "Mozvoikko Helper";
6
const CONTRACT_ID = "@mozilla.org/mozvoikkohelper;1";
8
function MozvoikkoHelper() { }
10
MozvoikkoHelper.prototype =
12
classDescription: CLASS_NAME,
14
contracyID: CONTRACT_ID,
16
QueryInterface: XPCOMUtils.generateQI([nsIMozvoikkoHelper],
17
Components.interfaces.nsISupports),
24
return __LOCATION__.parent;
28
return __LOCATION__.parent.parent;
33
/***********************************************************
34
module definition (xpcom registration)
35
***********************************************************/
36
var MozvoikkoHelperFactory =
38
registerSelf: function(aCompMgr, aFileSpec, aLocation, aType)
41
QueryInterface(Components.interfaces.nsIComponentRegistrar);
42
aCompMgr.registerFactoryLocation(
44
CONTRACT_ID, aFileSpec, aLocation, aType);
47
unregisterSelf: function(aCompMgr, aLocation, aType)
50
QueryInterface(Components.interfaces.nsIComponentRegistrar);
51
aCompMgr.unregisterFactoryLocation(CLASS_ID, aLocation);
54
getClassObject: function(aCompMgr, aCID, aIID)
56
if (!aIID.equals(Components.interfaces.nsIFactory))
57
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
59
if (aCID.equals(CLASS_ID))
60
return this.MozvoikkoHelperFactory;
62
throw Components.results.NS_ERROR_NO_INTERFACE;
65
canUnload: function(aCompMgr)
70
/***********************************************************
73
This object is a member of the global-scope Components.classes.
74
It is keyed off of the contract ID. Eg:
76
myHelloWorld = Components.classes["@dietrich.ganx4.com/helloworld;1"].
77
createInstance(Components.interfaces.nsIHelloWorld);
79
***********************************************************/
80
MozvoikkoHelperFactory:
82
createInstance: function(aOuter, aIID)
85
throw Components.results.NS_ERROR_NO_AGGREGATION;
87
return (new MozvoikkoHelper()).QueryInterface(aIID);
93
/***********************************************************
96
When the application registers the component, this function
98
***********************************************************/
99
function NSGetModule(aCompMgr, aFileSpec)
101
return MozvoikkoHelperFactory;
105
if (typeof XPCOMUtils != "undefined")
107
if (XPCOMUtils.generateNSGetFactory) {
109
var NSGetFactory = XPCOMUtils.generateNSGetFactory([MozvoikkoHelper]);