Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::WebBrowserBase Class Reference

#include <webbrowserbase.h>

+ Inheritance diagram for inviwo::WebBrowserBase:

Public Member Functions

 WebBrowserBase (InviwoApplication *app, Processor &processor, ImageOutport &outport, ImageInport *background=nullptr, std::string_view url="", std::function< void()> onNewRender=nullptr, std::function< void(bool)> onLoadingChanged=nullptr)
 
 WebBrowserBase (const WebBrowserBase &rhs)=delete
 
 WebBrowserBase (WebBrowserBase &&rhs)=delete
 
WebBrowserBaseoperator= (const WebBrowserBase &rhs)=delete
 
WebBrowserBaseoperator= (WebBrowserBase &&rhs)=delete
 
void reload ()
 
bool isLoading () const
 
void load (const std::filesystem::path &filename)
 
void load (std::string_view url)
 
const std::string & getURL () const
 
void clear ()
 
void setZoom (double zoom)
 
void executeJavaScript (const std::string &javascript, int startLine=1)
 
InteractionHandlergetInteractionHandler ()
 
std::shared_ptr< BaseCallBack > addLoadingDoneCallback (std::function< void()> f)
 
void addMessageHandler (std::function< void(cef_log_severity_t, const CefString &, const CefString &, int)> func)
 
void addStaticHandler (std::function< bool(const std::string &, scoped_refptr< CefResourceManager::Request >)> handler)
 
void removeStaticHandler ()
 
std::shared_ptr< std::function< std::string(const std::string &)> > registerCallback (const std::string &name, std::function< std::string(const std::string &)> callback)
 

Detailed Description

Base class of a CEF based browser that renders webpages into an ImageOutport. Needs to be wrapped by a CefRefPtr<> due to reference counting.

Usage:

CefRefPtr<WebBrowserBase> my_class = new WebBrowserBase(app, processor);
Definition webbrowserbase.h:74

See https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage#markdown-header-reference-counting

Member Function Documentation

◆ addLoadingDoneCallback()

std::shared_ptr< BaseCallBack > inviwo::WebBrowserBase::addLoadingDoneCallback ( std::function< void()> f)
nodiscard

Registers a callback function f that will be called whenever the web page has been loaded.

Parameters
fcallback function
Returns
RAII callback
See also
CefLoadHandler::OnLoadingStateChange

◆ clear()

void inviwo::WebBrowserBase::clear ( )

Clear the browser frame and load an empty page

◆ setZoom()

void inviwo::WebBrowserBase::setZoom ( double zoom)

Set the zoom level of the browser to the absolute zoom factor.

Parameters
zoomabsolute zoom factor, i.e. 1.0 corresponds to a scaling of 100%

The documentation for this class was generated from the following file: