Files
OrcaSlicer/src/slic3r/GUI/Widgets/WebView.hpp
T
Ian Chua 9ab0178dd0 feat: add orcacloud to homepage (#16402)
* feat: add orcacloud to homepage

* feat: add OrcaCloud webview pane and session handoff from the app

* feat: OrcaCloud pane crash, per-open re-sign-in, and web-session persistence

* fix: clang-tidy
2026-10-15 01:01:25 +08:00

41 lines
1.3 KiB
C++

#ifndef slic3r_GUI_WebView_hpp_
#define slic3r_GUI_WebView_hpp_
#include <wx/string.h>
#include <wx/setup.h>
#include <wx/webview.h>
#include <wx/event.h>
class wxWebView;
class wxWindow;
wxDECLARE_EVENT(EVT_WEBVIEW_RECREATED, wxCommandEvent);
class WebView
{
public:
static wxWebView *CreateWebView(wxWindow *parent, wxString const &url);
#if wxUSE_WEBVIEW_EDGE
static bool CheckWebViewRuntime();
static bool DownloadAndInstallWebViewRuntime();
#endif
static void LoadUrl(wxWebView * webView, wxString const &url);
// Returns the URL truncated at the first '?' or '#', so a query/fragment carrying secrets
// (e.g. a session-handoff token) is never written to a log.
static wxString RedactUrl(const wxString& url);
static bool RunScript(wxWebView * webView, wxString const & msg);
// Marks "wx" as registered so CreateWebView's deferred add skips the duplicate.
static void MarkScriptMessageHandlerAdded(wxWebView * webView);
// On Windows, a WebView2 backend created during a GUI rebuild (language switch) can come up
// ignoring every navigation. A panel that gets true here recreates its view on first Show().
static bool NeedsRecreateOnShow();
static void RecreateAll();
};
#endif // !slic3r_GUI_WebView_hpp_