Struct xpcom::interfaces::nsIPromptService
[−]
[src]
#[repr(C)]pub struct nsIPromptService { /* fields omitted */ }
interface nsIPromptService : nsISupports
/**
* This is the interface to the embeddable prompt service; the service that
* implements nsIPrompt. Its interface is designed to be just nsIPrompt, each
* method modified to take a parent window parameter.
*
* Accesskeys can be attached to buttons and checkboxes by inserting an &
* before the accesskey character in the checkbox message or button title. For
* a real &, use && instead. (A "button title" generally refers to the text
* label of a button.)
*
* One note: in all cases, the parent window parameter can be null. However,
* these windows are all intended to have parents. So when no parent is
* specified, the implementation should try hard to find a suitable foster
* parent.
*
* Implementations are free to choose how they present the various button
* types. For example, while prompts that give the user a choice between OK
* and Cancel are required to return a boolean value indicating whether or not
* the user accepted the prompt (pressed OK) or rejected the prompt (pressed
* Cancel), the implementation of this interface could very well speak the
* prompt to the user instead of rendering any visual user-interface. The
* standard button types are merely idioms used to convey the nature of the
* choice the user is to make.
*
* Because implementations of this interface may loosely interpret the various
* button types, it is advised that text messages passed to these prompts do
* not refer to the button types by name. For example, it is inadvisable to
* tell the user to "Press OK to proceed." Instead, such a prompt might be
* rewritten to ask the user: "Would you like to proceed?"
*/
Methods
impl nsIPromptService
[src]
pub fn coerce<T: nsIPromptServiceCoerce>(&self) -> &T
[src]
Cast this nsIPromptService
to one of its base interfaces.
impl nsIPromptService
[src]
pub const BUTTON_POS_0: i64
BUTTON_POS_0: i64 = 1
/**
* Button Flags
*
* The following flags are combined to form the aButtonFlags parameter passed
* to confirmEx. See confirmEx for more information on how the flags may be
* combined.
*/
/**
* Button Position Flags
*/
pub const BUTTON_POS_1: i64
BUTTON_POS_1: i64 = 256
pub const BUTTON_POS_2: i64
BUTTON_POS_2: i64 = 65536
pub const BUTTON_TITLE_OK: i64
BUTTON_TITLE_OK: i64 = 1
/**
* Button Title Flags (used to set the labels of buttons in the prompt)
*/
pub const BUTTON_TITLE_CANCEL: i64
BUTTON_TITLE_CANCEL: i64 = 2
pub const BUTTON_TITLE_YES: i64
BUTTON_TITLE_YES: i64 = 3
pub const BUTTON_TITLE_NO: i64
BUTTON_TITLE_NO: i64 = 4
pub const BUTTON_TITLE_SAVE: i64
BUTTON_TITLE_SAVE: i64 = 5
pub const BUTTON_TITLE_DONT_SAVE: i64
BUTTON_TITLE_DONT_SAVE: i64 = 6
pub const BUTTON_TITLE_REVERT: i64
BUTTON_TITLE_REVERT: i64 = 7
pub const BUTTON_TITLE_IS_STRING: i64
BUTTON_TITLE_IS_STRING: i64 = 127
pub const BUTTON_POS_0_DEFAULT: i64
BUTTON_POS_0_DEFAULT: i64 = 0
/**
* Button Default Flags (used to select which button is the default one)
*/
pub const BUTTON_POS_1_DEFAULT: i64
BUTTON_POS_1_DEFAULT: i64 = 16777216
pub const BUTTON_POS_2_DEFAULT: i64
BUTTON_POS_2_DEFAULT: i64 = 33554432
pub const BUTTON_DELAY_ENABLE: i64
BUTTON_DELAY_ENABLE: i64 = 67108864
/**
* Causes the buttons to be initially disabled. They are enabled after a
* timeout expires. The implementation may interpret this loosely as the
* intent is to ensure that the user does not click through a security dialog
* too quickly. Strictly speaking, the implementation could choose to ignore
* this flag.
*/
pub const STD_OK_CANCEL_BUTTONS: i64
STD_OK_CANCEL_BUTTONS: i64 = 513
/**
* Selects the standard set of OK/Cancel buttons.
*/
pub const STD_YES_NO_BUTTONS: i64
STD_YES_NO_BUTTONS: i64 = 1027
/**
* Selects the standard set of Yes/No buttons.
*/
pub unsafe fn Alert(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t
) -> nsresult
/**
* Puts up an alert dialog with an OK button.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
*/
void alert (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText);
pub unsafe fn AlertCheck(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool
) -> nsresult
/**
* Puts up an alert dialog with an OK button and a labeled checkbox.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
* @param aCheckMsg
* Text to appear with the checkbox.
* @param aCheckState
* Contains the initial checked state of the checkbox when this method
* is called and the final checked state after this method returns.
*/
void alertCheck (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText, in wstring aCheckMsg, inout boolean aCheckState);
pub unsafe fn Confirm(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
_retval: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
_retval: *mut bool
) -> nsresult
/**
* Puts up a dialog with OK and Cancel buttons.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
*
* @return true for OK, false for Cancel
*/
boolean confirm (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText);
pub unsafe fn ConfirmCheck(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
/**
* Puts up a dialog with OK and Cancel buttons and a labeled checkbox.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
* @param aCheckMsg
* Text to appear with the checkbox.
* @param aCheckState
* Contains the initial checked state of the checkbox when this method
* is called and the final checked state after this method returns.
*
* @return true for OK, false for Cancel
*/
boolean confirmCheck (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText, in wstring aCheckMsg, inout boolean aCheckState);
pub unsafe fn ConfirmEx(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aButtonFlags: uint32_t,
aButton0Title: *const int16_t,
aButton1Title: *const int16_t,
aButton2Title: *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut int32_t
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aButtonFlags: uint32_t,
aButton0Title: *const int16_t,
aButton1Title: *const int16_t,
aButton2Title: *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut int32_t
) -> nsresult
/**
* Puts up a dialog with up to 3 buttons and an optional, labeled checkbox.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
* @param aButtonFlags
* A combination of Button Flags.
* @param aButton0Title
* Used when button 0 uses TITLE_IS_STRING
* @param aButton1Title
* Used when button 1 uses TITLE_IS_STRING
* @param aButton2Title
* Used when button 2 uses TITLE_IS_STRING
* @param aCheckMsg
* Text to appear with the checkbox. Null if no checkbox.
* @param aCheckState
* Contains the initial checked state of the checkbox when this method
* is called and the final checked state after this method returns.
*
* @return index of the button pressed.
*
* Buttons are numbered 0 - 2. The implementation can decide whether the
* sequence goes from right to left or left to right. Button 0 is the
* default button unless one of the Button Default Flags is specified.
*
* A button may use a predefined title, specified by one of the Button Title
* Flags values. Each title value can be multiplied by a position value to
* assign the title to a particular button. If BUTTON_TITLE_IS_STRING is
* used for a button, the string parameter for that button will be used. If
* the value for a button position is zero, the button will not be shown.
*
* In general, aButtonFlags is constructed per the following example:
*
* aButtonFlags = (BUTTON_POS_0) * (BUTTON_TITLE_AAA) +
* (BUTTON_POS_1) * (BUTTON_TITLE_BBB) +
* BUTTON_POS_1_DEFAULT;
*
* where "AAA" and "BBB" correspond to one of the button titles.
*/
int32_t confirmEx (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText, in unsigned long aButtonFlags, in wstring aButton0Title, in wstring aButton1Title, in wstring aButton2Title, in wstring aCheckMsg, inout boolean aCheckState);
pub unsafe fn Prompt(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aValue: *mut *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aValue: *mut *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
/**
* Puts up a dialog with an edit field and an optional, labeled checkbox.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
* @param aValue
* Contains the default value for the dialog field when this method
* is called (null value is ok). Upon return, if the user pressed
* OK, then this parameter contains a newly allocated string value.
* Otherwise, the parameter's value is unmodified.
* @param aCheckMsg
* Text to appear with the checkbox. If null, check box will not be shown.
* @param aCheckState
* Contains the initial checked state of the checkbox when this method
* is called and the final checked state after this method returns.
*
* @return true for OK, false for Cancel.
*/
boolean prompt (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText, inout wstring aValue, in wstring aCheckMsg, inout boolean aCheckState);
pub unsafe fn PromptUsernameAndPassword(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aUsername: *mut *const int16_t,
aPassword: *mut *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aUsername: *mut *const int16_t,
aPassword: *mut *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
/**
* Puts up a dialog with an edit field, a password field, and an optional,
* labeled checkbox.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
* @param aUsername
* Contains the default value for the username field when this method
* is called (null value is ok). Upon return, if the user pressed OK,
* then this parameter contains a newly allocated string value.
* Otherwise, the parameter's value is unmodified.
* @param aPassword
* Contains the default value for the password field when this method
* is called (null value is ok). Upon return, if the user pressed OK,
* then this parameter contains a newly allocated string value.
* Otherwise, the parameter's value is unmodified.
* @param aCheckMsg
* Text to appear with the checkbox. If null, check box will not be shown.
* @param aCheckState
* Contains the initial checked state of the checkbox when this method
* is called and the final checked state after this method returns.
*
* @return true for OK, false for Cancel.
*/
boolean promptUsernameAndPassword (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText, inout wstring aUsername, inout wstring aPassword, in wstring aCheckMsg, inout boolean aCheckState);
pub unsafe fn PromptPassword(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aPassword: *mut *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aPassword: *mut *const int16_t,
aCheckMsg: *const int16_t,
aCheckState: *mut bool,
_retval: *mut bool
) -> nsresult
/**
* Puts up a dialog with a password field and an optional, labeled checkbox.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
* @param aPassword
* Contains the default value for the password field when this method
* is called (null value is ok). Upon return, if the user pressed OK,
* then this parameter contains a newly allocated string value.
* Otherwise, the parameter's value is unmodified.
* @param aCheckMsg
* Text to appear with the checkbox. If null, check box will not be shown.
* @param aCheckState
* Contains the initial checked state of the checkbox when this method
* is called and the final checked state after this method returns.
*
* @return true for OK, false for Cancel.
*/
boolean promptPassword (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText, inout wstring aPassword, in wstring aCheckMsg, inout boolean aCheckState);
pub unsafe fn Select(
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aCount: uint32_t,
aSelectList: *mut *const int16_t,
aOutSelection: *mut int32_t,
_retval: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aDialogTitle: *const int16_t,
aText: *const int16_t,
aCount: uint32_t,
aSelectList: *mut *const int16_t,
aOutSelection: *mut int32_t,
_retval: *mut bool
) -> nsresult
/**
* Puts up a dialog box which has a list box of strings from which the user
* may make a single selection.
*
* @param aParent
* The parent window or null.
* @param aDialogTitle
* Text to appear in the title of the dialog.
* @param aText
* Text to appear in the body of the dialog.
* @param aCount
* The length of the aSelectList array parameter.
* @param aSelectList
* The list of strings to display.
* @param aOutSelection
* Contains the index of the selected item in the list when this
* method returns true.
*
* @return true for OK, false for Cancel.
*/
boolean select (in mozIDOMWindowProxy aParent, in wstring aDialogTitle, in wstring aText, in uint32_t aCount, [array, size_is (aCount)] in wstring aSelectList, out long aOutSelection);
pub unsafe fn PromptAuth(
&self,
aParent: *const mozIDOMWindowProxy,
aChannel: *const nsIChannel,
level: uint32_t,
authInfo: *const nsIAuthInformation,
checkboxLabel: *const int16_t,
checkValue: *mut bool,
_retval: *mut bool
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aChannel: *const nsIChannel,
level: uint32_t,
authInfo: *const nsIAuthInformation,
checkboxLabel: *const int16_t,
checkValue: *mut bool,
_retval: *mut bool
) -> nsresult
boolean promptAuth (in mozIDOMWindowProxy aParent, in nsIChannel aChannel, in uint32_t level, in nsIAuthInformation authInfo, in wstring checkboxLabel, inout boolean checkValue);
pub unsafe fn AsyncPromptAuth(
&self,
aParent: *const mozIDOMWindowProxy,
aChannel: *const nsIChannel,
aCallback: *const nsIAuthPromptCallback,
aContext: *const nsISupports,
level: uint32_t,
authInfo: *const nsIAuthInformation,
checkboxLabel: *const int16_t,
checkValue: *mut bool,
_retval: *mut *const nsICancelable
) -> nsresult
[src]
&self,
aParent: *const mozIDOMWindowProxy,
aChannel: *const nsIChannel,
aCallback: *const nsIAuthPromptCallback,
aContext: *const nsISupports,
level: uint32_t,
authInfo: *const nsIAuthInformation,
checkboxLabel: *const int16_t,
checkValue: *mut bool,
_retval: *mut *const nsICancelable
) -> nsresult
nsICancelable asyncPromptAuth (in mozIDOMWindowProxy aParent, in nsIChannel aChannel, in nsIAuthPromptCallback aCallback, in nsISupports aContext, in uint32_t level, in nsIAuthInformation authInfo, in wstring checkboxLabel, inout boolean checkValue);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIPromptService
[src]
const IID: nsIID
IID: nsIID = nsID(1078902690, 55540, 19604, [132, 22, 230, 90, 85, 249, 223, 90])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIPromptService
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIPromptService
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.