Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
Whenever the user interacts with an <input type='file' />
HTML element, WebKit will need to show a dialog to choose one or
more files to be uploaded to the server along with the rest of the
form data. For that to happen in a general way, instead of just
opening a FileChooserDialog
(which might be not desirable in
some cases, such as when an embedding applications prefers to use
its own file chooser dialog), WebKit will fire the
WebView
::run-file-chooser
signal with a
FileChooserRequest
object, which will allow the client
application to specify the files to be selected, to inspect the
details of the request (e.g. if multiple selection should be
allowed) and to cancel the request, in case nothing was selected.
In case the client application does not wish to handle this signal,
WebKit will provide a default handler which will asynchronously run
a regular FileChooserDialog
for the user to interact with.
- newtype FileChooserRequest = FileChooserRequest (ManagedPtr FileChooserRequest)
- class GObject o => IsFileChooserRequest o
- toFileChooserRequest :: IsFileChooserRequest o => o -> IO FileChooserRequest
- noFileChooserRequest :: Maybe FileChooserRequest
- data FileChooserRequestGetMimeTypesMethodInfo
- fileChooserRequestGetMimeTypes :: (HasCallStack, MonadIO m, IsFileChooserRequest a) => a -> m [Text]
- data FileChooserRequestGetMimeTypesFilterMethodInfo
- fileChooserRequestGetMimeTypesFilter :: (HasCallStack, MonadIO m, IsFileChooserRequest a) => a -> m FileFilter
- data FileChooserRequestGetSelectMultipleMethodInfo
- fileChooserRequestGetSelectMultiple :: (HasCallStack, MonadIO m, IsFileChooserRequest a) => a -> m Bool
- data FileChooserRequestGetSelectedFilesMethodInfo
- fileChooserRequestGetSelectedFiles :: (HasCallStack, MonadIO m, IsFileChooserRequest a) => a -> m [Text]
- data FileChooserRequestSelectFilesMethodInfo
- fileChooserRequestSelectFiles :: (HasCallStack, MonadIO m, IsFileChooserRequest a) => a -> [Text] -> m ()
- data FileChooserRequestFilterPropertyInfo
- fileChooserRequestFilter :: AttrLabelProxy "filter"
- getFileChooserRequestFilter :: (MonadIO m, IsFileChooserRequest o) => o -> m (Maybe FileFilter)
- data FileChooserRequestMimeTypesPropertyInfo
- fileChooserRequestMimeTypes :: AttrLabelProxy "mimeTypes"
- getFileChooserRequestMimeTypes :: (MonadIO m, IsFileChooserRequest o) => o -> m [Text]
- data FileChooserRequestSelectMultiplePropertyInfo
- fileChooserRequestSelectMultiple :: AttrLabelProxy "selectMultiple"
- getFileChooserRequestSelectMultiple :: (MonadIO m, IsFileChooserRequest o) => o -> m Bool
- data FileChooserRequestSelectedFilesPropertyInfo
- fileChooserRequestSelectedFiles :: AttrLabelProxy "selectedFiles"
- getFileChooserRequestSelectedFiles :: (MonadIO m, IsFileChooserRequest o) => o -> m [Text]
Exported types
newtype FileChooserRequest Source #
GObject FileChooserRequest Source # | |
IsObject FileChooserRequest Source # | |
IsFileChooserRequest FileChooserRequest Source # | |
((~) * info (ResolveFileChooserRequestMethod t FileChooserRequest), MethodInfo * info FileChooserRequest p) => IsLabel t (FileChooserRequest -> p) Source # | |
((~) * info (ResolveFileChooserRequestMethod t FileChooserRequest), MethodInfo * info FileChooserRequest p) => IsLabelProxy t (FileChooserRequest -> p) Source # | |
HasAttributeList * FileChooserRequest Source # | |
type AttributeList FileChooserRequest Source # | |
type SignalList FileChooserRequest Source # | |
class GObject o => IsFileChooserRequest o Source #
toFileChooserRequest :: IsFileChooserRequest o => o -> IO FileChooserRequest Source #
Methods
getMimeTypes
data FileChooserRequestGetMimeTypesMethodInfo Source #
((~) * signature (m [Text]), MonadIO m, IsFileChooserRequest a) => MethodInfo * FileChooserRequestGetMimeTypesMethodInfo a signature Source # | |
fileChooserRequestGetMimeTypes Source #
:: (HasCallStack, MonadIO m, IsFileChooserRequest a) | |
=> a |
|
-> m [Text] | Returns: a
|
Get the list of MIME types the file chooser dialog should handle, in the format specified in RFC 2046 for "media types". Its contents depend on the value of the 'accept' attribute for HTML input elements. This function should normally be called before presenting the file chooser dialog to the user, to decide whether to allow the user to select multiple files at once or only one.
Since: 1.10
getMimeTypesFilter
data FileChooserRequestGetMimeTypesFilterMethodInfo Source #
((~) * signature (m FileFilter), MonadIO m, IsFileChooserRequest a) => MethodInfo * FileChooserRequestGetMimeTypesFilterMethodInfo a signature Source # | |
fileChooserRequestGetMimeTypesFilter Source #
:: (HasCallStack, MonadIO m, IsFileChooserRequest a) | |
=> a |
|
-> m FileFilter | Returns: a |
Get the filter currently associated with the request, ready to be
used by FileChooser
. This function should normally be called
before presenting the file chooser dialog to the user, to decide
whether to apply a filter so the user would not be allowed to
select files with other MIME types.
See fileChooserRequestGetMimeTypes
if you are
interested in getting the list of accepted MIME types.
Since: 1.10
getSelectMultiple
data FileChooserRequestGetSelectMultipleMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsFileChooserRequest a) => MethodInfo * FileChooserRequestGetSelectMultipleMethodInfo a signature Source # | |
fileChooserRequestGetSelectMultiple Source #
:: (HasCallStack, MonadIO m, IsFileChooserRequest a) | |
=> a |
|
-> m Bool | Returns: |
Determine whether the file chooser associated to this
FileChooserRequest
should allow selecting multiple files,
which depends on the HTML input element having a 'multiple'
attribute defined.
Since: 1.10
getSelectedFiles
data FileChooserRequestGetSelectedFilesMethodInfo Source #
((~) * signature (m [Text]), MonadIO m, IsFileChooserRequest a) => MethodInfo * FileChooserRequestGetSelectedFilesMethodInfo a signature Source # | |
fileChooserRequestGetSelectedFiles Source #
:: (HasCallStack, MonadIO m, IsFileChooserRequest a) | |
=> a |
|
-> m [Text] | Returns: a
|
Get the list of selected files currently associated to the request. Initially, the return value of this method contains any files selected in previous file chooser requests for this HTML input element. Once webkit_file_chooser_request_select_files, the value will reflect whatever files are given.
This function should normally be called only before presenting the file chooser dialog to the user, to decide whether to perform some extra action, like pre-selecting the files from a previous request.
Since: 1.10
selectFiles
data FileChooserRequestSelectFilesMethodInfo Source #
((~) * signature ([Text] -> m ()), MonadIO m, IsFileChooserRequest a) => MethodInfo * FileChooserRequestSelectFilesMethodInfo a signature Source # | |
fileChooserRequestSelectFiles Source #
:: (HasCallStack, MonadIO m, IsFileChooserRequest a) | |
=> a |
|
-> [Text] |
|
-> m () |
Ask WebKit to select local files for upload and complete the request.
Since: 1.10
Properties
filter
data FileChooserRequestFilterPropertyInfo Source #
fileChooserRequestFilter :: AttrLabelProxy "filter" Source #
getFileChooserRequestFilter :: (MonadIO m, IsFileChooserRequest o) => o -> m (Maybe FileFilter) Source #
mimeTypes
data FileChooserRequestMimeTypesPropertyInfo Source #
fileChooserRequestMimeTypes :: AttrLabelProxy "mimeTypes" Source #
getFileChooserRequestMimeTypes :: (MonadIO m, IsFileChooserRequest o) => o -> m [Text] Source #
selectMultiple
data FileChooserRequestSelectMultiplePropertyInfo Source #
fileChooserRequestSelectMultiple :: AttrLabelProxy "selectMultiple" Source #
getFileChooserRequestSelectMultiple :: (MonadIO m, IsFileChooserRequest o) => o -> m Bool Source #
selectedFiles
data FileChooserRequestSelectedFilesPropertyInfo Source #
fileChooserRequestSelectedFiles :: AttrLabelProxy "selectedFiles" Source #
getFileChooserRequestSelectedFiles :: (MonadIO m, IsFileChooserRequest o) => o -> m [Text] Source #