X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d0dddc7adc82a29ea2fad2fc4e3781592f19d10..75ded4d17344618afd302a0671f1277791ee17ed:/include/wx/webview.h diff --git a/include/wx/webview.h b/include/wx/webview.h index e58cf881f9..a58fd87f97 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -12,7 +12,7 @@ #include "wx/setup.h" -#if wxUSE_WEB +#if wxUSE_WEBVIEW #include "wx/control.h" #include "wx/event.h" @@ -70,20 +70,21 @@ enum wxWebViewBackend }; //Base class for custom scheme handlers -class WXDLLIMPEXP_WEB wxWebViewHandler +class WXDLLIMPEXP_WEBVIEW wxWebViewHandler { public: wxWebViewHandler(const wxString& scheme) : m_scheme(scheme) {} + virtual ~wxWebViewHandler() {} virtual wxString GetName() const { return m_scheme; } virtual wxFSFile* GetFile(const wxString &uri) = 0; private: wxString m_scheme; }; -extern WXDLLIMPEXP_DATA_WEB(const char) wxWebViewNameStr[]; -extern WXDLLIMPEXP_DATA_WEB(const char) wxWebViewDefaultURLStr[]; +extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewNameStr[]; +extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewDefaultURLStr[]; -class WXDLLIMPEXP_WEB wxWebView : public wxControl +class WXDLLIMPEXP_WEBVIEW wxWebView : public wxControl { public: @@ -171,46 +172,33 @@ public: wxDECLARE_ABSTRACT_CLASS(wxWebView); }; -class WXDLLIMPEXP_WEB wxWebViewEvent : public wxCommandEvent +class WXDLLIMPEXP_WEBVIEW wxWebViewEvent : public wxNotifyEvent { public: wxWebViewEvent() {} wxWebViewEvent(wxEventType type, int id, const wxString url, - const wxString target, bool canVeto) - : wxCommandEvent(type, id) - { - m_url = url; - m_target = target; - m_vetoed = false; - m_canVeto = canVeto; - } + const wxString target) + : wxNotifyEvent(type, id), m_url(url), m_target(target) + {} const wxString& GetURL() const { return m_url; } const wxString& GetTarget() const { return m_target; } virtual wxEvent* Clone() const { return new wxWebViewEvent(*this); } - - bool CanVeto() const { return m_canVeto; } - bool IsVetoed() const { return m_vetoed; } - - void Veto() { wxASSERT(m_canVeto); m_vetoed = true; } - private: wxString m_url; wxString m_target; - bool m_canVeto; - bool m_vetoed; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWebViewEvent); }; -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebViewEvent ); -wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEB, wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebViewEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebViewEvent ); typedef void (wxEvtHandler::*wxWebViewEventFunction) (wxWebViewEvent&); @@ -242,6 +230,6 @@ typedef void (wxEvtHandler::*wxWebViewEventFunction) wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, id, \ wxWebViewEventHandler(fn)) -#endif // wxUSE_WEB +#endif // wxUSE_WEBVIEW #endif // _WX_WEB_VIEW_H_