Mercurial > projects > dwt-mac
comparison 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 |
comparison
equal
deleted
inserted
replaced
124:540fa4e9974a | 125:5583f8eeee6c |
---|---|
1 /* ***** BEGIN LICENSE BLOCK ***** | |
2 * Version: MPL 1.1 | |
3 * | |
4 * The contents of this file are subject to the Mozilla Public License Version | |
5 * 1.1 (the "License"); you may not use this file except in compliance with | |
6 * the License. You may obtain a copy of the License at | |
7 * http://www.mozilla.org/MPL/ | |
8 * | |
9 * Software distributed under the License is distributed on an "AS IS" basis, | |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
11 * for the specific language governing rights and limitations under the | |
12 * License. | |
13 * | |
14 * The Original Code is Mozilla Communicator client code, released March 31, 1998. | |
15 * | |
16 * The Initial Developer of the Original Code is | |
17 * Netscape Communications Corporation. | |
18 * Portions created by Netscape are Copyright (C) 1998-1999 | |
19 * Netscape Communications Corporation. All Rights Reserved. | |
20 * | |
21 * Contributor(s): | |
22 * | |
23 * IBM | |
24 * - Binding to permit interfacing between Mozilla and DWT | |
25 * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. | |
26 * | |
27 * ***** END LICENSE BLOCK ***** */ | |
28 module dwt.internal.mozilla.nsIPromptService; | 1 module dwt.internal.mozilla.nsIPromptService; |
29 | 2 |
30 import dwt.dwthelper.utils; | 3 import dwt.internal.mozilla.Common; |
4 import dwt.internal.mozilla.nsID; | |
5 import dwt.internal.mozilla.nsISupports; | |
31 | 6 |
32 public class nsIPromptService extends nsISupports { | 7 import dwt.internal.mozilla.nsIDOMWindow; |
33 | 8 |
34 static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 9; | 9 const char[] NS_IPROMPTSERVICE_IID_STR = "1630c61a-325e-49ca-8759-a31b16c47aa5"; |
35 | 10 |
36 public static final String NS_IPROMPTSERVICE_IID_STR = | 11 const nsIID NS_IPROMPTSERVICE_IID= |
37 "1630c61a-325e-49ca-8759-a31b16c47aa5"; | 12 {0x1630c61a, 0x325e, 0x49ca, |
13 [ 0x87, 0x59, 0xa3, 0x1b, 0x16, 0xc4, 0x7a, 0xa5 ]}; | |
38 | 14 |
39 public static final nsID NS_IPROMPTSERVICE_IID = | 15 interface nsIPromptService : nsISupports { |
40 new nsID(NS_IPROMPTSERVICE_IID_STR); | |
41 | 16 |
42 public nsIPromptService(int /*long*/ address) { | 17 static const char[] IID_STR = NS_IPROMPTSERVICE_IID_STR; |
43 super(address); | 18 static const nsIID IID = NS_IPROMPTSERVICE_IID; |
44 } | |
45 | 19 |
46 public int Alert(int /*long*/ aParent, char[] aDialogTitle, char[] aText) { | 20 extern(System): |
47 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aParent, aDialogTitle, aText); | 21 nsresult Alert(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText); |
48 } | 22 nsresult AlertCheck(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar *aCheckMsg, PRBool *aCheckState); |
23 nsresult Confirm(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRBool *_retval); | |
24 nsresult ConfirmCheck(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval); | |
49 | 25 |
50 public int AlertCheck(int /*long*/ aParent, char[] aDialogTitle, char[] aText, char[] aCheckMsg, int[] aCheckState) { | 26 enum { BUTTON_POS_0 = 1U }; |
51 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aParent, aDialogTitle, aText, aCheckMsg, aCheckState); | 27 enum { BUTTON_POS_1 = 256U }; |
52 } | 28 enum { BUTTON_POS_2 = 65536U }; |
29 enum { BUTTON_TITLE_OK = 1U }; | |
30 enum { BUTTON_TITLE_CANCEL = 2U }; | |
31 enum { BUTTON_TITLE_YES = 3U }; | |
32 enum { BUTTON_TITLE_NO = 4U }; | |
33 enum { BUTTON_TITLE_SAVE = 5U }; | |
34 enum { BUTTON_TITLE_DONT_SAVE = 6U }; | |
35 enum { BUTTON_TITLE_REVERT = 7U }; | |
36 enum { BUTTON_TITLE_IS_STRING = 127U }; | |
37 enum { BUTTON_POS_0_DEFAULT = 0U }; | |
38 enum { BUTTON_POS_1_DEFAULT = 16777216U }; | |
39 enum { BUTTON_POS_2_DEFAULT = 33554432U }; | |
40 enum { BUTTON_DELAY_ENABLE = 67108864U }; | |
41 enum { STD_OK_CANCEL_BUTTONS = 513U }; | |
42 enum { STD_YES_NO_BUTTONS = 1027U }; | |
53 | 43 |
54 public int Confirm(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int[] _retval) { | 44 nsresult ConfirmEx(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUint32 aButtonFlags, PRUnichar *aButton0Title, PRUnichar *aButton1Title, PRUnichar *aButton2Title, PRUnichar *aCheckMsg, PRBool *aCheckState, PRInt32 *_retval); |
55 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aParent, aDialogTitle, aText, _retval); | 45 nsresult Prompt(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aValue, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval); |
56 } | 46 nsresult PromptUsernameAndPassword(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aUsername, PRUnichar **aPassword, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval); |
47 nsresult PromptPassword(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUnichar **aPassword, PRUnichar *aCheckMsg, PRBool *aCheckState, PRBool *_retval); | |
48 nsresult Select(nsIDOMWindow aParent, PRUnichar *aDialogTitle, PRUnichar *aText, PRUint32 aCount, PRUnichar **aSelectList, PRInt32 *aOutSelection, PRBool *_retval); | |
57 | 49 |
58 public int ConfirmCheck(int /*long*/ aParent, char[] aDialogTitle, char[] aText, char[] aCheckMsg, int[] aCheckState, int[] _retval) { | 50 } |
59 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aParent, aDialogTitle, aText, aCheckMsg, aCheckState, _retval); | |
60 } | |
61 | 51 |
62 public static final int BUTTON_POS_0 = 1; | |
63 | |
64 public static final int BUTTON_POS_1 = 256; | |
65 | |
66 public static final int BUTTON_POS_2 = 65536; | |
67 | |
68 public static final int BUTTON_TITLE_OK = 1; | |
69 | |
70 public static final int BUTTON_TITLE_CANCEL = 2; | |
71 | |
72 public static final int BUTTON_TITLE_YES = 3; | |
73 | |
74 public static final int BUTTON_TITLE_NO = 4; | |
75 | |
76 public static final int BUTTON_TITLE_SAVE = 5; | |
77 | |
78 public static final int BUTTON_TITLE_DONT_SAVE = 6; | |
79 | |
80 public static final int BUTTON_TITLE_REVERT = 7; | |
81 | |
82 public static final int BUTTON_TITLE_IS_STRING = 127; | |
83 | |
84 public static final int BUTTON_POS_0_DEFAULT = 0; | |
85 | |
86 public static final int BUTTON_POS_1_DEFAULT = 16777216; | |
87 | |
88 public static final int BUTTON_POS_2_DEFAULT = 33554432; | |
89 | |
90 public static final int BUTTON_DELAY_ENABLE = 67108864; | |
91 | |
92 public static final int STD_OK_CANCEL_BUTTONS = 513; | |
93 | |
94 public static final int STD_YES_NO_BUTTONS = 1027; | |
95 | |
96 public int ConfirmEx(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int aButtonFlags, char[] aButton0Title, char[] aButton1Title, char[] aButton2Title, char[] aCheckMsg, int[] aCheckState, int[] _retval) { | |
97 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aParent, aDialogTitle, aText, aButtonFlags, aButton0Title, aButton1Title, aButton2Title, aCheckMsg, aCheckState, _retval); | |
98 } | |
99 | |
100 public int Prompt(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int /*long*/[] aValue, char[] aCheckMsg, int[] aCheckState, int[] _retval) { | |
101 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aParent, aDialogTitle, aText, aValue, aCheckMsg, aCheckState, _retval); | |
102 } | |
103 | |
104 public int PromptUsernameAndPassword(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int /*long*/[] aUsername, int /*long*/[] aPassword, char[] aCheckMsg, int[] aCheckState, int[] _retval) { | |
105 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aParent, aDialogTitle, aText, aUsername, aPassword, aCheckMsg, aCheckState, _retval); | |
106 } | |
107 | |
108 public int PromptPassword(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int /*long*/[] aPassword, char[] aCheckMsg, int[] aCheckState, int[] _retval) { | |
109 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aParent, aDialogTitle, aText, aPassword, aCheckMsg, aCheckState, _retval); | |
110 } | |
111 | |
112 public int Select(int /*long*/ aParent, char[] aDialogTitle, char[] aText, int aCount, int /*long*/[] aSelectList, int[] aOutSelection, int[] _retval) { | |
113 return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aParent, aDialogTitle, aText, aCount, aSelectList, aOutSelection, _retval); | |
114 } | |
115 } |