--- title: nsIPrompt slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIPrompt translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIPrompt ---
GetInterface though which it is obtained.
nsISupports
最后修改于Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)nsIPromptService,只是没有parent nsIDOMWindow这个参数.为了避免重复的文档,下面的所有方法都链接到了nsIPromptService.如果你准备使用这个接口,一定要删除那些方法中的nsIDOMWindow参数.Normally you would use the prompt service as it is more flexible, but sometimes a callback will request an nsIPrompt via nsIInterfaceRequestor.getInterface(). To get an instance, call the nsIWindowWatcher.getNewPrompter().
void alert(in wstring dialogTitle, in wstring text); |
void alertCheck(in wstring dialogTitle, in wstring text, in wstring checkMsg, inout boolean checkValue); |
boolean confirm(in wstring dialogTitle, in wstring text); |
boolean confirmCheck(in wstring dialogTitle, in wstring text, in wstring checkMsg, inout boolean checkValue); |
PRInt32 confirmEx(in wstring dialogTitle, in wstring text, in unsigned long buttonFlags, in wstring button0Title, in wstring button1Title, in wstring button2Title, in wstring checkMsg, inout boolean checkValue); |
boolean prompt(in wstring dialogTitle, in wstring text, inout wstring value, in wstring checkMsg, inout boolean checkValue); |
boolean promptPassword(in wstring dialogTitle, in wstring text, inout wstring password, in wstring checkMsg, inout boolean checkValue); |
boolean promptUsernameAndPassword(in wstring dialogTitle, in wstring text, inout wstring username, inout wstring password, in wstring checkMsg, inout boolean checkValue); |
boolean select(in wstring dialogTitle, in wstring text, in PRUint32 count, [array, size_is(count)] in wstring selectList, out long outSelection); |
nsIPrompt中的按钮标识同样等同于nsIPromptService.Constants中定义的那些.示例代码可以在这里找到: 使用按钮标识