diff dwt/internal/mozilla/nsIPromptService.d @ 125:5583f8eeee6c

Synced mozilla with dwt-linux
author Jacob Carlborg <doob@me.com>
date Fri, 16 Jan 2009 12:49:08 +0100
parents d8635bb48c7c
children
line wrap: on
line diff
--- a/dwt/internal/mozilla/nsIPromptService.d	Fri Jan 16 12:19:08 2009 +0100
+++ b/dwt/internal/mozilla/nsIPromptService.d	Fri Jan 16 12:49:08 2009 +0100
@@ -1,115 +1,51 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by Netscape are Copyright (C) 1998-1999
- * Netscape Communications Corporation.  All Rights Reserved.
- *
- * Contributor(s):
- *
- * IBM
- * -  Binding to permit interfacing between Mozilla and DWT
- * -  Copyright (C) 2003, 2008 IBM Corp.  All Rights Reserved.
- *
- * ***** END LICENSE BLOCK ***** */
 module dwt.internal.mozilla.nsIPromptService;
 
-import dwt.dwthelper.utils;
-
-public class nsIPromptService extends nsISupports {
-
-    static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 9;
-
-    public static final String NS_IPROMPTSERVICE_IID_STR =
-        "1630c61a-325e-49ca-8759-a31b16c47aa5";
+import dwt.internal.mozilla.Common;
+import dwt.internal.mozilla.nsID;
+import dwt.internal.mozilla.nsISupports;
 
-    public static final nsID NS_IPROMPTSERVICE_IID =
-        new nsID(NS_IPROMPTSERVICE_IID_STR);
+import dwt.internal.mozilla.nsIDOMWindow;
 
-    public nsIPromptService(int /*long*/ address) {
-        super(address);
-    }
-
-    public int Alert(int /*long*/ aParent, char[] aDialogTitle, char[] aText) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aParent, aDialogTitle, aText);
-    }
+const char[] NS_IPROMPTSERVICE_IID_STR = "1630c61a-325e-49ca-8759-a31b16c47aa5";
 
-    public int AlertCheck(int /*long*/ aParent, char[] aDialogTitle, char[] aText, char[] aCheckMsg, int[] aCheckState) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aParent, aDialogTitle, aText, aCheckMsg, aCheckState);
-    }
+const nsIID NS_IPROMPTSERVICE_IID= 
+  {0x1630c61a, 0x325e, 0x49ca, 
+    [ 0x87, 0x59, 0xa3, 0x1b, 0x16, 0xc4, 0x7a, 0xa5 ]};
 
-    public int Confirm(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int[] _retval) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aParent, aDialogTitle, aText, _retval);
-    }
+interface nsIPromptService : nsISupports {
 
-    public int ConfirmCheck(int /*long*/ aParent, char[] aDialogTitle, char[] aText, char[] aCheckMsg, int[] aCheckState, int[] _retval) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aParent, aDialogTitle, aText, aCheckMsg, aCheckState, _retval);
-    }
-
-    public static final int BUTTON_POS_0 = 1;
+  static const char[] IID_STR = NS_IPROMPTSERVICE_IID_STR;
+  static const nsIID IID = NS_IPROMPTSERVICE_IID;
 
-    public static final int BUTTON_POS_1 = 256;
-
-    public static final int BUTTON_POS_2 = 65536;
-
-    public static final int BUTTON_TITLE_OK = 1;
-
-    public static final int BUTTON_TITLE_CANCEL = 2;
+extern(System):
+  nsresult Alert(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText);
+  nsresult AlertCheck(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar *aCheckMsg, PRBool *aCheckState);
+  nsresult Confirm(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRBool *_retval);
+  nsresult ConfirmCheck(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
 
-    public static final int BUTTON_TITLE_YES = 3;
-
-    public static final int BUTTON_TITLE_NO = 4;
-
-    public static final int BUTTON_TITLE_SAVE = 5;
-
-    public static final int BUTTON_TITLE_DONT_SAVE = 6;
-
-    public static final int BUTTON_TITLE_REVERT = 7;
-
-    public static final int BUTTON_TITLE_IS_STRING = 127;
-
-    public static final int BUTTON_POS_0_DEFAULT = 0;
-
-    public static final int BUTTON_POS_1_DEFAULT = 16777216;
-
-    public static final int BUTTON_POS_2_DEFAULT = 33554432;
-
-    public static final int BUTTON_DELAY_ENABLE = 67108864;
-
-    public static final int STD_OK_CANCEL_BUTTONS = 513;
+  enum { BUTTON_POS_0 = 1U };
+  enum { BUTTON_POS_1 = 256U };
+  enum { BUTTON_POS_2 = 65536U };
+  enum { BUTTON_TITLE_OK = 1U };
+  enum { BUTTON_TITLE_CANCEL = 2U };
+  enum { BUTTON_TITLE_YES = 3U };
+  enum { BUTTON_TITLE_NO = 4U };
+  enum { BUTTON_TITLE_SAVE = 5U };
+  enum { BUTTON_TITLE_DONT_SAVE = 6U };
+  enum { BUTTON_TITLE_REVERT = 7U };
+  enum { BUTTON_TITLE_IS_STRING = 127U };
+  enum { BUTTON_POS_0_DEFAULT = 0U };
+  enum { BUTTON_POS_1_DEFAULT = 16777216U };
+  enum { BUTTON_POS_2_DEFAULT = 33554432U };
+  enum { BUTTON_DELAY_ENABLE = 67108864U };
+  enum { STD_OK_CANCEL_BUTTONS = 513U };
+  enum { STD_YES_NO_BUTTONS = 1027U };
 
-    public static final int STD_YES_NO_BUTTONS = 1027;
-    
-    public int ConfirmEx(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int aButtonFlags, char[] aButton0Title, char[] aButton1Title, char[] aButton2Title, char[] aCheckMsg, int[] aCheckState, int[] _retval) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState, _retval);
-    }
-
-    public int Prompt(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int /*long*/[] aValue, char[] aCheckMsg, int[] aCheckState, int[] _retval) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState, _retval);
-    }
+  nsresult ConfirmEx(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUint32 aButtonFlags, PRUnichar *aButton0Title, PRUnichar *aButton1Title, PRUnichar *aButton2Title, PRUnichar *aCheckMsg, PRBool *aCheckState, PRInt32 *_retval);
+  nsresult Prompt(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aValue, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
+  nsresult PromptUsernameAndPassword(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aUsername, PRUnichar **aPassword, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
+  nsresult PromptPassword(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aPassword, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval);
+  nsresult Select(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUint32 aCount, PRUnichar **aSelectList, PRInt32 *aOutSelection, PRBool *_retval);
 
-    public int PromptUsernameAndPassword(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int /*long*/[] aUsername, int /*long*/[] aPassword, char[] aCheckMsg, int[] aCheckState, int[] _retval) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState, _retval);
-    }
+}
 
-    public int PromptPassword(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int /*long*/[] aPassword, char[] aCheckMsg, int[] aCheckState, int[] _retval) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState, _retval);
-    }
-
-    public int Select(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int aCount, int /*long*/[] aSelectList, int[] aOutSelection, int[] _retval) {
-        return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection, _retval);
-    }
-}