Termux:GUI C/C++ Bindings
Loading...
Searching...
No Matches
webview.h File Reference

This file contains all functions related to WebViews. More...

#include "types.h"

Go to the source code of this file.

Functions

tgui_err tgui_webview_allow_javascript (tgui_connection c, tgui_activity a, tgui_view v, bool allow)
 Sets whether Javascript execution is allowed in a WebView. The user is asked for confirmation to enable. More...
 
tgui_err tgui_webview_allow_content_uri (tgui_connection c, tgui_activity a, tgui_view v, bool allow)
 Sets whether the WebView is allowed to load content URIs. More...
 
tgui_err tgui_webview_set_data (tgui_connection c, tgui_activity a, tgui_view v, const char *data, const char *mime)
 Sets the displayed data of a WebView. More...
 
tgui_err tgui_webview_load_uri (tgui_connection c, tgui_activity a, tgui_view v, const char *uri)
 Loads content from a URI. More...
 
tgui_err tgui_webview_allow_navigation (tgui_connection c, tgui_activity a, tgui_view v, bool allow)
 By default the user cannot navigate to other pages in the WebView. This can enable navigation. More...
 
tgui_err tgui_webview_go_back (tgui_connection c, tgui_activity a, tgui_view v)
 Goes back to the last page. More...
 
tgui_err tgui_webview_go_forward (tgui_connection c, tgui_activity a, tgui_view v)
 Goes forward to the next page. More...
 
tgui_err tgui_webview_eval_js (tgui_connection c, tgui_activity a, tgui_view v, const char *source)
 Allows you to execute Javascript inside the WebView. More...
 

Detailed Description

This file contains all functions related to WebViews.

Function Documentation

◆ tgui_webview_allow_javascript()

tgui_err tgui_webview_allow_javascript ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  allow 
)

Sets whether Javascript execution is allowed in a WebView. The user is asked for confirmation to enable.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
allowWhether to enable or disable Javascript execution.
Returns
The error code.

◆ tgui_webview_allow_content_uri()

tgui_err tgui_webview_allow_content_uri ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  allow 
)

Sets whether the WebView is allowed to load content URIs.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
allowWhether to enable or disable content:// URIs.
Returns
The error code.

◆ tgui_webview_set_data()

tgui_err tgui_webview_set_data ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
const char *  data,
const char *  mime 
)

Sets the displayed data of a WebView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
dataThe data as a base64 encoded string.
mimeThe MIME type of the data. Usually "text/html".
Returns
The error code.

◆ tgui_webview_load_uri()

tgui_err tgui_webview_load_uri ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
const char *  uri 
)

Loads content from a URI.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
uriThe URI to load.
Returns
The error code.

◆ tgui_webview_allow_navigation()

tgui_err tgui_webview_allow_navigation ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  allow 
)

By default the user cannot navigate to other pages in the WebView. This can enable navigation.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
allowWhether to enable or disable navigation by the user.
Returns
The error code.

◆ tgui_webview_go_back()

tgui_err tgui_webview_go_back ( tgui_connection  c,
tgui_activity  a,
tgui_view  v 
)

Goes back to the last page.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
Returns
The error code.

◆ tgui_webview_go_forward()

tgui_err tgui_webview_go_forward ( tgui_connection  c,
tgui_activity  a,
tgui_view  v 
)

Goes forward to the next page.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
Returns
The error code.

◆ tgui_webview_eval_js()

tgui_err tgui_webview_eval_js ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
const char *  source 
)

Allows you to execute Javascript inside the WebView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe WebView id.
sourceThe Javascript source you want to execute.
Returns
The error code.