Class WebView

Definition

Namespace:
Tizen.WebView
Assembly:
Tizen.WebView.dll
API Level:
4

A view used to render the web contents.

C#
Copy
public class WebView : EvasObject
Inheritance
System.Object
WebView

Constructors

View Source

WebView(EvasObject)

Creates a WebView object.

Declaration
C#
Copy
public WebView(EvasObject parent)
Parameters
Type Name Description
EvasObject parent

Parent object of the WebView.

API Level: 4

Properties

View Source

ContentsSize

Gets size of the content.

Declaration
C#
Copy
public Size ContentsSize { get; }
Property Value
Type Description
Size

size of the coordinate.

API Level: 6
View Source

HasFocus

Whether a view has the focus.

Declaration
C#
Copy
public bool HasFocus { get; }
Property Value
Type Description
System.Boolean
API Level: 4
View Source

LoadProgress

Gets the current load progress of the page.

Declaration
C#
Copy
public double LoadProgress { get; }
Property Value
Type Description
System.Double

'value 0.0 to 1.0' on success, otherwise '-1.0'.

API Level: 6
View Source

Scale

Gets the current scale factor of the page.

Declaration
C#
Copy
public double Scale { get; }
Property Value
Type Description
System.Double
API Level: 6
View Source

ScrollPosition

Get and Sets the scroll position of the page.

Declaration
C#
Copy
public Point ScrollPosition { get; set; }
Property Value
Type Description
Point

The class Point object with X, Y coordinates.

API Level: 6
View Source

Title

Current title of the main frame.

Declaration
C#
Copy
public string Title { get; }
Property Value
Type Description
System.String
API Level: 4
View Source

Url

Current URL of the main frame.

Declaration
C#
Copy
public string Url { get; }
Property Value
Type Description
System.String
API Level: 4
View Source

UserAgent

Current user agent string of this view.

Declaration
C#
Copy
public string UserAgent { get; set; }
Property Value
Type Description
System.String
API Level: 4

Methods

View Source

AddJavaScriptMessageHandler(String, JavaScriptMessageHandler)

Injects the supplied javascript message handler into the view.

Declaration
C#
Copy
public bool AddJavaScriptMessageHandler(string name, JavaScriptMessageHandler handler)
Parameters
Type Name Description
System.String name

The message callback.

JavaScriptMessageHandler handler

The name used to expose the object in JavaScript.

Returns
Type Description
System.Boolean

'true' on success, otherwise 'false'.

API Level: 4
View Source

CanGoBack()

Checks whether it is possible to navigate backward one item in history.

Declaration
C#
Copy
public bool CanGoBack()
Returns
Type Description
System.Boolean

Whether it is possible to navigate backward one item in history.

API Level: 4
View Source

CanGoForward()

Checks whether it is possible to navigate forward one item in history.

Declaration
C#
Copy
public bool CanGoForward()
Returns
Type Description
System.Boolean

Whether it is possible to navigate forward one item in history.

API Level: 4
View Source

ClearBackForwardList()

Clear the back/forward list object of this view.

Declaration
C#
Copy
public void ClearBackForwardList()
API Level: 6
View Source

CreateHandle(EvasObject)

Creates a widget handle.

Declaration
C#
Copy
protected override IntPtr CreateHandle(EvasObject parent)
Parameters
Type Name Description
EvasObject parent

Parent EvasObject.

Returns
Type Description
System.IntPtr

IntPtr of the widget handle.

Overrides
API Level: 4
View Source

Eval(String)

Requests the execution of the given script.

Declaration
C#
Copy
public void Eval(string script)
Parameters
Type Name Description
System.String script

The JavaScript code string to execute.

API Level: 4
View Source

EvalAsync(String)

Requests the evaluation of the given script.

Declaration
C#
Copy
public Task<string> EvalAsync(string script)
Parameters
Type Name Description
System.String script

The JavaScript code string to evaluate.

Returns
Type Description
System.Threading.Tasks.Task<System.String>

A task that contains the result of the evaluation as a string.

Exceptions
Type Condition
System.ArgumentException

Thrown when a script is null or empty string.

API Level: 8
View Source

EvalWithResult(String, String)

Requests the execution of a given name and the result to the JavaScript runtime.

Declaration
C#
Copy
public void EvalWithResult(string name, string result)
Parameters
Type Name Description
System.String name

The name used to expose the object in JavaScript.

System.String result

The result to the JavaScript runtime.

API Level: 4
View Source

ExitFullscreen()

Exit full screen.

Declaration
C#
Copy
public void ExitFullscreen()
API Level: 6
View Source

FindText(String, FindOption, Int32)

Searches and highlights the given text string in the document.

Declaration
C#
Copy
public void FindText(string text, FindOption option, int maxMatchCount)
Parameters
Type Name Description
System.String text

The text to find.

FindOption option

The options to find.

System.Int32 maxMatchCount

The maximum match count to find, unlimited if 0.

API Level: 6
View Source

GetBackForwardList()

Gets the back/forward list object of this view.

Declaration
C#
Copy
public BackForwardList GetBackForwardList()
Returns
Type Description
BackForwardList

The BackForward List object of this view.

API Level: 6
View Source

GetContext()

Gets the context object of this view.

Declaration
C#
Copy
public Context GetContext()
Returns
Type Description
Context

The context object of this view.

API Level: 4
View Source

GetSettings()

Gets the settings object of this view.

Declaration
C#
Copy
public Settings GetSettings()
Returns
Type Description
Settings

The settings object of this view.

API Level: 4
View Source

GoBack()

Asks the main frame to navigate back in history.

Declaration
C#
Copy
public void GoBack()
API Level: 4
View Source

GoForward()

Asks the main frame to navigate forward in history.

Declaration
C#
Copy
public void GoForward()
API Level: 4
View Source

LoadHtml(String, String)

Loads the specified HTML string as the content of the view.

Declaration
C#
Copy
public void LoadHtml(string html, string baseUrl)
Parameters
Type Name Description
System.String html

HTML data to load.

System.String baseUrl

Base URL used for relative paths to external objects.

API Level: 4
View Source

LoadUrl(String)

Asks the object to load the given URL.

Declaration
C#
Copy
public void LoadUrl(string url)
Parameters
Type Name Description
System.String url

The uniform resource identifier to load.

Remarks

You can only be sure that the URL changes after UrlChanged event.

API Level: 4
View Source

Reload()

Asks the main frame to reload the current document.

Declaration
C#
Copy
public void Reload()
API Level: 4
View Source

Resume()

Resumes the operation associated with the view.

Declaration
C#
Copy
public void Resume()
API Level: 6
View Source

ScrollBy(Point)

Scrolls the webpage by the given amount.

Declaration
C#
Copy
public void ScrollBy(Point delta)
Parameters
Type Name Description
Point delta

The class Point object with X, Y coordinates.

API Level: 6
View Source

SendOrientation(Orientation)

Sends the orientation of the device.

Declaration
C#
Copy
public void SendOrientation(Orientation orientation)
Parameters
Type Name Description
Orientation orientation

The new orientation of the device in degree.

API Level: 6
View Source

SetContextMenuCustomizeDelegate(WebView.ContextMenuCustomize)

Sets the delegate for context menu customization.

Declaration
C#
Copy
public void SetContextMenuCustomizeDelegate(WebView.ContextMenuCustomize contextMenuCustomizeDelegate)
Parameters
Type Name Description
WebView.ContextMenuCustomize contextMenuCustomizeDelegate

The delegate for context menu customization.

API Level: 6
View Source

SetFocus(Boolean)

Requests to set or unset a view as the currently focused one.

Declaration
C#
Copy
public void SetFocus(bool focused)
Parameters
Type Name Description
System.Boolean focused

'true' to set the focus on the view, 'false' to remove the focus from the view.

API Level: 4
View Source

SetScale(Double, Point)

Sets the current scale factor of the page.

Declaration
C#
Copy
public void SetScale(double scaleFactor, Point scrollTo)
Parameters
Type Name Description
System.Double scaleFactor

A new level to set.

Point scrollTo

The class Point object with X, Y coordinates.

API Level: 6
View Source

SetUrlRequest(String, HttpMethod, IDictionary<String, String>, String)

Requests loading of the given request data.

Declaration
C#
Copy
public void SetUrlRequest(string url, HttpMethod httpMethod, IDictionary<string, string> httpHeaders, string httpBody)
Parameters
Type Name Description
System.String url

The uniform resource identifier to load.

HttpMethod httpMethod

The http method.

System.Collections.Generic.IDictionary<System.String, System.String> httpHeaders

The http headers.

System.String httpBody

The http body data.

API Level: 6
View Source

SetViewVisibility(Boolean)

Sets the current page's visibility.

Declaration
C#
Copy
public void SetViewVisibility(bool enable)
Parameters
Type Name Description
System.Boolean enable

'true' to set on the visibility of the page, 'false' otherwise.

API Level: 6
View Source

StopLoading()

Asks the main frame to stop loading.

Declaration
C#
Copy
public void StopLoading()
API Level: 4
View Source

Suspend()

Suspends the operation associated with the view.

Declaration
C#
Copy
public void Suspend()
API Level: 6

Events

View Source

ContextMenuItemSelected

Event that occurs when the context menu item selected.

Declaration
C#
Copy
public event EventHandler<ContextMenuItemEventArgs> ContextMenuItemSelected
Event Type
Type Description
System.EventHandler<ContextMenuItemEventArgs>
API Level: 6
View Source

LoadError

Event that occurs when the load throws an error.

Declaration
C#
Copy
public event EventHandler<SmartCallbackLoadErrorArgs> LoadError
Event Type
Type Description
System.EventHandler<SmartCallbackLoadErrorArgs>
API Level: 4
View Source

LoadFinished

Event that occurs when the load is finished.

Declaration
C#
Copy
public event EventHandler LoadFinished
Event Type
Type Description
System.EventHandler
API Level: 4
View Source

LoadStarted

Event that occurs when the load is started.

Declaration
C#
Copy
public event EventHandler LoadStarted
Event Type
Type Description
System.EventHandler
API Level: 4
View Source

NavigationPolicyDecideRequested

Event that occurs when the policy navigation is decided.

Declaration
C#
Copy
public event EventHandler<NavigationPolicyEventArgs> NavigationPolicyDecideRequested
Event Type
Type Description
System.EventHandler<NavigationPolicyEventArgs>
API Level: 6
View Source

NewWindowPolicyDecideRequested

Event that occurs when the policy new window is decided.

Declaration
C#
Copy
public event EventHandler<NewWindowPolicyEventArgs> NewWindowPolicyDecideRequested
Event Type
Type Description
System.EventHandler<NewWindowPolicyEventArgs>
API Level: 6
View Source

ResponsePolicyDecideRequested

Event that occurs when the policy response is decided.

Declaration
C#
Copy
public event EventHandler<ResponsePolicyEventArgs> ResponsePolicyDecideRequested
Event Type
Type Description
System.EventHandler<ResponsePolicyEventArgs>
API Level: 6
View Source

TitleChanged

Event that occurs when the title of the main frame is changed.

Declaration
C#
Copy
public event EventHandler<SmartCallbackArgs> TitleChanged
Event Type
Type Description
System.EventHandler<SmartCallbackArgs>
API Level: 4
View Source

UrlChanged

Event that occurs when the URL of the main frame is changed.

Declaration
C#
Copy
public event EventHandler<SmartCallbackArgs> UrlChanged
Event Type
Type Description
System.EventHandler<SmartCallbackArgs>
API Level: 4

Extension Methods