1 /******************************************************************************* 2 * Copyright (c) 2003, 2007 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 * Port to the D programming language: 11 * John Reimer <terminal.node@gmail.com> 12 *******************************************************************************/ 13 module org.eclipse.swt.browser.FilePickerFactory_1_8; 14 15 import java.lang.all; 16 17 import XPCOM = org.eclipse.swt.internal.mozilla.XPCOM; 18 import org.eclipse.swt.browser.FilePickerFactory; 19 import org.eclipse.swt.browser.FilePicker_1_8; 20 21 import org.eclipse.swt.internal.mozilla.Common; 22 import org.eclipse.swt.internal.mozilla.nsID; 23 import org.eclipse.swt.internal.mozilla.nsISupports; 24 25 26 class FilePickerFactory_1_8 : FilePickerFactory { 27 28 extern(System) 29 nsresult CreateInstance (nsISupports aOuter, nsID* iid, void** result) { 30 if (result is null) 31 return XPCOM.NS_ERROR_INVALID_ARG; 32 auto picker = new FilePicker_1_8; 33 nsresult rv = picker.QueryInterface( iid, result ); 34 if (XPCOM.NS_FAILED(rv)) { 35 *result = null; 36 delete picker; 37 } 38 return rv; 39 } 40 41 }