WebProcess Class

The WebProcess class defines an interface between the web engine such as Gecko or Blink and a client. It needs to be compatible with the C++ language and must be able to operate any common graphical web engine.

For more information, see Web Engine Usage

If you would interface an existing web engine, see Integration Guidelines section for more informations.

Syntax

class WebProcess;
type
  WebProcess* {.bycopy.} = object

Constructors

Constructor Description
WebProcess Create a new instance of the web engine.

Member functions

Member function Description
addInterface Add a javascript interface
allowedPermissions Return a list of allowed permissions for this page
allowPermission Request the activation of a permission to the current web engine
devTools Request the access to the developper tools interface
editInterface Edit an existing javascript interface
GETParameters Return the parameters specified in the GET mode (eg. data sended through the URL)
httpCode Return the last request http code
httpHeader Return the page http header
httpsCertificate Return all https connexion informations of the security certificate
httpsState Return the https connexion state
isAllowed Check if specified permission is allowed for the current web engine
isHttps Check if the current connexion uses https instead of http
isMute Check if the song of the current page is mute
loadPage Load a new page from the specified URL
meta Get the value for a name from a meta tag
metaList Return the list of added meta tags
mute Set if the tab is mute or not
network Get the current network manager interface from the web engine
POSTParameters Return the parameters specified in the POST mode (eg. data sended through the page header)
removeInterface Remove an existing javascript interface
rule Get the value of a specified rule for the web engine
setNetwork Set an other network engine to the web engine
sourceCode Get the page source code as a string variable
setPermissions Set permissions for current web page
setRule Set a value to a specified rule for the current web engine
title Get the current page title
url Get the current page url
winId Get the window indentifier of the rendering area

Static functions

Static function Description
defaultPermissions Return the default permissions for the page

Member signals

Warning, event system such as signals and slots are not available as default in C++. However, see Event System Integration for more informations.

Member signal Description
metaChanged Sended when the meta tag list is edited
newPageRequest Sended when the web page is changed
useSound Sended if the web page emit a sound
pageEdited Sended if the page structure is changed
targetLink Sended if the web page attempt to load an URL to a new window/tab
titleChanged Sended if the title is changed

Requirements

In C++

Include: <WebEngine.hpp>

Namespace: Sielo::WebEngine

In NIM

Import: import WebEngine or from WebEngine import WebProcess

WebProcess::addInterface

Add a javascript interface

bool WebProcess::addInterface(std::string name, JSInterface interface);
proc addInterface*(this : var WebProcess, name : string, interface : JSInterface) : bool

TODO: addInterface member function

WebProcess::allowedPermissions

Return a list of allowed permissions for this page

std::vector<permissionName> WebProcess::allowedPermissions(void) const;
proc allowedPermissions*(this : var WebProcess) : vector[permissionName]

TODO: allowedPermissions member function

WebProcess::allowPermission

Request the activation of a permission to the current web engine

void WebProcess::allowPermission(permissionName permission, bool enabled);
proc allowPermission*(this : var WebProcess, permission : permissionName, enabled : bool)

TODO: allowPermission member function

WebProcess::devTools

Request the access to the developper tools interface

std::weak_ptr<webDevTools> WebProcess::devTools(void) const;
proc devTools*(this : var WebProcess) : weak_ptr[webDevTools]

TODO: devTools member function

WebProcess::editInterface

Edit an existing javascript interface

bool WebProcess::editInterface(std::string name, JSInterface interface);
proc editInterface*(this : var WebProcess, name : string, interface : JSInterface) : bool

TODO: editInterface member function

WebProcess::GETParameters

Return the parameters specified in the GET mode (eg. data sended through the URL)

std::map<std::string, std::string> WebProcess::GETParameters(void) const;
proc GETParameters*(this : var WebProcess) : map[string, string]

TODO: GETParameters member function

WebProcess::httpCode

Return the last request http code

int WebProcess::httpCode(void) const
proc httpCode*(this : var WebProcess) : cint

TODO: httpCode member function

WebProcess::httpHeader

Return the page http header

std::string WebProcess::httpHeader(void) const;
proc httpHeader*(this : var WebProcess) : string

TODO: httpHeader member function

WebProcess::httpsCertificate

Return all https connexion informations of the security certificate

httpsCertificateData WebProcess::httpsCertificate(void) const;
proc httpsCertificate*(this : var WebProcess) : httpsCertificateData

TODO: httpsCertificate member function

WebProcess::httpsState

Return the https connexion state

httpsStateCode WebProcess::httpsState(void) const;
proc httpsState*(this : var WebProcess) : httpsStateCode

TODO: httpsState member function

WebProcess::isAllowed

Check if specified permission is allowed for the current web engine

bool WebProcess::isAllowed(permissionName permission) const;
proc isAllowed*(this : var WebProcess, permission : permissionName) : bool

TODO: isAllowed member function

WebProcess::isHttps

Check if the current connexion uses https instead of http

bool WebProcess::isHttps(void) const;
proc isHttps*(this : var WebProcess) : bool

TODO: isHttps member function

WebProcess::isMute

Check if the song of the current page is mute

bool WebProcess::isMute(void) const;
proc isMute*(this : var WebProcess) : bool

TODO: isMute member function

WebProcess::loadPage

Load a new page from the specified URL

bool WebProcess::loadPage(std::string url);
proc loadPage*(this : var WebProcess, url : string) : bool

TODO: loadPage member function

WebProcess::meta

Get the value for a name from a meta tag

std::string WebProcess::meta(std::string name) const;
proc meta*(this : var WebProcess, name : string) : string

TODO: meta member function

WebProcess::metaList

Return the list of added meta tags

std::map<std::string, std::string> WebProcess::metaList(void) const;
proc metaList*(this : var WebProcess) : map[string, string]

TODO: metaList member function

WebProcess::mute

Set if the tab is mute or not

void WebProcess::mute(bool mute);
proc mute*(this : var WebProcess, mute : bool)

TODO: mute member function

WebProcess::network

Get the current network manager interface from the web engine

std::weak_ptr<networkEngine> WebProcess::network(void) const;
proc network*(this : var WebProcess) : weak_ptr[networkEngine]

TODO: network member function

WebProcess::POSTParameters

Return the parameters specified in the POST mode (eg. data sended through the page header)

std::map<std::string, std::string> WebProcess::POSTParameters(void) const;
proc POSTParameters*(this : var WebProcess) : map[string, string]

TODO: POSTParameters member function

WebProcess::removeInterface

Remove an existing javascript interface

bool WebProcess::removeInterface(std::string name);
proc removeInterface*(this : var WebProcess, name : string) : bool

TODO: removeInterface member function

WebProcess::rule

Get the value of a specified rule for the web engine

int WebProcess::rule(ruleName rule) const;
proc rule*(this : var WebProcess, rule : ruleName) : cint

TODO: rule member function

WebProcess::setNetwork

Set an other network engine to the web engine

void WebProcess::setNetwork(std::shared_ptr<networkEngine> net);
proc setNetwork*(this : var WebProcess, net : shared_ptr[networkEngine])

TODO: setNetwork member function

WebProcess::sourceCode

Get the page source code as a string variable

std::string WebProcess::sourceCode(void) const;
proc sourceCode*(this : var WebProcess) : string

TODO: sourceCode member function

WebProcess::setPermissions

Set permissions for current web page

void WebProcess::setPermissions(std::vector<permissionName> permissions, bool enabled = true);
proc setPermissions*(this : var WebProcess, permissions : vector[permissionName], enabled : bool = true)

TODO: setPermissions member function

WebProcess::setRule

Set a value to a specified rule for the current web engine

void WebProcess::setRule(ruleName rule, int value);
proc setRule*(this : var WebProcess, rule : ruleName, value : cint)

TODO: setRule member function

WebProcess::title

Get the current page title

std::string WebProcess::title(void) const;
proc title*(this : var WebProcess) : string;

TODO: title member function

WebProcess::url

Get the current page url

std::string WebProcess::url(void) const;
proc url*(this : var WebProcess) : string

TODO: url member function documentation

WebProcess::WebProcess

Create a new instance of the web engine.

WebProcess()
WebProcess(std::string url, std::vector<permissionName> permissions = WebProcess::defaultPermissions())
proc constructWebProcess*() : WebProcess
proc constructWebProcess*(url : string, permissions = defaultPermissions())

Parameters

Parameter Description
url The URL of the web page
permissions The list of permissions for the page. See permissionName section for more informations

WebProcess::winId

Get the window indentifier of the rendering area.

WId WebProcess::winId();
proc winId*(this : var WebProcess) : WId

WId return type

The WId return type is a reimplementation of the native window type for each system. It is generally a system-dependent sized integer. It can be implemented by:

typedef unsigned int WId;
type
    WId* = uint