Top | Description | Object Hierarchy | Properties |
struct WebKitFileChooserRequest; const gchar * const * webkit_file_chooser_request_get_mime_types (WebKitFileChooserRequest *request
); GtkFileFilter * webkit_file_chooser_request_get_mime_types_filter (WebKitFileChooserRequest *request
); gboolean webkit_file_chooser_request_get_select_multiple (WebKitFileChooserRequest *request
); void webkit_file_chooser_request_select_files (WebKitFileChooserRequest *request
,const gchar * const *files
); const gchar * const * webkit_file_chooser_request_get_selected_files (WebKitFileChooserRequest *request
); void webkit_file_chooser_request_cancel (WebKitFileChooserRequest *request
);
"filter" GtkFileFilter* : Read "mime-types" GStrv : Read "select-multiple" gboolean : Read "selected-files" GStrv : Read
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 GtkFileChooserDialog (which might be not desirable in some cases, which could prefer to use their own file chooser dialog), WebKit will fire the "run-file-chooser" signal with a WebKitFileChooserRequest 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 GtkFileChooserDialog for the user to interact with.
const gchar * const * webkit_file_chooser_request_get_mime_types
(WebKitFileChooserRequest *request
);
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.
|
a WebKitFileChooserRequest |
Returns : |
a
NULL -terminated array of strings if a list of accepted MIME types
is defined or NULL otherwise, meaning that any MIME type should be
accepted. This array and its contents are owned by WebKitGTK+ and
should not be modified or freed. [array zero-terminated=1][transfer none]
|
GtkFileFilter * webkit_file_chooser_request_get_mime_types_filter
(WebKitFileChooserRequest *request
);
Get the filter currently associated with the request, ready to be used by GtkFileChooser. 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 webkit_file_chooser_request_get_mime_types()
if you are
interested in getting the list of accepted MIME types.
|
a WebKitFileChooserRequest |
Returns : |
a GtkFileFilter if a list of accepted
MIME types is defined or NULL otherwise. The returned object is
owned by WebKitGTK+ should not be modified or freed. [transfer none]
|
gboolean webkit_file_chooser_request_get_select_multiple
(WebKitFileChooserRequest *request
);
Determine whether the file chooser associated to this WebKitFileChooserRequest should allow selecting multiple files, which depends on the HTML input element having a 'multiple' attribute defined.
|
a WebKitFileChooserRequest |
Returns : |
TRUE if the file chooser should allow selecting multiple files or FALSE otherwise. |
void webkit_file_chooser_request_select_files (WebKitFileChooserRequest *request
,const gchar * const *files
);
Ask WebKit to select local files for upload and complete the request.
|
a WebKitFileChooserRequest |
|
a
NULL -terminated array of strings, containing paths to local files. [array zero-terminated=1][transfer none]
|
const gchar * const * webkit_file_chooser_request_get_selected_files
(WebKitFileChooserRequest *request
);
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.
|
a WebKitFileChooserRequest |
Returns : |
a
NULL -terminated array of strings if there are selected files
associated with the request or NULL otherwise. This array and its
contents are owned by WebKitGTK+ and should not be modified or
freed. [array zero-terminated=1][transfer none]
|
void webkit_file_chooser_request_cancel (WebKitFileChooserRequest *request
);
Ask WebKit to cancel the request. It's important to do this in case no selection has been made in the client, otherwise the request won't be properly completed and the browser will keep the request pending forever, which might cause the browser to hang.
|
a WebKitFileChooserRequest |
"filter"
property"filter" GtkFileFilter* : Read
The filter currently associated with the request. See
webkit_file_chooser_request_get_mime_types_filter()
for more
details.
"mime-types"
property"mime-types" GStrv : Read
A NULL
-terminated array of strings containing the list of MIME
types the file chooser dialog should handle. See
webkit_file_chooser_request_get_mime_types()
for more details.
"select-multiple"
property"select-multiple" gboolean : Read
Whether the file chooser should allow selecting multiple
files. See
webkit_file_chooser_request_get_select_multiple()
for
more details.
Default value: FALSE
"selected-files"
property"selected-files" GStrv : Read
A NULL
-terminated array of strings containing the list of
selected files associated to the current request. See
webkit_file_chooser_request_get_selected_files()
for more details.