X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36b52591b51e425b57f60e1cbed9a51d2f5767d9..7e083675342b17762735ef2223fb9d264d6fc937:/include/wx/gtk/webview_webkit.h diff --git a/include/wx/gtk/webview_webkit.h b/include/wx/gtk/webview_webkit.h index 14c7651be8..2cef91f1c6 100644 --- a/include/wx/gtk/webview_webkit.h +++ b/include/wx/gtk/webview_webkit.h @@ -12,9 +12,8 @@ #include "wx/setup.h" -#if wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) +#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) -#include "webkit/webkit.h" #include "wx/sharedptr.h" #include "wx/webview.h" @@ -22,7 +21,7 @@ // wxWebViewWebKit //----------------------------------------------------------------------------- -class WXDLLIMPEXP_WEB wxWebViewWebKit : public wxWebView +class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView { public: wxWebViewWebKit() { Init(); } @@ -54,76 +53,65 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); - // helper to allow access to protected member from GTK callback - void MoveWindow(int x, int y, int width, int height) - { - DoMoveWindow(x, y, width, height); - } - - void ZoomIn(); - void ZoomOut(); - void SetWebkitZoom(float level); - float GetWebkitZoom(); - virtual void Stop(); - virtual void LoadUrl(const wxString& url); + virtual void LoadURL(const wxString& url); virtual void GoBack(); virtual void GoForward(); virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); - virtual bool CanGoBack(); - virtual bool CanGoForward(); + virtual bool CanGoBack() const; + virtual bool CanGoForward() const; virtual void ClearHistory(); virtual void EnableHistory(bool enable = true); - virtual wxVector > GetBackwardHistory(); - virtual wxVector > GetForwardHistory(); - virtual void LoadHistoryItem(wxSharedPtr item); - virtual wxString GetCurrentURL(); - virtual wxString GetCurrentTitle(); - virtual wxString GetPageSource(); - virtual wxString GetPageText(); + virtual wxVector > GetBackwardHistory(); + virtual wxVector > GetForwardHistory(); + virtual void LoadHistoryItem(wxSharedPtr item); + virtual wxString GetCurrentURL() const; + virtual wxString GetCurrentTitle() const; + 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 bool IsBusy(); + virtual bool IsBusy() const; void SetZoomType(wxWebViewZoomType); wxWebViewZoomType GetZoomType() const; bool CanSetZoomType(wxWebViewZoomType) const; - virtual wxWebViewZoom GetZoom(); + virtual wxWebViewZoom GetZoom() const; virtual void SetZoom(wxWebViewZoom); //Clipboard functions - virtual bool CanCut(); - virtual bool CanCopy(); - virtual bool CanPaste(); + virtual bool CanCut() const; + virtual bool CanCopy() const; + virtual bool CanPaste() const; virtual void Cut(); virtual void Copy(); virtual void Paste(); //Undo / redo functionality - virtual bool CanUndo(); - virtual bool CanRedo(); + virtual bool CanUndo() const; + virtual bool CanRedo() const; virtual void Undo(); virtual void Redo(); //Editing functions virtual void SetEditable(bool enable = true); - virtual bool IsEditable(); + virtual bool IsEditable() const; //Selection virtual void DeleteSelection(); - virtual bool HasSelection(); + virtual bool HasSelection() const; virtual void SelectAll(); - virtual wxString GetSelectedText(); - virtual wxString GetSelectedSource(); + virtual wxString GetSelectedText() const; + virtual wxString GetSelectedSource() const; virtual void ClearSelection(); virtual void RunScript(const wxString& javascript); //Virtual Filesystem Support - virtual void RegisterHandler(wxWebHandler* handler); - virtual wxVector GetHandlers() { return m_handlerList; } + virtual void RegisterHandler(wxSharedPtr handler); + virtual wxVector > GetHandlers() { return m_handlerList; } /** FIXME: hack to work around signals being received too early */ bool m_ready; @@ -137,6 +125,8 @@ public: */ bool m_busy; + wxString m_vfsurl; + //We use this flag to stop recursion when we load a page from the navigation //callback, mainly when loading a VFS page bool m_guard; @@ -147,17 +137,22 @@ protected: private: + void ZoomIn(); + void ZoomOut(); + void SetWebkitZoom(float level); + float GetWebkitZoom() const; + // focus event handler: calls GTKUpdateBitmap() void GTKOnFocus(wxFocusEvent& event); GtkWidget *web_view; - gint m_historyLimit; + int m_historyLimit; - wxVector m_handlerList; + wxVector > m_handlerList; wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit); }; -#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) +#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) #endif