comparison dwt/browser/HelperAppLauncherDialog.d @ 348:9a4d7706df52

Test Update to fix linux XPCOM interface issues
author John Reimer <terminal.node@gmail.com>
date Fri, 31 Oct 2008 21:46:44 -0700
parents 2e591eb01162
children a3c5f744d03f
comparison
equal deleted inserted replaced
347:ff6dd48f5248 348:9a4d7706df52
40 int refCount = 0; 40 int refCount = 0;
41 41
42 this() { 42 this() {
43 } 43 }
44 44
45 extern(System)
45 nsrefcnt AddRef () { 46 nsrefcnt AddRef () {
46 refCount++; 47 refCount++;
47 return refCount; 48 return refCount;
48 } 49 }
49 50
51 extern(System)
50 nsresult QueryInterface (nsID* riid, void** ppvObject) { 52 nsresult QueryInterface (nsID* riid, void** ppvObject) {
51 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE; 53 if (riid is null || ppvObject is null) return XPCOM.NS_ERROR_NO_INTERFACE;
52 54
53 if (*riid == nsISupports.IID) { 55 if (*riid == nsISupports.IID) {
54 *ppvObject = cast(void*)cast(nsISupports)this; 56 *ppvObject = cast(void*)cast(nsISupports)this;
62 } 64 }
63 65
64 *ppvObject = null; 66 *ppvObject = null;
65 return XPCOM.NS_ERROR_NO_INTERFACE; 67 return XPCOM.NS_ERROR_NO_INTERFACE;
66 } 68 }
67 69
70 extern(System)
68 nsrefcnt Release () { 71 nsrefcnt Release () {
69 refCount--; 72 refCount--;
70 /* 73 /*
71 * Note. This instance lives as long as the download it is binded to. 74 * Note. This instance lives as long as the download it is binded to.
72 * Its reference count is expected to go down to 0 when the download 75 * Its reference count is expected to go down to 0 when the download
78 return refCount; 81 return refCount;
79 } 82 }
80 83
81 /* nsIHelperAppLauncherDialog */ 84 /* nsIHelperAppLauncherDialog */
82 85
86 extern(System)
83 nsresult Show(nsIHelperAppLauncher aLauncher, nsISupports aContext, PRUint32 aReason) { 87 nsresult Show(nsIHelperAppLauncher aLauncher, nsISupports aContext, PRUint32 aReason) {
84 /* 88 /*
85 * The interface for nsIHelperAppLauncher changed in GRE versions 1.8 and 1.9. Query for 89 * The interface for nsIHelperAppLauncher changed in GRE versions 1.8 and 1.9. Query for
86 * each of these interfaces in turn until one is found. 90 * each of these interfaces in turn until one is found.
87 */ 91 */
108 112
109 //nsIHelperAppLauncher helperAppLauncher = new nsIHelperAppLauncher (aLauncher); /* < 1.8 */ 113 //nsIHelperAppLauncher helperAppLauncher = new nsIHelperAppLauncher (aLauncher); /* < 1.8 */
110 return aLauncher.SaveToDisk (null, 0); 114 return aLauncher.SaveToDisk (null, 0);
111 } 115 }
112 116
117 extern(System)
113 nsresult PromptForSaveToFile (nsIHelperAppLauncher aLauncher, nsISupports aWindowContext, PRUnichar* aDefaultFile, PRUnichar* aSuggestedFileExtension, nsILocalFile* _retval) { 118 nsresult PromptForSaveToFile (nsIHelperAppLauncher aLauncher, nsISupports aWindowContext, PRUnichar* aDefaultFile, PRUnichar* aSuggestedFileExtension, nsILocalFile* _retval) {
114 bool hasLauncher = false; 119 bool hasLauncher = false;
115 120
116 /* 121 /*
117 * The interface for nsIHelperAppLauncherDialog changed as of mozilla 1.5 when an 122 * The interface for nsIHelperAppLauncherDialog changed as of mozilla 1.5 when an