aboutsummaryrefslogtreecommitdiff
path: root/chrome/code/xpcom.js
blob: a98343371a5f55224b951f3a1861a2ebe05529be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var EXPORTED_SYMBOLS = [
'Ci', 'Cc', 'Cr', 'ServerSocket', 'ScriptableInputStream', 'FileInputStream', 'ConverterInputStream', 'LocalFile'];

Ci = Components.interfaces;
Cc = Components.classes;
Cr = Components.results;

const ServerSocket = Components.Constructor("@mozilla.org/network/server-socket;1", "nsIServerSocket", "init");
const ScriptableInputStream = Components.Constructor("@mozilla.org/scriptableinputstream;1", "nsIScriptableInputStream", "init");
const FileInputStream = Components.Constructor("@mozilla.org/network/file-input-stream;1", "nsIFileInputStream", "init");
const ConverterInputStream = Components.Constructor("@mozilla.org/intl/converter-input-stream;1", "nsIConverterInputStream", "init");
const LocalFile = Components.Constructor("@mozilla.org/file/local;1", "nsILocalFile", "initWithPath");
                          
function Service(className, interfaceName) 
	return Cc[className].getService(Ci[interfaceName]);
}

const PromptService = Service("@mozilla.org/embedcomp/prompt-service;1","nsIPromptService");
const IOService = Service("@mozilla.org/network/io-service;1","nsIIOService");