X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61d3188b0163c43972ad7d4d6fb745f242322618..94734b4e51431d4d4d5bccaf011b28e82515091e:/include/wx/osx/webview_webkit.h diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 5f49b43706..7fea5243a7 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -15,7 +15,8 @@ #include "wx/setup.h" -//#if wxUSE_WEBKIT && (defined(__WXMAC__) || defined(__WXCOCOA__)) +#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \ + || defined(__WXOSX_CARBON__)) #include "wx/control.h" #include "wx/webview.h" @@ -24,10 +25,7 @@ // Web Kit Control // ---------------------------------------------------------------------------- -class wxMacControl; -class wxWidgetCocoaImpl; - -class WXDLLIMPEXP_WEB wxWebViewWebKit : public wxWebView +class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView { public: wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit); @@ -50,86 +48,83 @@ public: const wxString& name = wxWebViewNameStr); virtual ~wxWebViewWebKit(); - void InternalLoadURL(const wxString &url); - - virtual bool CanGoBack(); - virtual bool CanGoForward(); + virtual bool CanGoBack() const; + virtual bool CanGoForward() const; virtual void GoBack(); virtual void GoForward(); virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); virtual void Stop(); - virtual wxString GetPageSource(); - virtual wxString GetPageText() { return ""; } - virtual void SetPageTitle(const wxString& title) { m_pageTitle = title; } - virtual wxString GetPageTitle(){ return m_pageTitle; } + virtual wxString GetPageSource() const; + virtual wxString GetPageText() const; + //We do not want to hide the other overloads + using wxWebView::SetPage; virtual void SetPage(const wxString& html, const wxString& baseUrl); virtual void Print(); - virtual void LoadUrl(const wxString& url); - virtual wxString GetCurrentURL(); - virtual wxString GetCurrentTitle(); - virtual wxWebViewZoom GetZoom(); + virtual void LoadURL(const wxString& url); + virtual wxString GetCurrentURL() const; + virtual wxString GetCurrentTitle() const; + virtual wxWebViewZoom GetZoom() const; virtual void SetZoom(wxWebViewZoom zoom); virtual void SetZoomType(wxWebViewZoomType zoomType); virtual wxWebViewZoomType GetZoomType() const; virtual bool CanSetZoomType(wxWebViewZoomType type) const; - virtual bool IsBusy() { return m_busy; } + virtual bool IsBusy() const { return m_busy; } //History functions - virtual void ClearHistory() {} - virtual void EnableHistory(bool enable = true) {} - virtual wxVector > GetBackwardHistory() - { return wxVector >(); } - virtual wxVector > GetForwardHistory() - { return wxVector >(); } - virtual void LoadHistoryItem(wxSharedPtr item) {} + virtual void ClearHistory(); + virtual void EnableHistory(bool enable = true); + virtual wxVector > GetBackwardHistory(); + virtual wxVector > GetForwardHistory(); + virtual void LoadHistoryItem(wxSharedPtr item); //Undo / redo functionality - virtual bool CanUndo() { return false; } - virtual bool CanRedo() { return false; } - virtual void Undo() {} - virtual void Redo() {} + virtual bool CanUndo() const; + virtual bool CanRedo() const; + virtual void Undo(); + virtual void Redo(); //Clipboard functions - virtual bool CanCut() { return false; } - virtual bool CanCopy() { return false; } - virtual bool CanPaste() { return false; } + virtual bool CanCut() const { return true; } + virtual bool CanCopy() const { return true; } + virtual bool CanPaste() const { return true; } virtual void Cut(); virtual void Copy(); virtual void Paste(); //Editing functions virtual void SetEditable(bool enable = true); - virtual bool IsEditable(); + virtual bool IsEditable() const; //Selection virtual void DeleteSelection(); - virtual bool HasSelection() { return false; }; - virtual void SelectAll() {}; - virtual wxString GetSelectedText(); - virtual wxString GetSelectedSource() { return ""; } - virtual void ClearSelection() {} + virtual bool HasSelection() const; + virtual void SelectAll(); + virtual wxString GetSelectedText() const; + virtual wxString GetSelectedSource() const; + virtual void ClearSelection(); void RunScript(const wxString& javascript); + + //Virtual Filesystem Support + virtual void RegisterHandler(wxSharedPtr handler); // ---- methods not from the parent (common) interface - bool CanGetPageSource(); + bool CanGetPageSource() const; void SetScrollPos(int pos); int GetScrollPos(); - wxString GetSelection(); - - bool CanIncreaseTextSize(); + bool CanIncreaseTextSize() const; void IncreaseTextSize(); - bool CanDecreaseTextSize(); + bool CanDecreaseTextSize() const; void DecreaseTextSize(); - float GetWebkitZoom(); + float GetWebkitZoom() const; void SetWebkitZoom(float zoom); // don't hide base class virtuals @@ -161,14 +156,8 @@ private: void* m_webKitCtrlEventHandler; //It should be WebView*, but WebView is an Objective-C class //TODO: look into using DECLARE_WXCOCOA_OBJC_CLASS rather than this. - -#if wxOSX_USE_CARBON - wxMacControl *m_peer; -#else - wxWidgetCocoaImpl *m_peer; -#endif }; -//#endif // wxUSE_WEBKIT +#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT #endif // _WX_WEBKIT_H_