1 /* 2 * Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.com> 3 * 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28 #ifndef WXWEBVIEW_H 29 #define WXWEBVIEW_H 30 31 #include "wx/wxprec.h" 32 #ifndef WX_PRECOMP 33 #include "wx/wx.h" 34 #endif 35 36 #include "WebFrame.h" 37 38 class WebViewPrivate; 39 class WebViewFrameData; 40 class wxWebFrame; 41 42 typedef struct OpaqueJSContext* JSGlobalContextRef; 43 typedef struct OpaqueJSValue* JSObjectRef; 44 45 namespace WebCore { 46 class ChromeClientWx; 47 class FrameLoaderClientWx; 48 } 49 50 #ifndef SWIG 51 52 #if !wxCHECK_VERSION(2,9,0) && wxCHECK_GCC_VERSION(4,0) 53 #define WXDLLIMPEXP_WEBKIT __attribute__ ((visibility("default"))) 54 #elif WXMAKINGDLL_WEBKIT 55 #define WXDLLIMPEXP_WEBKIT WXEXPORT 56 #elif defined(WXUSINGDLL_WEBKIT) 57 #define WXDLLIMPEXP_WEBKIT WXIMPORT 58 #endif 59 60 #else 61 #define WXDLLIMPEXP_WEBKIT 62 #endif // SWIG 63 64 #ifndef SWIG 65 extern WXDLLIMPEXP_WEBKIT const wxChar* wxWebViewNameStr; 66 #endif 67 68 // copied from WebKit/mac/Misc/WebKitErrors[Private].h 69 enum { 70 WebKitErrorCannotShowMIMEType = 100, 71 WebKitErrorCannotShowURL = 101, 72 WebKitErrorFrameLoadInterruptedByPolicyChange = 102, 73 WebKitErrorCannotUseRestrictedPort = 103, 74 WebKitErrorCannotFindPlugIn = 200, 75 WebKitErrorCannotLoadPlugIn = 201, 76 WebKitErrorJavaUnavailable = 202, 77 }; 78 79 class WXDLLIMPEXP_WEBKIT wxWebView : public wxWindow 80 { 81 // ChromeClientWx needs to get the Page* stored by the wxWebView 82 // for the createWindow function. 83 friend class WebCore::ChromeClientWx; 84 friend class WebCore::FrameLoaderClientWx; 85 86 public: 87 // ctor(s) 88 #if SWIG 89 %pythonAppend wxWebView "self._setOORInfo(self)" 90 %pythonAppend wxWebView() "" 91 #endif 92 93 wxWebView(wxWindow* parent, int id = wxID_ANY, 94 const wxPoint& point = wxDefaultPosition, 95 const wxSize& size = wxDefaultSize, 96 long style = 0, 97 const wxString& name = wxWebViewNameStr); // For wxWebView internal data passing 98 #if SWIG 99 %rename(PreWebView) wxWebView(); 100 #else 101 wxWebView(); 102 #endif 103 104 bool Create(wxWindow* parent, int id = wxID_ANY, 105 const wxPoint& point = wxDefaultPosition, 106 const wxSize& size = wxDefaultSize, 107 long style = 0, 108 const wxString& name = wxWebViewNameStr); // For wxWebView internal data passing 109 110 #ifndef SWIG 111 virtual ~wxWebView(); 112 #endif 113 114 void LoadURL(const wxString& url); 115 bool GoBack(); 116 bool GoForward(); 117 void Stop(); 118 void Reload(); 119 120 bool CanGoBack(); 121 bool CanGoForward(); 122 123 bool CanCut(); 124 bool CanCopy(); 125 bool CanPaste(); 126 127 void Cut(); 128 void Copy(); 129 void Paste(); 130 131 //bool CanGetPageSource(); 132 wxString GetPageSource(); 133 void SetPageSource(const wxString& source, const wxString& baseUrl = wxEmptyString); 134 135 wxString GetInnerText(); 136 wxString GetAsMarkup(); 137 wxString GetExternalRepresentation(); 138 139 void SetTransparent(bool transparent); 140 bool IsTransparent() const; 141 142 wxString RunScript(const wxString& javascript); 143 144 bool FindString(const wxString& string, bool forward = true, 145 bool caseSensitive = false, bool wrapSelection = true, 146 bool startInSelection = true); 147 148 bool CanIncreaseTextSize() const; 149 void IncreaseTextSize(); 150 bool CanDecreaseTextSize() const; 151 void DecreaseTextSize(); 152 void ResetTextSize(); 153 void MakeEditable(bool enable); IsEditable()154 bool IsEditable() const { return m_isEditable; } 155 GetPageTitle()156 wxString GetPageTitle() const { return m_title; } SetPageTitle(const wxString & title)157 void SetPageTitle(const wxString& title) { m_title = title; } 158 GetMainFrame()159 wxWebFrame* GetMainFrame() { return m_mainFrame; } 160 161 wxWebViewDOMElementInfo HitTest(const wxPoint& pos) const; 162 163 protected: 164 165 // event handlers (these functions should _not_ be virtual) 166 void OnPaint(wxPaintEvent& event); 167 void OnSize(wxSizeEvent& event); 168 void OnMouseEvents(wxMouseEvent& event); 169 void OnContextMenuEvents(wxContextMenuEvent& event); 170 void OnMenuSelectEvents(wxCommandEvent& event); 171 void OnKeyEvents(wxKeyEvent& event); 172 void OnSetFocus(wxFocusEvent& event); 173 void OnKillFocus(wxFocusEvent& event); 174 void OnActivate(wxActivateEvent& event); 175 176 private: 177 // any class wishing to process wxWindows events must use this macro 178 #ifndef SWIG 179 DECLARE_EVENT_TABLE() 180 DECLARE_DYNAMIC_CLASS(wxWebView) 181 #endif 182 float m_textMagnifier; 183 bool m_isEditable; 184 bool m_isInitialized; 185 bool m_beingDestroyed; 186 WebViewPrivate* m_impl; 187 wxWebFrame* m_mainFrame; 188 wxString m_title; 189 190 }; 191 192 // ---------------------------------------------------------------------------- 193 // Web Kit Events 194 // ---------------------------------------------------------------------------- 195 196 enum { 197 wxWEBVIEW_LOAD_STARTED = 1, 198 wxWEBVIEW_LOAD_NEGOTIATING = 2, 199 wxWEBVIEW_LOAD_REDIRECTING = 4, 200 wxWEBVIEW_LOAD_TRANSFERRING = 8, 201 wxWEBVIEW_LOAD_STOPPED = 16, 202 wxWEBVIEW_LOAD_FAILED = 32, 203 wxWEBVIEW_LOAD_DL_COMPLETED = 64, 204 wxWEBVIEW_LOAD_DOC_COMPLETED = 128, 205 wxWEBVIEW_LOAD_ONLOAD_HANDLED = 256, 206 wxWEBVIEW_LOAD_WINDOW_OBJECT_CLEARED = 512 207 }; 208 209 enum { 210 wxWEBVIEW_NAV_LINK_CLICKED = 1, 211 wxWEBVIEW_NAV_BACK_NEXT = 2, 212 wxWEBVIEW_NAV_FORM_SUBMITTED = 4, 213 wxWEBVIEW_NAV_RELOAD = 8, 214 wxWEBVIEW_NAV_FORM_RESUBMITTED = 16, 215 wxWEBVIEW_NAV_OTHER = 32 216 }; 217 218 class WXDLLIMPEXP_WEBKIT wxWebViewBeforeLoadEvent : public wxCommandEvent 219 { 220 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewBeforeLoadEvent)221 DECLARE_DYNAMIC_CLASS( wxWebViewBeforeLoadEvent ) 222 #endif 223 224 public: 225 bool IsCancelled() const { return m_cancelled; } 226 void Cancel(bool cancel = true) { m_cancelled = cancel; } GetURL()227 wxString GetURL() const { return m_url; } SetURL(const wxString & url)228 void SetURL(const wxString& url) { m_url = url; } SetNavigationType(int navType)229 void SetNavigationType(int navType) { m_navType = navType; } GetNavigationType()230 int GetNavigationType() const { return m_navType; } 231 232 wxWebViewBeforeLoadEvent( wxWindow* win = (wxWindow*) NULL ); Clone(void)233 wxEvent *Clone(void) const { return new wxWebViewBeforeLoadEvent(*this); } 234 235 private: 236 bool m_cancelled; 237 wxString m_url; 238 int m_navType; 239 }; 240 241 class WXDLLIMPEXP_WEBKIT wxWebViewLoadEvent : public wxCommandEvent 242 { 243 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewLoadEvent)244 DECLARE_DYNAMIC_CLASS( wxWebViewLoadEvent ) 245 #endif 246 247 public: 248 int GetState() const { return m_state; } SetState(const int state)249 void SetState(const int state) { m_state = state; } GetURL()250 wxString GetURL() const { return m_url; } SetURL(const wxString & url)251 void SetURL(const wxString& url) { m_url = url; } 252 253 wxWebViewLoadEvent( wxWindow* win = (wxWindow*) NULL ); Clone(void)254 wxEvent *Clone(void) const { return new wxWebViewLoadEvent(*this); } 255 256 private: 257 int m_state; 258 wxString m_url; 259 }; 260 261 class WXDLLIMPEXP_WEBKIT wxWebViewNewWindowEvent : public wxCommandEvent 262 { 263 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewNewWindowEvent)264 DECLARE_DYNAMIC_CLASS( wxWebViewNewWindowEvent ) 265 #endif 266 267 public: 268 wxString GetURL() const { return m_url; } SetURL(const wxString & url)269 void SetURL(const wxString& url) { m_url = url; } GetTargetName()270 wxString GetTargetName() const { return m_targetName; } SetTargetName(const wxString & name)271 void SetTargetName(const wxString& name) { m_targetName = name; } 272 273 wxWebViewNewWindowEvent( wxWindow* win = static_cast<wxWindow*>(NULL)); Clone(void)274 wxEvent *Clone(void) const { return new wxWebViewNewWindowEvent(*this); } 275 276 private: 277 wxString m_url; 278 wxString m_targetName; 279 }; 280 281 class WXDLLIMPEXP_WEBKIT wxWebViewRightClickEvent : public wxCommandEvent 282 { 283 #ifndef SWIG 284 DECLARE_DYNAMIC_CLASS( wxWebViewRightClickEvent ) 285 #endif 286 287 public: 288 wxWebViewRightClickEvent( wxWindow* win = static_cast<wxWindow*>(NULL)); Clone(void)289 wxEvent *Clone(void) const { return new wxWebViewRightClickEvent(*this); } 290 GetInfo()291 wxWebViewDOMElementInfo GetInfo() const { return m_info; } SetInfo(wxWebViewDOMElementInfo info)292 void SetInfo(wxWebViewDOMElementInfo info) { m_info = info; } 293 GetPosition()294 wxPoint GetPosition() const { return m_position; } SetPosition(wxPoint pos)295 void SetPosition(wxPoint pos) { m_position = pos; } 296 297 private: 298 wxWebViewDOMElementInfo m_info; 299 wxPoint m_position; 300 }; 301 302 class WXDLLIMPEXP_WEBKIT wxWebViewConsoleMessageEvent : public wxCommandEvent 303 { 304 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewConsoleMessageEvent)305 DECLARE_DYNAMIC_CLASS( wxWebViewConsoleMessageEvent ) 306 #endif 307 308 public: 309 wxString GetMessage() const { return m_message; } SetMessage(const wxString & message)310 void SetMessage(const wxString& message) { m_message = message; } 311 GetLineNumber()312 unsigned int GetLineNumber() const { return m_lineNumber; } SetLineNumber(unsigned int lineNumber)313 void SetLineNumber(unsigned int lineNumber) { m_lineNumber = lineNumber; } 314 GetSourceID()315 wxString GetSourceID() const { return m_sourceID; } SetSourceID(const wxString & sourceID)316 void SetSourceID(const wxString& sourceID) { m_sourceID = sourceID; } 317 318 wxWebViewConsoleMessageEvent( wxWindow* win = (wxWindow*) NULL ); Clone(void)319 wxEvent *Clone(void) const { return new wxWebViewConsoleMessageEvent(*this); } 320 321 private: 322 unsigned int m_lineNumber; 323 wxString m_message; 324 wxString m_sourceID; 325 }; 326 327 class WXDLLIMPEXP_WEBKIT wxWebViewAlertEvent : public wxCommandEvent 328 { 329 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewAlertEvent)330 DECLARE_DYNAMIC_CLASS( wxWebViewAlertEvent ) 331 #endif 332 333 public: 334 wxString GetMessage() const { return m_message; } SetMessage(const wxString & message)335 void SetMessage(const wxString& message) { m_message = message; } 336 337 wxWebViewAlertEvent( wxWindow* win = (wxWindow*) NULL ); Clone(void)338 wxEvent *Clone(void) const { return new wxWebViewAlertEvent(*this); } 339 340 private: 341 wxString m_message; 342 }; 343 344 class WXDLLIMPEXP_WEBKIT wxWebViewConfirmEvent : public wxWebViewAlertEvent 345 { 346 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewConfirmEvent)347 DECLARE_DYNAMIC_CLASS( wxWebViewConfirmEvent ) 348 #endif 349 350 public: 351 int GetReturnCode() const { return m_returnCode; } SetReturnCode(int code)352 void SetReturnCode(int code) { m_returnCode = code; } 353 354 wxWebViewConfirmEvent( wxWindow* win = (wxWindow*) NULL ); Clone(void)355 wxEvent *Clone(void) const { return new wxWebViewConfirmEvent(*this); } 356 357 private: 358 int m_returnCode; 359 }; 360 361 class WXDLLIMPEXP_WEBKIT wxWebViewPromptEvent : public wxWebViewConfirmEvent 362 { 363 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewPromptEvent)364 DECLARE_DYNAMIC_CLASS( wxWebViewPromptEvent ) 365 #endif 366 367 public: 368 wxString GetResponse() const { return m_response; } SetResponse(const wxString & response)369 void SetResponse(const wxString& response) { m_response = response; } 370 371 wxWebViewPromptEvent( wxWindow* win = (wxWindow*) NULL ); Clone(void)372 wxEvent *Clone(void) const { return new wxWebViewPromptEvent(*this); } 373 374 private: 375 wxString m_response; 376 }; 377 378 class WXDLLIMPEXP_WEBKIT wxWebViewReceivedTitleEvent : public wxCommandEvent 379 { 380 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewReceivedTitleEvent)381 DECLARE_DYNAMIC_CLASS( wxWebViewReceivedTitleEvent ) 382 #endif 383 384 public: 385 wxString GetTitle() const { return m_title; } SetTitle(const wxString & title)386 void SetTitle(const wxString& title) { m_title = title; } 387 388 wxWebViewReceivedTitleEvent( wxWindow* win = static_cast<wxWindow*>(NULL)); Clone(void)389 wxEvent *Clone(void) const { return new wxWebViewReceivedTitleEvent(*this); } 390 391 private: 392 wxString m_title; 393 }; 394 395 class WXDLLIMPEXP_WEBKIT wxWebViewWindowObjectClearedEvent : public wxCommandEvent 396 { 397 #ifndef SWIG DECLARE_DYNAMIC_CLASS(wxWebViewWindowObjectClearedEvent)398 DECLARE_DYNAMIC_CLASS( wxWebViewWindowObjectClearedEvent ) 399 #endif 400 401 public: 402 JSGlobalContextRef GetJSContext() const { return m_jsContext; } SetJSContext(JSGlobalContextRef context)403 void SetJSContext(JSGlobalContextRef context) { m_jsContext = context; } 404 GetWindowObject()405 JSObjectRef GetWindowObject() const { return m_windowObject; } SetWindowObject(JSObjectRef object)406 void SetWindowObject(JSObjectRef object) { m_windowObject = object; } 407 408 wxWebViewWindowObjectClearedEvent( wxWindow* win = static_cast<wxWindow*>(NULL)); Clone(void)409 wxEvent *Clone(void) const { return new wxWebViewWindowObjectClearedEvent(*this); } 410 411 private: 412 JSGlobalContextRef m_jsContext; 413 JSObjectRef m_windowObject; 414 }; 415 416 typedef void (wxEvtHandler::*wxWebViewLoadEventFunction)(wxWebViewLoadEvent&); 417 typedef void (wxEvtHandler::*wxWebViewBeforeLoadEventFunction)(wxWebViewBeforeLoadEvent&); 418 typedef void (wxEvtHandler::*wxWebViewNewWindowEventFunction)(wxWebViewNewWindowEvent&); 419 typedef void (wxEvtHandler::*wxWebViewRightClickEventFunction)(wxWebViewRightClickEvent&); 420 typedef void (wxEvtHandler::*wxWebViewConsoleMessageEventFunction)(wxWebViewConsoleMessageEvent&); 421 typedef void (wxEvtHandler::*wxWebViewAlertEventFunction)(wxWebViewAlertEvent&); 422 typedef void (wxEvtHandler::*wxWebViewConfirmEventFunction)(wxWebViewConfirmEvent&); 423 typedef void (wxEvtHandler::*wxWebViewPromptEventFunction)(wxWebViewPromptEvent&); 424 typedef void (wxEvtHandler::*wxWebViewReceivedTitleEventFunction)(wxWebViewReceivedTitleEvent&); 425 typedef void (wxEvtHandler::*wxWebViewWindowObjectClearedFunction)(wxWebViewWindowObjectClearedEvent&); 426 427 #define wxWebViewLoadEventHandler(func) \ 428 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewLoadEventFunction, &func) 429 #define wxWebViewBeforeLoadEventHandler(func) \ 430 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewBeforeLoadEventFunction, &func) 431 #define wxWebViewNewWindowEventHandler(func) \ 432 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewNewWindowEventFunction, &func) 433 #define wxWebViewRightClickEventHandler(func) \ 434 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewRightClickEventFunction, &func) 435 #define wxWebViewConsoleMessageEventHandler(func) \ 436 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewConsoleMessageEventFunction, &func) 437 #define wxWebViewAlertEventHandler(func) \ 438 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewAlertEventFunction, &func) 439 #define wxWebViewConfirmEventHandler(func) \ 440 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewConfirmEventFunction, &func) 441 #define wxWebViewPromptEventHandler(func) \ 442 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewPromptEventFunction, &func) 443 #define wxWebViewReceivedTitleEventHandler(func) \ 444 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewReceivedTitleEventFunction, &func) 445 #define wxWebViewWindowObjectClearedEventHandler(func) \ 446 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWebViewWindowObjectClearedFunction, &func) 447 448 #ifndef SWIG 449 BEGIN_DECLARE_EVENT_TYPES() 450 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_BEFORE_LOAD, wxID_ANY) 451 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_LOAD, wxID_ANY) 452 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_NEW_WINDOW, wxID_ANY) 453 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_RIGHT_CLICK, wxID_ANY) 454 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_CONSOLE_MESSAGE, wxID_ANY) 455 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_JS_ALERT, wxID_ANY) 456 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_JS_CONFIRM, wxID_ANY) 457 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_JS_PROMPT, wxID_ANY) 458 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_RECEIVED_TITLE, wxID_ANY) 459 DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_WEBKIT, wxEVT_WEBVIEW_WINDOW_OBJECT_CLEARED, wxID_ANY) 460 END_DECLARE_EVENT_TYPES() 461 #endif 462 463 #define EVT_WEBVIEW_LOAD(winid, func) \ 464 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_LOAD, \ 465 winid, \ 466 wxID_ANY, \ 467 (wxObjectEventFunction) \ 468 (wxWebViewLoadEventFunction) & func, \ 469 static_cast<wxObject*>(NULL)), 470 471 #define EVT_WEBVIEW_BEFORE_LOAD(winid, func) \ 472 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_BEFORE_LOAD, \ 473 winid, \ 474 wxID_ANY, \ 475 (wxObjectEventFunction) \ 476 (wxWebViewBeforeLoadEventFunction) & func, \ 477 static_cast<wxObject*>(NULL)), 478 479 #define EVT_WEBVIEW_NEW_WINDOW(winid, func) \ 480 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_NEW_WINDOW, \ 481 winid, \ 482 wxID_ANY, \ 483 (wxObjectEventFunction) \ 484 (wxWebViewNewWindowEventFunction) & func, \ 485 static_cast<wxObject*>(NULL)), 486 487 #define EVT_WEBVIEW_RIGHT_CLICK(winid, func) \ 488 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_RIGHT_CLICK, \ 489 winid, \ 490 wxID_ANY, \ 491 (wxObjectEventFunction) \ 492 (wxWebViewRightClickEventFunction) & func, \ 493 static_cast<wxObject*>(NULL)), 494 495 #define EVT_WEBVIEW_CONSOLE_MESSAGE(winid, func) \ 496 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_CONSOLE_MESSAGE, \ 497 winid, \ 498 wxID_ANY, \ 499 (wxObjectEventFunction) \ 500 (wxWebViewConsoleMessageEventFunction) & func, \ 501 static_cast<wxObject*>(NULL)), 502 503 #define EVT_WEBVIEW_JS_ALERT(winid, func) \ 504 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_JS_ALERT, \ 505 winid, \ 506 wxID_ANY, \ 507 (wxObjectEventFunction) \ 508 (wxWebViewAlertEventFunction) & func, \ 509 static_cast<wxObject*>(NULL)), 510 511 #define EVT_WEBVIEW_JS_CONFIRM(winid, func) \ 512 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_JS_CONFIRM, \ 513 winid, \ 514 wxID_ANY, \ 515 (wxObjectEventFunction) \ 516 (wxWebViewConfirmEventFunction) & func, \ 517 static_cast<wxObject*>(NULL)), 518 519 #define EVT_WEBVIEW_JS_PROMPT(winid, func) \ 520 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_JS_PROMPT, \ 521 winid, \ 522 wxID_ANY, \ 523 (wxObjectEventFunction) \ 524 (wxWebViewPromptEventFunction) & func, \ 525 static_cast<wxObject*>(NULL)), 526 527 #define EVT_WEBVIEW_RECEIVED_TITLE(winid, func) \ 528 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_RECEIVED_TITLE, \ 529 winid, \ 530 wxID_ANY, \ 531 (wxObjectEventFunction) \ 532 (wxWebViewReceivedTitleEventFunction) & func, \ 533 static_cast<wxObject*>(NULL)), 534 535 #define EVT_WEBVIEW_WINDOW_OBJECT_CLEARED(winid, func) \ 536 DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBVIEW_WINDOW_OBJECT_CLEARED, \ 537 winid, \ 538 wxID_ANY, \ 539 (wxObjectEventFunction) \ 540 (wxWebViewWindowObjectClearedFunction) & func, \ 541 static_cast<wxObject*>(NULL)), 542 543 #endif // ifndef WXWEBVIEW_H 544