Visit Mozilla.org

nsIPrompt

From MDC

nsIPrompt is the prompt interface which can be used without knowledge of a parent window. The parentage is hidden by the GetInterface though which it is gotten.

Note: This interface is identical to nsIPromptService but without the parent nsIDOMWindow parameter. To avoid redundancy, all methods here link to nsIPromptService. If you are using this interface, you must remove the nsIDOMWindow arguments from those methods.

Accesskeys can be attached to buttons and checkboxes by inserting an & before the accesskey character. For a real &, use && instead.

Contents

nsIPrompt is defined in netwerk/base/public/nsIPrompt.idl. It is scriptable and unfrozen (hasn't changed since 1.8).

Inherits from: nsISupports

[edit] Method overview

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);

[edit] Button Flags

The button flags defined in nsIPrompt are the same as those defined in nsIPromptService. Example usage is also documented: Using the button Flags