+ // Factory methods allowing the use of custom factories registered with
+ // RegisterFactory
+ static wxWebView* New(const wxString& backend = wxWebViewBackendDefault);
+ static wxWebView* New(wxWindow* parent,
+ wxWindowID id,
+ const wxString& url = wxWebViewDefaultURLStr,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ const wxString& backend = wxWebViewBackendDefault,
+ long style = 0,
+ const wxString& name = wxWebViewNameStr);
+
+ static void RegisterFactory(const wxString& backend,
+ wxSharedPtr<wxWebViewFactory> factory);
+
+ // General methods
+ virtual void EnableContextMenu(bool enable = true)
+ {
+ m_showMenu = enable;
+ }
+ virtual wxString GetCurrentTitle() const = 0;
+ virtual wxString GetCurrentURL() const = 0;
+ // TODO: handle choosing a frame when calling GetPageSource()?
+ virtual wxString GetPageSource() const = 0;
+ virtual wxString GetPageText() const = 0;
+ virtual bool IsBusy() const = 0;
+ virtual bool IsContextMenuEnabled() const { return m_showMenu; }
+ virtual bool IsEditable() const = 0;
+ virtual void LoadURL(const wxString& url) = 0;
+ virtual void Print() = 0;
+ virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) = 0;
+ virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0;
+ virtual void RunScript(const wxString& javascript) = 0;
+ virtual void SetEditable(bool enable = true) = 0;
+ void SetPage(const wxString& html, const wxString& baseUrl)
+ {
+ DoSetPage(html, baseUrl);
+ }
+ void SetPage(wxInputStream& html, wxString baseUrl)
+ {
+ wxStringOutputStream stream;
+ stream.Write(html);
+ DoSetPage(stream.GetString(), baseUrl);
+ }
+ virtual void Stop() = 0;