X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19fc1a2f0d8523e8d31b40e7b83a058faacc20c2..c6ea1fdaf924be4ee49a19d12f76e4fcd257bb0a:/include/wx/gtk/webview_webkit.h diff --git a/include/wx/gtk/webview_webkit.h b/include/wx/gtk/webview_webkit.h index 54d5a3f762..9d3c500c0a 100644 --- a/include/wx/gtk/webview_webkit.h +++ b/include/wx/gtk/webview_webkit.h @@ -12,42 +12,12 @@ #include "wx/setup.h" -#if wxUSE_WEBVIEW_WEBKIT +#if wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) #include "webkit/webkit.h" #include "wx/sharedptr.h" #include "wx/webview.h" -//A set of hash function so we can map wxWebHistoryItems to WebKitWebHistoryItems -class SharedPtrHash -{ -public: - SharedPtrHash() { } - - unsigned long operator()( const wxSharedPtr & item ) const - { - - return wxPointerHash()(item.get()); - } - SharedPtrHash& operator=(const SharedPtrHash&) { return *this; } -}; - -class SharedPtrEqual -{ -public: - SharedPtrEqual() { } - bool operator()( const wxSharedPtr & a, - const wxSharedPtr & b ) const - { - return wxPointerEqual()(a.get(), b.get()); - } - - SharedPtrEqual& operator=(const SharedPtrEqual&) { return *this; } -}; - -WX_DECLARE_HASH_MAP(wxSharedPtr, WebKitWebHistoryItem*, - SharedPtrHash, SharedPtrEqual, HistoryItemHash); - //----------------------------------------------------------------------------- // wxWebViewWebKit //----------------------------------------------------------------------------- @@ -110,6 +80,9 @@ public: virtual wxString GetCurrentURL(); virtual wxString GetCurrentTitle(); virtual wxString GetPageSource(); + virtual wxString GetPageText(); + //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(); @@ -120,7 +93,37 @@ public: virtual wxWebViewZoom GetZoom(); virtual void SetZoom(wxWebViewZoom); - + //Clipboard functions + virtual bool CanCut(); + virtual bool CanCopy(); + virtual bool CanPaste(); + virtual void Cut(); + virtual void Copy(); + virtual void Paste(); + + //Undo / redo functionality + virtual bool CanUndo(); + virtual bool CanRedo(); + virtual void Undo(); + virtual void Redo(); + + //Editing functions + virtual void SetEditable(bool enable = true); + virtual bool IsEditable(); + + //Selection + virtual void DeleteSelection(); + virtual bool HasSelection(); + virtual void SelectAll(); + virtual wxString GetSelectedText(); + virtual wxString GetSelectedSource(); + virtual void ClearSelection(); + + virtual void RunScript(const wxString& javascript); + + //Virtual Filesystem Support + virtual void RegisterHandler(wxWebHandler* handler); + virtual wxVector GetHandlers() { return m_handlerList; } /** FIXME: hack to work around signals being received too early */ bool m_ready; @@ -133,6 +136,13 @@ public: * user) */ bool m_busy; + + bool m_guard; + 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; protected: @@ -145,12 +155,12 @@ private: GtkWidget *web_view; gint m_historyLimit; - HistoryItemHash m_historyMap; - // FIXME: try to get DECLARE_DYNAMIC_CLASS macros & stuff right - //DECLARE_DYNAMIC_CLASS(wxWebViewWebKit) + wxVector m_handlerList; + + wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit); }; -#endif // if wxHAVE_WEB_BACKEND_GTK_WEBKIT +#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__) #endif