/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Part of BUTTON_NONE. This is not a button flag. It protects callers from // unwittingly creating buttonless dialogs, since they must be manually // dismissed by code. See BUTTON_NONE. constunsignedlong BUTTON_NONE_ENABLE_BIT = 1 << 28;
// Indicates whether a prompt should be shown in-content, on tab level or as a separate window constunsignedlong MODAL_TYPE_CONTENT = 1; constunsignedlong MODAL_TYPE_TAB = 2; constunsignedlong MODAL_TYPE_WINDOW = 3; // Like MODAL_TYPE_WINDOW, but shown inside a parent window (with similar // styles as _TAB and _CONTENT types) rather than as a new window: constunsignedlong MODAL_TYPE_INTERNAL_WINDOW = 4;
/** *Putsupadialogwithupto3buttonsandanoptional,labeledcheckbox. * *@paramaParent *Theparentwindowornull. *@paramaDialogTitle *Texttoappearinthetitleofthedialog. *@paramaText *Texttoappearinthebodyofthedialog. *@paramaButtonFlags *AcombinationofButtonFlags. *@paramaButton0Title *Usedwhenbutton0usesTITLE_IS_STRING *@paramaButton1Title *Usedwhenbutton1usesTITLE_IS_STRING *@paramaButton2Title *Usedwhenbutton2usesTITLE_IS_STRING *@paramaCheckMsg *Texttoappearwiththecheckbox.Nullifnocheckbox. *@paramaCheckState *Containstheinitialcheckedstateofthecheckboxwhenthismethod *iscalledandthefinalcheckedstateafterthismethodreturns. * *@returnindexofthebuttonpressed. * *Buttonsarenumbered0-2.Theimplementationcandecidewhetherthe *sequencegoesfromrighttoleftorlefttoright.Button0isthe *defaultbuttonunlessoneoftheButtonDefaultFlagsisspecified. * *Abuttonmayuseapredefinedtitle,specifiedbyoneoftheButtonTitle *Flagsvalues.Eachtitlevaluecanbemultipliedbyapositionvalueto *assignthetitletoaparticularbutton.IfBUTTON_TITLE_IS_STRINGis *usedforabutton,thestringparameterforthatbuttonwillbeused.If *thevalueforabuttonpositioniszero,thebuttonwillnotbeshown. *Notethatbutton0willthrowanexceptionifhiddenthisway.Clients *mustuseBUTTON_NONEiftheywishtohideallbuttons. * *Ingeneral,aButtonFlagsisconstructedperthefollowingexample: * *aButtonFlags=(BUTTON_POS_0)*(BUTTON_TITLE_AAA)| *(BUTTON_POS_1)*(BUTTON_TITLE_BBB)| *BUTTON_POS_1_DEFAULT; * *where"AAA"and"BBB"correspondtooneofthebuttontitles. *Someoldercodeuses'+'insteadof'|'forconstructingflags.Please *use'|'forthis,asshownhere.
*/
int32_t confirmEx(in mozIDOMWindowProxy aParent,
in wstring aDialogTitle,
in wstring aText,
in unsignedlong aButtonFlags,
in wstring aButton0Title,
in wstring aButton1Title,
in wstring aButton2Title,
in wstring aCheckMsg,
inout boolean aCheckState); /** *LikeconfirmEx,butwithaBrowsingContextasparent. * *@paramaBrowsingContext *Thebrowsingcontextthepromptshouldbeopenedfor. *@parammodalType *Whetherthepromptshouldbewindow,taborcontentmodal.
*/
int32_t confirmExBC(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
in unsignedlong aButtonFlags,
in wstring aButton0Title,
in wstring aButton1Title,
in wstring aButton2Title,
in wstring aCheckMsg,
inout boolean aCheckState); /** *AsyncversionofconfirmExBC * *@returnApromisewhichresolveswhenthepromptisdismissed. * *@resolvesnsIPropertyBag{checked:boolean,buttonNumClicked:int}
*/
Promise asyncConfirmEx(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
in unsignedlong aButtonFlags,
in wstring aButton0Title,
in wstring aButton1Title,
in wstring aButton2Title,
in wstring aCheckMsg,
in boolean aCheckState,
[optional] in jsval aExtraArgs); /** *Putsupadialogwithaneditfieldandanoptional,labeledcheckbox. * *@paramaParent *Theparentwindowornull. *@paramaDialogTitle *Texttoappearinthetitleofthedialog. *@paramaText *Texttoappearinthebodyofthedialog. *@paramaValue *Containsthedefaultvalueforthedialogfieldwhenthismethod *iscalled(nullvalueisok).Uponreturn,iftheuserpressed *OK,thenthisparametercontainsanewlyallocatedstringvalue. *Otherwise,theparameter'svalueisunmodified. *@paramaCheckMsg *Texttoappearwiththecheckbox.Ifnull,checkboxwillnotbeshown. *@paramaCheckState *Containstheinitialcheckedstateofthecheckboxwhenthismethod *iscalledandthefinalcheckedstateafterthismethodreturns. * *@returntrueforOK,falseforCancel.
*/
boolean prompt(in mozIDOMWindowProxy aParent,
in wstring aDialogTitle,
in wstring aText,
inout wstring aValue,
in wstring aCheckMsg,
inout boolean aCheckState); /** *Likeprompt,butwithaBrowsingContextasparent. * *@paramaBrowsingContext *Thebrowsingcontextthepromptshouldbeopenedfor. *@parammodalType *Whetherthepromptshouldbewindow,taborcontentmodal.
*/
boolean promptBC(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
inout wstring aValue,
in wstring aCheckMsg,
inout boolean aCheckState); /** *AsyncversionofpromptBC * *@returnApromisewhichresolveswhenthepromptisdismissed. * *@resolvesnsIPropertyBag{checked:boolean,value:string,ok:boolean}
*/
Promise asyncPrompt(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
in wstring aValue,
in wstring aCheckMsg,
in boolean aCheckState);
/** *Putsupadialogwithaneditfieldandapasswordfield. * *@paramaParent *Theparentwindowornull. *@paramaDialogTitle *Texttoappearinthetitleofthedialog. *@paramaText *Texttoappearinthebodyofthedialog. *@paramaUsername *Containsthedefaultvaluefortheusernamefieldwhenthismethod *iscalled(nullvalueisok).Uponreturn,iftheuserpressedOK, *thenthisparametercontainsanewlyallocatedstringvalue. *Otherwise,theparameter'svalueisunmodified. *@paramaPassword *Containsthedefaultvalueforthepasswordfieldwhenthismethod *iscalled(nullvalueisok).Uponreturn,iftheuserpressedOK, *thenthisparametercontainsanewlyallocatedstringvalue. *Otherwise,theparameter'svalueisunmodified. * *@returntrueforOK,falseforCancel.
*/
boolean promptUsernameAndPassword(in mozIDOMWindowProxy aParent,
in wstring aDialogTitle,
in wstring aText,
inout wstring aUsername,
inout wstring aPassword); /** *LikepromptUsernameAndPassword,butwithaBrowsingContextasparent. * *@paramaBrowsingContext *Thebrowsingcontextthepromptshouldbeopenedfor. *@parammodalType *Whetherthepromptshouldbewindow,taborcontentmodal.
*/
boolean promptUsernameAndPasswordBC(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
inout wstring aUsername,
inout wstring aPassword); /** *AsyncversionofpromptUsernameAndPasswordBC * *@returnApromisewhichresolveswhenthepromptisdismissed. * *@resolvesnsIPropertyBag{user:string,pass:string,ok:boolean}
*/
Promise asyncPromptUsernameAndPassword(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
in wstring aUsername,
in wstring aPassword);
/** *Putsupadialogwithapasswordfield. * *@paramaParent *Theparentwindowornull. *@paramaDialogTitle *Texttoappearinthetitleofthedialog. *@paramaText *Texttoappearinthebodyofthedialog. *@paramaPassword *Containsthedefaultvalueforthepasswordfieldwhenthismethod *iscalled(nullvalueisok).Uponreturn,iftheuserpressedOK, *thenthisparametercontainsanewlyallocatedstringvalue. *Otherwise,theparameter'svalueisunmodified. * *@returntrueforOK,falseforCancel.
*/
boolean promptPassword(in mozIDOMWindowProxy aParent,
in wstring aDialogTitle,
in wstring aText,
inout wstring aPassword); /** *LikepromptPassword,butwithaBrowsingContextasparent. * *@paramaBrowsingContext *Thebrowsingcontextthepromptshouldbeopenedfor. *@parammodalType *Whetherthepromptshouldbewindow,taborcontentmodal.
*/
boolean promptPasswordBC(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
inout wstring aPassword); /** *AsyncversionofpromptPasswordBC * *@returnApromisewhichresolveswhenthepromptisdismissed. * *@resolvesnsIPropertyBag{pass:string,ok:boolean}
*/
Promise asyncPromptPassword(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
in wstring aPassword); /** *Putsupadialogboxwhichhasalistboxofstringsfromwhichtheuser *maymakeasingleselection. * *@paramaParent *Theparentwindowornull. *@paramaDialogTitle *Texttoappearinthetitleofthedialog. *@paramaText *Texttoappearinthebodyofthedialog. *@paramaSelectList *Thelistofstringstodisplay. *@paramaOutSelection *Containstheindexoftheselectediteminthelistwhenthis *methodreturnstrue. * *@returntrueforOK,falseforCancel.
*/
boolean select(in mozIDOMWindowProxy aParent,
in wstring aDialogTitle,
in wstring aText,
in Array<AString> aSelectList,
out long aOutSelection); /** *Likeselect,butwithaBrowsingContextasparent. * *@paramaBrowsingContext *Thebrowsingcontextthepromptshouldbeopenedfor. *@parammodalType *Whetherthepromptshouldbewindow,taborcontentmodal.
*/
boolean selectBC(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
in Array<AString> aSelectList,
out long aOutSelection); /** *AsyncversionofselectBC * *@returnApromisewhichresolveswhenthepromptisdismissed. * *@resolvesnsIPropertyBag{selected:int,ok:boolean}
*/
Promise asyncSelect(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in wstring aDialogTitle,
in wstring aText,
in Array<AString> aSelectList);
// NOTE: These functions differ from their nsIAuthPrompt counterparts by // having additional checkbox parameters // // See nsIAuthPrompt2 for documentation on the semantics of the other // parameters.
boolean promptAuth(in mozIDOMWindowProxy aParent,
in nsIChannel aChannel,
in uint32_t level,
in nsIAuthInformation authInfo); /** *LikepromptAuth,butwithaBrowsingContextasparent. * *@paramaBrowsingContext *Thebrowsingcontextthepromptshouldbeopenedfor. *@parammodalType *Whetherthepromptshouldbewindow,taborcontentmodal.
*/
boolean promptAuthBC(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in nsIChannel aChannel,
in uint32_t level,
in nsIAuthInformation authInfo); /** *AsyncversionofpromptAuthBC * *@returnApromisewhichresolveswhenthepromptisdismissed. * *@resolvesnsIPropertyBag{ok:boolean}
*/
Promise asyncPromptAuth(in BrowsingContext aBrowsingContext,
in unsignedlong modalType,
in nsIChannel aChannel,
in uint32_t level,
in nsIAuthInformation authInfo);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.