X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7aef23e7b42412bdfddd80c6b808e0e8a183ba9..b02dd12239c8a59b9a545d9fcb04974f8ad02c6b:/include/wx/webview.h?ds=sidebyside diff --git a/include/wx/webview.h b/include/wx/webview.h index ced86a7df9..455ee64054 100644 --- a/include/wx/webview.h +++ b/include/wx/webview.h @@ -10,7 +10,7 @@ #ifndef _WX_WEB_VIEW_H_ #define _WX_WEB_VIEW_H_ -#include "wx/setup.h" +#include "wx/defs.h" #if wxUSE_WEBVIEW @@ -20,9 +20,15 @@ #include "wx/sharedptr.h" #include "wx/vector.h" -#include "wx/osx/webviewhistoryitem_webkit.h" -#include "wx/gtk/webviewhistoryitem_webkit.h" -#include "wx/msw/webviewhistoryitem_ie.h" +#if defined(__WXOSX__) + #include "wx/osx/webviewhistoryitem_webkit.h" +#elif defined(__WXGTK__) + #include "wx/gtk/webviewhistoryitem_webkit.h" +#elif defined(__WXMSW__) + #include "wx/msw/webviewhistoryitem_ie.h" +#else + #error "wxWebView not implemented on this platform." +#endif class wxFSFile; class wxFileSystem; @@ -70,30 +76,32 @@ 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: + virtual ~wxWebView() {} virtual bool Create(wxWindow* parent, wxWindowID id, - const wxString& url, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) = 0; + const wxString& url = wxWebViewDefaultURLStr, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxWebViewNameStr) = 0; static wxWebView* New(wxWebViewBackend backend = wxWEB_VIEW_BACKEND_DEFAULT); static wxWebView* New(wxWindow* parent, @@ -171,7 +179,7 @@ public: wxDECLARE_ABSTRACT_CLASS(wxWebView); }; -class WXDLLIMPEXP_WEB wxWebViewEvent : public wxNotifyEvent +class WXDLLIMPEXP_WEBVIEW wxWebViewEvent : public wxNotifyEvent { public: wxWebViewEvent() {} @@ -192,12 +200,12 @@ private: 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&); @@ -217,7 +225,7 @@ typedef void (wxEvtHandler::*wxWebViewEventFunction) wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_LOADED, id, \ wxWebViewEventHandler(fn)) -#define EVT_WEB_VIEW_ERRROR(id, fn) \ +#define EVT_WEB_VIEW_ERROR(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_ERROR, id, \ wxWebViewEventHandler(fn))