Package org.gnome.webkit
Interface Download.DecideDestinationCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
Download
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface Download.DecideDestinationCallback
extends FunctionPointer
Functional interface declaration of the
DecideDestinationCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
This signal is emitted after response is received to decide a destination for the download using webkit_download_set_destination().default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment sourceDownload, MemorySegment suggestedFilename) Theupcall
method is called from native code.
-
Method Details
-
run
This signal is emitted after response is received to decide a destination for the download using webkit_download_set_destination(). If this signal is not handled, the file will be downloaded toUserDirectory.DIRECTORY_DOWNLOAD
directory usingsuggestedFilename
.Since 2.40, you may handle this signal asynchronously by returning
true
without calling webkit_download_set_destination(). This indicates intent to eventually call webkit_download_set_destination(). In this case, the download will not proceed until the destination is set or cancelled with webkit_download_cancel(). -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(java.lang.String)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-