#include "wx/setup.h"
-#if wxHAVE_WEB_BACKEND_GTK_WEBKIT
+#if wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
+#include "webkit/webkit.h"
+#include "wx/sharedptr.h"
#include "wx/webview.h"
//-----------------------------------------------------------------------------
-// wxWebViewGTKWebKit
+// wxWebViewWebKit
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_WEB wxWebViewGTKWebKit : public wxWebView
+class WXDLLIMPEXP_WEB wxWebViewWebKit : public wxWebView
{
public:
- wxWebViewGTKWebKit() { Init(); }
+ wxWebViewWebKit() { Init(); }
- wxWebViewGTKWebKit(wxWindow *parent,
+ wxWebViewWebKit(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual bool CanGoBack();
virtual bool CanGoForward();
+ virtual void ClearHistory();
+ virtual void EnableHistory(bool enable = true);
+ virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory();
+ virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory();
+ virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item);
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();
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<wxWebHandler*> GetHandlers() { return m_handlerList; }
/** FIXME: hack to work around signals being received too early */
bool m_ready;
* 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:
void GTKOnFocus(wxFocusEvent& event);
GtkWidget *web_view;
+ gint m_historyLimit;
+
+ wxVector<wxWebHandler*> m_handlerList;
- // FIXME: try to get DECLARE_DYNAMIC_CLASS macros & stuff right
- //DECLARE_DYNAMIC_CLASS(wxWebViewGTKWebKit)
+ wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit);
};
-#endif // if wxHAVE_WEB_BACKEND_GTK_WEBKIT
+#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
#endif