Sailfish Webview
API DocumentationUserPromptInterface QML Type
A component which defines the base interface for all user interaction popups More...
Import Statement: | import Sailfish.WebView.Popups 1.0 |
Inherited By: | AlertPopupInterface, AuthPopupInterface, ConfirmPopupInterface, LocationPopupInterface, PromptPopupInterface, and SelectorPopupInterface |
Properties
- acceptText : string
- cancelText : string
- preventDialogsPrefillValue : bool
- preventDialogsValue : bool
- preventDialogsVisible : bool
- title : string
Signals
Detailed Description
The UserPromptInterface
QML type is exposed through the Sailfish.WebView.Popups
QML import namespace.
Clients do not need to extend this type directly, but instead should extend one of the interaction-type specific interface types.
See also custompopups.
Property Documentation
The key of the text to display for the acceptance action, if applicable
The possible keys that may be provided are as follows:
- "OK"
- "Cancel"
- "Yes"
- "No"
- "Save"
- "DontSave"
- "Revert"
- "AcceptLogin"
- "" (empty string)
For example, in a confirmation popup with "OK" and "Cancel" options, an acceptText of "OK" will be passed. The label on the accept button should be a suitable translation for this.
Apart from "AcceptLogin", these keys are from the commonDialogs.properties gecko localization file. You can search the Firefox Pontoon localization database for this file, followed by the appropriate key for appropriate translations.
It is up to the implementation to provide suitable translations; the gecko translation keys should not be used directly.
The possible keys may change with future engine updates.
The key of the text to display for the rejection action, if applicable
The possible keys that may be provided are as follows:
- "OK"
- "Cancel"
- "Yes"
- "No"
- "Save"
- "DontSave"
- "Revert"
- "" (empty string)
For example, in a confirmation popup with "OK" and "Cancel" options, a cancelText of "Cancel" will be passed. The label on the cancel button should be a suitable translation for this.
These keys are from the commonDialogs.properties gecko localization file. You can search the Firefox Pontoon localization database for this file, followed by the appropriate key for appropriate translations.
It is up to the implementation to provide suitable translations; the gecko translation keys should not be used directly.
The possible keys may change with future engine updates.
Whether the toggle switch shown in the prompt which allows the user to prevent this site from showing popups in future should be prefilled to the value true or false
A custom implementation should bind the checked
property of their toggle switch to the value of this property.
The output value which is read by the popups opener, telling it whether the user wanted to prevent the site from opening further popups of this type in future
A custom implementation should bind this property to the checked
property of their toggle switch.
It is an output property, whose value is read by the web view.
Whether the prompt should include a toggle switch allowing the user to prevent this site from showing popups in future
A custom implementation should bind the visible
property of their toggle switch to the value of this property.
The text to display as the title of the prompt
A custom implementation should bind the text
property of their header or title label to the value of this property.
Signal Documentation
This signal is emitted by the popup if the user accepts the prompt
If the custom implementation provides an acceptance action (e.g. a button or navigation action which the user can trigger to allow the site to access the data, or confirm the action) it must emit this signal when the user triggers that action.
After emitting this signal, the popup should perform an appropriate transition to make itself invisible and non-interactable (e.g. for an item-derived popup, an animated opacity transition, and then setting visible
to false
once the animation is complete).
This signal is emitted by the popup if the user rejects the prompt
If the custom implementation provides a rejection action (e.g. a button or navigation action which the user can trigger to disallow the site to access the data, or deny the action) it must emit this signal when the user triggers that action.
After emitting this signal, the popup should perform an appropriate transition to make itself invisible and non-interactable (e.g. for an item-derived popup, an animated opacity transition, and then setting visible
to false
once the animation is complete).