X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8290e3cd91a9ff5bd7aad1e51666518701193bb0..445eaabd3ea9459fc8e8b954e68a480b237485c8:/include/wx/osx/webview_webkit.h diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index dee0a4c435..aa937a93db 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: include/wx/osx/webkit.h -// Purpose: wxOSXWebKitCtrl - embeddable web kit control, +// Purpose: wxWebViewWebKit - embeddable web kit control, // OS X implementation of web view component // Author: Jethro Grassie / Kevin Ollivier / Marianne Gagnon // Modified by: @@ -15,10 +15,8 @@ #include "wx/setup.h" -#if wxUSE_WEBKIT && (defined(__WXMAC__) || defined(__WXCOCOA__)) - -// TODO: define this in setup.h ? -#define wxHAVE_WEB_BACKEND_OSX_WEBKIT 1 +#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \ + || defined(__WXOSX_CARBON__)) #include "wx/control.h" #include "wx/webview.h" @@ -27,13 +25,13 @@ // Web Kit Control // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_WEB wxOSXWebKitCtrl : public wxWebView +class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView { public: - wxDECLARE_DYNAMIC_CLASS(wxOSXWebKitCtrl); + wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit); - wxOSXWebKitCtrl() {} - wxOSXWebKitCtrl(wxWindow *parent, + wxWebViewWebKit() {} + wxWebViewWebKit(wxWindow *parent, wxWindowID winID = wxID_ANY, const wxString& strURL = wxWebViewDefaultURLStr, const wxPoint& pos = wxDefaultPosition, @@ -48,57 +46,85 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxWebViewNameStr); - virtual ~wxOSXWebKitCtrl(); - - void InternalLoadURL(const wxString &url); + virtual ~wxWebViewWebKit(); - 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 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(); + virtual wxVector > GetForwardHistory(); + virtual void LoadHistoryItem(wxSharedPtr item); + + //Undo / redo functionality + virtual bool CanUndo() const; + virtual bool CanRedo() const; + virtual void Undo(); + virtual void Redo(); + + //Clipboard functions + 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() const; + + //Selection + virtual void DeleteSelection(); + 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 - wxString GetSelectedText(); - - wxString RunScript(const wxString& javascript); - - bool CanGetPageSource(); + bool CanGetPageSource() const; void SetScrollPos(int pos); int GetScrollPos(); - void MakeEditable(bool enable = true); - bool IsEditable(); - - 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 @@ -132,11 +158,6 @@ private: //TODO: look into using DECLARE_WXCOCOA_OBJC_CLASS rather than this. }; - -#else -// TODO: define this in setup.h ? -#define wxHAVE_WEB_BACKEND_OSX_WEBKIT 0 - -#endif // wxUSE_WEBKIT +#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT #endif // _WX_WEBKIT_H_