All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.web.IWebView.kt Maven / Gradle / Ivy

There is a newer version: 1.9.40-alpha04
Show newest version
package web

/**
 * Created By Kevin Zou On 2023/9/5
 */

interface IWebView {
    /**
     * True when the web view is able to navigate backwards, false otherwise.
     */
    fun canGoBack(): Boolean

    /**
     * True when the web view is able to navigate forwards, false otherwise.
     */
    fun canGoForward(): Boolean

    fun loadUrl(url: String, additionalHttpHeaders: Map = emptyMap())

    fun loadHtml(
        html: String? = null,
        baseUrl: String? = null,
        mimeType: String? = null,
        encoding: String? = "utf-8",
        historyUrl: String? = null
    )

    fun postUrl(
        url: String,
        postData: ByteArray
    )

    /**
     * Navigates the webview back to the previous page.
     */
    fun goBack()

    /**
     * Navigates the webview forward after going back from a page.
     */
    fun goForward()

    /**
     * Reloads the current page in the webview.
     */
    fun reload()

    /**
     * Stops the current page load (if one is loading).
     */
    fun stopLoading()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy