KiCad PCB EDA Suite
Loading...
Searching...
No Matches
WEBVIEW_PANEL Class Reference

#include <webview_panel.h>

Inheritance diagram for WEBVIEW_PANEL:

Public Types

using MESSAGE_HANDLER = std::function<void( const wxString& )>
 

Public Member Functions

 WEBVIEW_PANEL (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const int style=0, TOOL_MANAGER *aToolManager=nullptr, TOOL_BASE *aTool=nullptr)
 
 ~WEBVIEW_PANEL () override
 
wxWebView * GetWebView () const
 
void LoadURL (const wxString &url)
 
void SetPage (const wxString &htmlContent)
 
bool AddMessageHandler (const wxString &name, MESSAGE_HANDLER handler)
 
void ClearMessageHandlers ()
 
void SetHandleExternalLinks (bool aHandle)
 
bool GetHandleExternalLinks () const
 
void RunScriptAsync (const wxString &aScript, void *aClientData=nullptr) const
 
bool HasLoadError () const
 
void BindLoadedEvent ()
 

Protected Member Functions

void OnNavigationRequest (wxWebViewEvent &evt)
 
void OnWebViewLoaded (wxWebViewEvent &evt)
 
void OnNewWindow (wxWebViewEvent &evt)
 
void OnScriptMessage (wxWebViewEvent &evt)
 
void OnScriptResult (wxWebViewEvent &evt)
 
void OnError (wxWebViewEvent &evt)
 

Private Attributes

bool m_initialized
 
bool m_handleExternalLinks
 
bool m_loadError
 
bool m_loadedEventBound
 
wxWebView * m_browser
 
std::map< wxString, MESSAGE_HANDLERm_msgHandlers
 
TOOL_MANAGERm_toolManager
 
TOOL_BASEm_tool
 

Detailed Description

Definition at line 31 of file webview_panel.h.

Member Typedef Documentation

◆ MESSAGE_HANDLER

using WEBVIEW_PANEL::MESSAGE_HANDLER = std::function<void( const wxString& )>

Definition at line 34 of file webview_panel.h.

Constructor & Destructor Documentation

◆ WEBVIEW_PANEL()

WEBVIEW_PANEL::WEBVIEW_PANEL ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
const int style = 0,
TOOL_MANAGER * aToolManager = nullptr,
TOOL_BASE * aTool = nullptr )
explicit

◆ ~WEBVIEW_PANEL()

WEBVIEW_PANEL::~WEBVIEW_PANEL ( )
override

Definition at line 71 of file webview_panel.cpp.

Member Function Documentation

◆ AddMessageHandler()

bool WEBVIEW_PANEL::AddMessageHandler ( const wxString & name,
MESSAGE_HANDLER handler )

Definition at line 110 of file webview_panel.cpp.

References m_browser, m_initialized, and m_msgHandlers.

◆ BindLoadedEvent()

void WEBVIEW_PANEL::BindLoadedEvent ( )

Definition at line 75 of file webview_panel.cpp.

References m_browser, m_loadedEventBound, and OnWebViewLoaded().

◆ ClearMessageHandlers()

void WEBVIEW_PANEL::ClearMessageHandlers ( )

Definition at line 132 of file webview_panel.cpp.

References m_browser, and m_msgHandlers.

◆ GetHandleExternalLinks()

bool WEBVIEW_PANEL::GetHandleExternalLinks ( ) const
inline

Definition at line 50 of file webview_panel.h.

References m_handleExternalLinks.

◆ GetWebView()

wxWebView * WEBVIEW_PANEL::GetWebView ( ) const
inline

Definition at line 41 of file webview_panel.h.

References m_browser.

◆ HasLoadError()

bool WEBVIEW_PANEL::HasLoadError ( ) const
inline

Definition at line 57 of file webview_panel.h.

References m_loadError.

◆ LoadURL()

void WEBVIEW_PANEL::LoadURL ( const wxString & url)

Definition at line 84 of file webview_panel.cpp.

References m_browser.

◆ OnError()

void WEBVIEW_PANEL::OnError ( wxWebViewEvent & evt)
protected

Definition at line 256 of file webview_panel.cpp.

References m_loadError.

Referenced by WEBVIEW_PANEL().

◆ OnNavigationRequest()

void WEBVIEW_PANEL::OnNavigationRequest ( wxWebViewEvent & evt)
protected

Definition at line 142 of file webview_panel.cpp.

References m_handleExternalLinks, and m_loadError.

Referenced by WEBVIEW_PANEL().

◆ OnNewWindow()

void WEBVIEW_PANEL::OnNewWindow ( wxWebViewEvent & evt)
protected

Definition at line 210 of file webview_panel.cpp.

References m_browser.

Referenced by WEBVIEW_PANEL().

◆ OnScriptMessage()

void WEBVIEW_PANEL::OnScriptMessage ( wxWebViewEvent & evt)
protected

Definition at line 220 of file webview_panel.cpp.

References m_msgHandlers.

Referenced by WEBVIEW_PANEL().

◆ OnScriptResult()

void WEBVIEW_PANEL::OnScriptResult ( wxWebViewEvent & evt)
protected

Definition at line 250 of file webview_panel.cpp.

Referenced by WEBVIEW_PANEL().

◆ OnWebViewLoaded()

void WEBVIEW_PANEL::OnWebViewLoaded ( wxWebViewEvent & evt)
protected

Definition at line 157 of file webview_panel.cpp.

References m_browser, m_initialized, m_msgHandlers, m_tool, and m_toolManager.

Referenced by BindLoadedEvent().

◆ RunScriptAsync()

void WEBVIEW_PANEL::RunScriptAsync ( const wxString & aScript,
void * aClientData = nullptr ) const
inline

Definition at line 52 of file webview_panel.h.

References m_browser.

◆ SetHandleExternalLinks()

void WEBVIEW_PANEL::SetHandleExternalLinks ( bool aHandle)
inline

Definition at line 49 of file webview_panel.h.

References m_handleExternalLinks.

◆ SetPage()

void WEBVIEW_PANEL::SetPage ( const wxString & htmlContent)

Definition at line 104 of file webview_panel.cpp.

References m_browser.

Member Data Documentation

◆ m_browser

wxWebView* WEBVIEW_PANEL::m_browser
private

◆ m_handleExternalLinks

bool WEBVIEW_PANEL::m_handleExternalLinks
private

◆ m_initialized

bool WEBVIEW_PANEL::m_initialized
private

Definition at line 71 of file webview_panel.h.

Referenced by AddMessageHandler(), OnWebViewLoaded(), and WEBVIEW_PANEL().

◆ m_loadedEventBound

bool WEBVIEW_PANEL::m_loadedEventBound
private

Definition at line 74 of file webview_panel.h.

Referenced by BindLoadedEvent(), and WEBVIEW_PANEL().

◆ m_loadError

bool WEBVIEW_PANEL::m_loadError
private

Definition at line 73 of file webview_panel.h.

Referenced by HasLoadError(), OnError(), OnNavigationRequest(), and WEBVIEW_PANEL().

◆ m_msgHandlers

std::map<wxString, MESSAGE_HANDLER> WEBVIEW_PANEL::m_msgHandlers
private

◆ m_tool

TOOL_BASE* WEBVIEW_PANEL::m_tool
private

Definition at line 78 of file webview_panel.h.

Referenced by OnWebViewLoaded(), and WEBVIEW_PANEL().

◆ m_toolManager

TOOL_MANAGER* WEBVIEW_PANEL::m_toolManager
private

Definition at line 77 of file webview_panel.h.

Referenced by OnWebViewLoaded(), and WEBVIEW_PANEL().


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