X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eff8f7952ed2ecc85b48dd01a047658d7f4eafcb..7bd30a12ade503fd135c686ecc98a6f6d5fecbeb:/include/wx/webview.h diff --git a/include/wx/webview.h b/include/wx/webview.h index 43bb52bab8..0bc9f8547e 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -3,7 +3,7 @@ // Purpose: Common interface and events for web view component // Author: Marianne Gagnon // Id: $Id$ -// Copyright: (c) 2010 Marianne Gagnon +// Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -20,20 +20,13 @@ #include "wx/sharedptr.h" #include "wx/vector.h" +#include "wx/osx/webhistoryitem_webkit.h" +#include "wx/gtk/webhistoryitem_webkit.h" +#include "wx/msw/webhistoryitem_ie.h" + class wxFSFile; class wxFileSystem; -class WXDLLIMPEXP_WEB wxWebHistoryItem -{ -public: - wxWebHistoryItem(const wxString& url, const wxString& title) : - m_url(url), m_title(title) {} - wxString GetUrl() { return m_url; } - wxString GetTitle() { return m_title; } - -private: - wxString m_url, m_title; -}; /** * Zoom level in web view component @@ -107,29 +100,15 @@ enum wxWebViewBackend wxWEB_VIEW_BACKEND_IE }; -//Base class for custom protocol handlers -class WXDLLIMPEXP_WEB wxWebProtocolHandler +//Base class for custom scheme handlers +class WXDLLIMPEXP_WEB wxWebHandler { public: - virtual wxString GetProtocol() = 0; + virtual wxString GetName() const = 0; virtual wxFSFile* GetFile(const wxString &uri) = 0; virtual wxString CombineURIs(const wxString &baseuri, const wxString &newuri) = 0; }; -//Loads from uris such as file:///C:/example/example.html or archives such as -//file:///C:/example/example.zip?protocol=zip;path=example.html -class WXDLLIMPEXP_WEB wxWebFileProtocolHandler : public wxWebProtocolHandler -{ -public: - wxWebFileProtocolHandler(); - virtual wxString GetProtocol() { return m_protocol; } - virtual wxFSFile* GetFile(const wxString &uri); - virtual wxString CombineURIs(const wxString &baseuri, const wxString &newuri); -private: - wxString m_protocol; - wxFileSystem* m_fileSystem; -}; - extern WXDLLIMPEXP_DATA_WEB(const char) wxWebViewNameStr[]; extern WXDLLIMPEXP_DATA_WEB(const char) wxWebViewDefaultURLStr[]; @@ -361,7 +340,9 @@ public: virtual void Redo() = 0; //Virtual Filesystem Support - virtual void RegisterProtocol(wxWebProtocolHandler* handler) = 0; + virtual void RegisterHandler(wxWebHandler* handler) = 0; + + wxDECLARE_ABSTRACT_CLASS(wxWebView); }; class WXDLLIMPEXP_WEB wxWebNavigationEvent : public wxCommandEvent @@ -421,6 +402,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxW wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebNavigationEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebNavigationEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebNavigationEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebNavigationEvent ); typedef void (wxEvtHandler::*wxWebNavigationEventFunction) (wxWebNavigationEvent&); @@ -448,6 +430,10 @@ typedef void (wxEvtHandler::*wxWebNavigationEventFunction) wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, id, \ wxHtmlNavigatingEventHandler(fn)) +#define EVT_WEB_VIEW_TITLE_CHANGED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, id, \ + wxHtmlNavigatingEventHandler(fn)) + #endif // wxUSE_WEB #endif // _WX_WEB_VIEW_H_