]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/webview.h
5e48cf127a24ceab6e635f35ac51a46fa387850a
[wxWidgets.git] / interface / wx / webview.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: webview.h
3 // Purpose: interface of wxWebView
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 Zoom levels available in wxWebView
11 */
12 enum wxWebViewZoom
13 {
14 wxWEBVIEW_ZOOM_TINY,
15 wxWEBVIEW_ZOOM_SMALL,
16 wxWEBVIEW_ZOOM_MEDIUM, //!< default size
17 wxWEBVIEW_ZOOM_LARGE,
18 wxWEBVIEW_ZOOM_LARGEST
19 };
20
21 /**
22 The type of zooming that the web view control can perform
23 */
24 enum wxWebViewZoomType
25 {
26 /**
27 The entire layout scales when zooming, including images
28 */
29 wxWEBVIEW_ZOOM_TYPE_LAYOUT,
30 /**
31 Only the text changes in size when zooming, images and other layout
32 elements retain their initial size
33 */
34 wxWEBVIEW_ZOOM_TYPE_TEXT
35 };
36
37 /**
38 Types of errors that can cause navigation to fail
39 */
40 enum wxWebViewNavigationError
41 {
42 /** Connection error (timeout, etc.) */
43 wxWEBVIEW_NAV_ERR_CONNECTION,
44 /** Invalid certificate */
45 wxWEBVIEW_NAV_ERR_CERTIFICATE,
46 /** Authentication required */
47 wxWEBVIEW_NAV_ERR_AUTH,
48 /** Other security error */
49 wxWEBVIEW_NAV_ERR_SECURITY,
50 /** Requested resource not found */
51 wxWEBVIEW_NAV_ERR_NOT_FOUND,
52 /** Invalid request/parameters (e.g. bad URL, bad protocol,
53 unsupported resource type) */
54 wxWEBVIEW_NAV_ERR_REQUEST,
55 /** The user cancelled (e.g. in a dialog) */
56 wxWEBVIEW_NAV_ERR_USER_CANCELLED,
57 /** Another (exotic) type of error that didn't fit in other categories*/
58 wxWEBVIEW_NAV_ERR_OTHER
59 };
60
61 /**
62 Type of refresh
63 */
64 enum wxWebViewReloadFlags
65 {
66 /** Default reload, will access cache */
67 wxWEBVIEW_RELOAD_DEFAULT,
68 /** Reload the current view without accessing the cache */
69 wxWEBVIEW_RELOAD_NO_CACHE
70 };
71
72 /**
73 Find flags used when searching for text on page.
74 */
75 enum wxWebViewFindFlags
76 {
77 /** Causes the search to restart when end or beginning reached */
78 wxWEBVIEW_FIND_WRAP = 0x0001,
79
80 /** Matches an entire word when searching */
81 wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002,
82
83 /** Match case, i.e. case sensitive searching */
84 wxWEBVIEW_FIND_MATCH_CASE = 0x0004,
85
86 /** Highlights the search results */
87 wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008,
88
89 /** Searches for phrase in backward direction */
90 wxWEBVIEW_FIND_BACKWARDS = 0x0010,
91
92 /** The default flag, which is simple searching */
93 wxWEBVIEW_FIND_DEFAULT = 0
94 };
95
96
97 /**
98 @class wxWebViewHistoryItem
99
100 A simple class that contains the URL and title of an element of the history
101 of a wxWebView.
102
103 @since 2.9.3
104 @library{wxwebview}
105 @category{webview}
106
107 @see wxWebView
108 */
109 class wxWebViewHistoryItem
110 {
111 public:
112 /**
113 Construtor.
114 */
115 wxWebViewHistoryItem(const wxString& url, const wxString& title);
116
117 /**
118 @return The url of the page.
119 */
120 wxString GetUrl();
121
122 /**
123 @return The title of the page.
124 */
125 wxString GetTitle();
126 };
127
128 /**
129 @class wxWebViewFactory
130
131 An abstract factory class for creating wxWebView backends. Each
132 implementation of wxWebView should have its own factory.
133
134 @since 2.9.5
135 @library{wxwebview}
136 @category{webview}
137
138 @see wxWebView
139 */
140 class wxWebViewFactory : public wxObject
141 {
142 public:
143 /**
144 Function to create a new wxWebView with two-step creation,
145 wxWebView::Create should be called on the returned object.
146 @return the created wxWebView
147 */
148 virtual wxWebView* Create() = 0;
149
150 /**
151 Function to create a new wxWebView with parameters.
152 @param parent Parent window for the control
153 @param id ID of this control
154 @param url Initial URL to load
155 @param pos Position of the control
156 @param size Size of the control
157 @return the created wxWebView
158 */
159 virtual wxWebView* Create(wxWindow* parent,
160 wxWindowID id,
161 const wxString& url = wxWebViewDefaultURLStr,
162 const wxPoint& pos = wxDefaultPosition,
163 const wxSize& size = wxDefaultSize,
164 long style = 0,
165 const wxString& name = wxWebViewNameStr) = 0;
166 };
167
168 /**
169 @class wxWebViewHandler
170
171 The base class for handling custom schemes in wxWebView, for example to
172 allow virtual file system support.
173
174 @since 2.9.3
175 @library{wxwebview}
176 @category{webview}
177
178 @see wxWebView
179 */
180 class wxWebViewHandler
181 {
182 public:
183 /**
184 Constructor. Takes the name of the scheme that will be handled by this
185 class for example @c file or @c zip.
186 */
187 wxWebViewHandler(const wxString& scheme);
188
189 /**
190 @return A pointer to the file represented by @c uri.
191 */
192 virtual wxFSFile* GetFile(const wxString &uri) = 0;
193
194 /**
195 @return The name of the scheme, as passed to the constructor.
196 */
197 virtual wxString GetName() const;
198 };
199
200 /**
201 @class wxWebView
202
203 This control may be used to render web (HTML / CSS / javascript) documents.
204 It is designed to allow the creation of multiple backends for each port,
205 although currently just one is available. It differs from wxHtmlWindow in
206 that each backend is actually a full rendering engine, Trident on MSW and
207 Webkit on OSX and GTK. This allows the correct viewing complex pages with
208 javascript and css.
209
210 @section descriptions Backend Descriptions
211
212 @par wxWEBVIEW_BACKEND_IE (MSW)
213
214 The IE backend uses Microsoft's Trident rendering engine, specifically the
215 version used by the locally installed copy of Internet Explorer. As such it
216 is only available for the MSW port. By default recent versions of the
217 <a href="http://msdn.microsoft.com/en-us/library/aa752085%28v=VS.85%29.aspx">WebBrowser</a>
218 control, which this backend uses, emulate Internet Explorer 7. This can be
219 changed with a registry setting, see
220 <a href="http://msdn.microsoft.com/en-us/library/ee330730%28v=vs.85%29.aspx#browser_emulation">
221 this</a> article for more information. This backend has full support for
222 custom schemes and virtual file systems.
223
224 @par wxWEBVIEW_WEBKIT (GTK)
225
226 Under GTK the WebKit backend uses
227 <a href="http://webkitgtk.org/">WebKitGTK+</a>. The current minimum version
228 required is 1.3.1 which ships by default with Ubuntu Natty and Debian
229 Wheezy and has the package name libwebkitgtk-dev. Custom schemes and
230 virtual files systems are supported under this backend, however embedded
231 resources such as images and stylesheets are currently loaded using the
232 data:// scheme.
233
234 @par wxWEBVIEW_WEBKIT (OSX)
235
236 The OSX WebKit backend uses Apple's
237 <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/WebKit/Classes/WebView_Class/Reference/Reference.html#//apple_ref/doc/uid/20001903">WebView</a>
238 class. This backend has full support for custom schemes and virtual file
239 systems.
240
241 @section async Asynchronous Notifications
242
243 Many of the methods in wxWebView are asynchronous, i.e. they return
244 immediately and perform their work in the background. This includes
245 functions such as LoadURL() and Reload(). To receive notification of the
246 progress and completion of these functions you need to handle the events
247 that are provided. Specifically @c wxEVT_WEBVIEW_LOADED notifies
248 when the page or a sub-frame has finished loading and
249 @c wxEVT_WEBVIEW_ERROR notifies that an error has occurred.
250
251 @section vfs Virtual File Systems and Custom Schemes
252
253 wxWebView supports the registering of custom scheme handlers, for example
254 @c file or @c http. To do this create a new class which inherits from
255 wxWebViewHandler, where wxWebHandler::GetFile() returns a pointer to a
256 wxFSFile which represents the given url. You can then register your handler
257 with RegisterHandler() it will be called for all pages and resources.
258
259 wxWebViewFSHandler is provided to access the virtual file system encapsulated by
260 wxFileSystem. The wxMemoryFSHandler documentation gives an example of how this
261 may be used.
262
263 wxWebViewArchiveHandler is provided to allow the navigation of pages inside a zip
264 archive. It supports paths of the form:
265 @c scheme:///C:/example/docs.zip;protocol=zip/main.htm
266
267 @beginEventEmissionTable{wxWebViewEvent}
268 @event{EVT_WEBVIEW_NAVIGATING(id, func)}
269 Process a @c wxEVT_WEBVIEW_NAVIGATING event, generated before trying
270 to get a resource. This event may be vetoed to prevent navigating to this
271 resource. Note that if the displayed HTML document has several frames, one
272 such event will be generated per frame.
273 @event{EVT_WEBVIEW_NAVIGATED(id, func)}
274 Process a @c wxEVT_WEBVIEW_NAVIGATED event generated after it was
275 confirmed that a resource would be requested. This event may not be vetoed.
276 Note that if the displayed HTML document has several frames, one such event
277 will be generated per frame.
278 @event{EVT_WEBVIEW_LOADED(id, func)}
279 Process a @c wxEVT_WEBVIEW_LOADED event generated when the document
280 is fully loaded and displayed. Note that if the displayed HTML document has
281 several frames, one such event will be generated per frame.
282 @event{EVT_WEBVIEW_ERROR(id, func)}
283 Process a @c wxEVT_WEBVIEW_ERROR event generated when a navigation
284 error occurs.
285 The integer associated with this event will be a wxWebNavigationError item.
286 The string associated with this event may contain a backend-specific more
287 precise error message/code.
288 @event{EVT_WEBVIEW_NEWWINDOW(id, func)}
289 Process a @c wxEVT_WEBVIEW_NEWWINDOW event, generated when a new
290 window is created. You must handle this event if you want anything to
291 happen, for example to load the page in a new window or tab.
292 @event{EVT_WEBVIEW_TITLE_CHANGED(id, func)}
293 Process a @c wxEVT_WEBVIEW_TITLE_CHANGED event, generated when
294 the page title changes. Use GetString to get the title.
295 @endEventTable
296
297 @since 2.9.3
298 @library{wxwebview}
299 @category{ctrl,webview}
300 @see wxWebViewHandler, wxWebViewEvent
301 */
302 class wxWebView : public wxControl
303 {
304 public:
305
306 /**
307 Creation function for two-step creation.
308 */
309 virtual bool Create(wxWindow* parent,
310 wxWindowID id,
311 const wxString& url = wxWebViewDefaultURLStr,
312 const wxPoint& pos = wxDefaultPosition,
313 const wxSize& size = wxDefaultSize,
314 long style = 0,
315 const wxString& name = wxWebViewNameStr) = 0;
316
317 /**
318 Factory function to create a new wxWebView with two-step creation,
319 wxWebView::Create should be called on the returned object.
320 @param backend The backend web rendering engine to use.
321 @c wxWebViewBackendDefault, @c wxWebViewBackendIE and
322 @c wxWebViewBackendWebKit are predefined where appropriate.
323 @return The created wxWebView
324 @since 2.9.5
325 */
326 static wxWebView* New(const wxString& backend = wxWebViewBackendDefault);
327
328 /**
329 Factory function to create a new wxWebView using a wxWebViewFactory.
330 @param parent Parent window for the control
331 @param id ID of this control
332 @param url Initial URL to load
333 @param pos Position of the control
334 @param size Size of the control
335 @param backend The backend web rendering engine to use.
336 @c wxWebViewBackendDefault, @c wxWebViewBackendIE and
337 @c wxWebViewBackendWebKit are predefined where appropriate.
338 @return The created wxWebView, or @c NULL if the requested backend
339 is not available
340 @since 2.9.5
341 */
342 static wxWebView* New(wxWindow* parent,
343 wxWindowID id,
344 const wxString& url = wxWebViewDefaultURLStr,
345 const wxPoint& pos = wxDefaultPosition,
346 const wxSize& size = wxDefaultSize,
347 const wxString& backend = wxWebViewBackendDefault,
348 long style = 0,
349 const wxString& name = wxWebViewNameStr);
350
351 /**
352 Allows the registering of new backend for wxWebView. @a backend can be
353 used as an argument to New().
354 @param backend The name for the new backend to be registered under
355 @param factory A shared pointer to the factory which creates the
356 appropriate backend.
357 @since 2.9.5
358 */
359 static void RegisterFactory(const wxString& backend,
360 wxSharedPtr<wxWebViewFactory> factory);
361
362 /**
363 Get the title of the current web page, or its URL/path if title is not
364 available.
365 */
366 virtual wxString GetCurrentTitle() const = 0;
367
368 /**
369 Get the URL of the currently displayed document.
370 */
371 virtual wxString GetCurrentURL() const = 0;
372
373 /**
374 Return the pointer to the native backend used by this control.
375
376 This method can be used to retrieve the pointer to the native rendering
377 engine used by this control. The return value needs to be down-casted
378 to the appropriate type depending on the platform: under Windows, it's
379 a pointer to IWebBrowser2 interface, under OS X it's a WebView pointer
380 and under GTK it's a WebKitWebView.
381
382 For example, you could set the WebKit options using this method:
383 @code
384 #include <webkit/webkit.h>
385
386 #ifdef __WXGTK__
387 WebKitWebView*
388 wv = static_cast<WebKitWebView*>(m_window->GetNativeBackend());
389
390 WebKitWebSettings* settings = webkit_web_view_get_settings(wv);
391 g_object_set(G_OBJECT(settings),
392 "enable-frame-flattening", TRUE,
393 NULL);
394 #endif
395 @endcode
396
397 @since 2.9.5
398 */
399 virtual void* GetNativeBackend() const = 0;
400
401 /**
402 Get the HTML source code of the currently displayed document.
403 @return The HTML source code, or an empty string if no page is currently
404 shown.
405 */
406 virtual wxString GetPageSource() const = 0;
407
408 /**
409 Get the text of the current page.
410 */
411 virtual wxString GetPageText() const = 0;
412
413 /**
414 Returns whether the web control is currently busy (e.g.\ loading a page).
415 */
416 virtual bool IsBusy() const = 0;
417
418 /**
419 Returns whether the web control is currently editable
420 */
421 virtual bool IsEditable() const = 0;
422
423 /**
424 Load a web page from a URL
425 @param url The URL of the page to be loaded.
426 @note Web engines generally report errors asynchronously, so if you wish
427 to know whether loading the URL was successful, register to receive
428 navigation error events.
429 */
430 virtual void LoadURL(const wxString& url) = 0;
431
432 /**
433 Opens a print dialog so that the user may print the currently
434 displayed page.
435 */
436 virtual void Print() = 0;
437
438 /**
439 Registers a custom scheme handler.
440 @param handler A shared pointer to a wxWebHandler.
441 */
442 virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) = 0;
443
444 /**
445 Reload the currently displayed URL.
446 @param flags A bit array that may optionally contain reload options.
447 */
448 virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0;
449
450 /**
451 Runs the given javascript code.
452 @note When using wxWEBVIEW_BACKEND_IE you must wait for the current
453 page to finish loading before calling RunScript().
454 */
455 virtual void RunScript(const wxString& javascript) = 0;
456
457 /**
458 Set the editable property of the web control. Enabling allows the user
459 to edit the page even if the @c contenteditable attribute is not set.
460 The exact capabilities vary with the backend being used.
461 */
462 virtual void SetEditable(bool enable = true) = 0;
463
464 /**
465 Set the displayed page source to the contents of the given string.
466 @param html The string that contains the HTML data to display.
467 @param baseUrl URL assigned to the HTML data, to be used to resolve
468 relative paths, for instance.
469 @note When using wxWEBVIEW_BACKEND_IE you must wait for the current
470 page to finish loading before calling SetPage().
471 */
472 virtual void SetPage(const wxString& html, const wxString& baseUrl) = 0;
473
474 /**
475 Set the displayed page source to the contents of the given stream.
476 @param html The stream to read HTML data from.
477 @param baseUrl URL assigned to the HTML data, to be used to resolve
478 relative paths, for instance.
479 */
480 virtual void SetPage(wxInputStream& html, wxString baseUrl);
481
482 /**
483 Stop the current page loading process, if any.
484 May trigger an error event of type @c wxWEBVIEW_NAV_ERR_USER_CANCELLED.
485 TODO: make @c wxWEBVIEW_NAV_ERR_USER_CANCELLED errors uniform across ports.
486 */
487 virtual void Stop() = 0;
488
489 /**
490 @name Clipboard
491 */
492
493 /**
494 Returns @true if the current selection can be copied.
495
496 @note This always returns @c true on the OSX WebKit backend.
497 */
498 virtual bool CanCopy() const = 0;
499
500 /**
501 Returns @true if the current selection can be cut.
502
503 @note This always returns @c true on the OSX WebKit backend.
504 */
505 virtual bool CanCut() const = 0;
506
507 /**
508 Returns @true if data can be pasted.
509
510 @note This always returns @c true on the OSX WebKit backend.
511 */
512 virtual bool CanPaste() const = 0;
513
514 /**
515 Copies the current selection.
516 */
517 virtual void Copy() = 0;
518
519 /**
520 Cuts the current selection.
521 */
522 virtual void Cut() = 0;
523
524 /**
525 Pastes the current data.
526 */
527 virtual void Paste() = 0;
528
529 /**
530 @name Context Menu
531 */
532
533 /**
534 Enable or disable the right click context menu.
535
536 By default the standard context menu is enabled, this method can be
537 used to disable it or re-enable it later.
538
539 @since 2.9.5
540 */
541 virtual void EnableContextMenu(bool enable = true);
542
543 /**
544 Returns @true if a context menu will be shown on right click.
545
546 @since 2.9.5
547 */
548 virtual bool IsContextMenuEnabled() const;
549
550 /**
551 @name History
552 */
553
554 /**
555 Returns @true if it is possible to navigate backward in the history of
556 visited pages.
557 */
558 virtual bool CanGoBack() const = 0;
559
560 /**
561 Returns @true if it is possible to navigate forward in the history of
562 visited pages.
563 */
564 virtual bool CanGoForward() const = 0;
565
566 /**
567 Clear the history, this will also remove the visible page.
568 */
569 virtual void ClearHistory() = 0;
570
571 /**
572 Enable or disable the history. This will also clear the history.
573 */
574 virtual void EnableHistory(bool enable = true) = 0;
575
576 /**
577 Returns a list of items in the back history. The first item in the
578 vector is the first page that was loaded by the control.
579 */
580 virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory() = 0;
581
582 /**
583 Returns a list of items in the forward history. The first item in the
584 vector is the next item in the history with respect to the curently
585 loaded page.
586 */
587 virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory() = 0;
588
589 /**
590 Navigate back in the history of visited pages.
591 Only valid if CanGoBack() returns true.
592 */
593 virtual void GoBack() = 0;
594
595 /**
596 Navigate forward in the history of visited pages.
597 Only valid if CanGoForward() returns true.
598 */
599 virtual void GoForward() = 0;
600
601 /**
602 Loads a history item.
603 */
604 virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item) = 0;
605
606 /**
607 @name Selection
608 */
609
610 /**
611 Clears the current selection.
612 */
613 virtual void ClearSelection() = 0;
614
615 /**
616 Deletes the current selection. Note that for @c wxWEBVIEW_BACKEND_WEBKIT
617 the selection must be editable, either through SetEditable or the
618 correct HTML attribute.
619 */
620 virtual void DeleteSelection() = 0;
621
622 /**
623 Returns the currently selected source, if any.
624 */
625 virtual wxString GetSelectedSource() const = 0;
626
627 /**
628 Returns the currently selected text, if any.
629 */
630 virtual wxString GetSelectedText() const = 0;
631
632 /**
633 Returns @true if there is a current selection.
634 */
635 virtual bool HasSelection() const = 0;
636
637 /**
638 Selects the entire page.
639 */
640 virtual void SelectAll() = 0;
641
642 /**
643 @name Undo / Redo
644 */
645
646 /**
647 Returns @true if there is an action to redo.
648 */
649 virtual bool CanRedo() const = 0;
650
651 /**
652 Returns @true if there is an action to undo.
653 */
654 virtual bool CanUndo() const = 0;
655
656 /**
657 Redos the last action.
658 */
659 virtual void Redo() = 0;
660
661 /**
662 Undos the last action.
663 */
664 virtual void Undo() = 0;
665
666 /**
667 @name Finding
668 */
669
670 /**
671 Finds a phrase on the current page and if found, the control will
672 scroll the phrase into view and select it.
673 @param text The phrase to search for.
674 @param flags The flags for the search.
675 @return If search phrase was not found in combination with the flags
676 then @c wxNOT_FOUND is returned. If called for the first time
677 with search phrase then the total number of results will be
678 returned. Then for every time its called with the same search
679 phrase it will return the number of the current match.
680 @note This function will restart the search if the flags
681 @c wxWEBVIEW_FIND_ENTIRE_WORD or @c wxWEBVIEW_FIND_MATCH_CASE
682 are changed, since this will require a new search. To reset the
683 search, for example reseting the highlights call the function
684 with an empty search phrase. This always returns @c wxNOT_FOUND
685 on the OSX WebKit backend.
686 @since 2.9.5
687 */
688 virtual long Find(const wxString& text, wxWebViewFindFlags flags = wxWEBVIEW_FIND_DEFAULT) = 0;
689
690 /**
691 @name Zoom
692 */
693
694 /**
695 Retrieve whether the current HTML engine supports a zoom type.
696 @param type The zoom type to test.
697 @return Whether this type of zoom is supported by this HTML engine
698 (and thus can be set through SetZoomType()).
699 */
700 virtual bool CanSetZoomType(wxWebViewZoomType type) const = 0;
701
702 /**
703 Get the zoom factor of the page.
704 @return The current level of zoom.
705 */
706 virtual wxWebViewZoom GetZoom() const = 0;
707
708 /**
709 Get how the zoom factor is currently interpreted.
710 @return How the zoom factor is currently interpreted by the HTML engine.
711 */
712 virtual wxWebViewZoomType GetZoomType() const = 0;
713
714 /**
715 Set the zoom factor of the page.
716 @param zoom How much to zoom (scale) the HTML document.
717 */
718 virtual void SetZoom(wxWebViewZoom zoom) = 0;
719
720 /**
721 Set how to interpret the zoom factor.
722 @param zoomType How the zoom factor should be interpreted by the
723 HTML engine.
724 @note invoke CanSetZoomType() first, some HTML renderers may not
725 support all zoom types.
726 */
727 virtual void SetZoomType(wxWebViewZoomType zoomType) = 0;
728 };
729
730
731
732
733 /**
734 @class wxWebViewEvent
735
736 A navigation event holds information about events associated with
737 wxWebView objects.
738
739 @beginEventEmissionTable{wxWebViewEvent}
740 @event{EVT_WEBVIEW_NAVIGATING(id, func)}
741 Process a @c wxEVT_WEBVIEW_NAVIGATING event, generated before trying
742 to get a resource. This event may be vetoed to prevent navigating to this
743 resource. Note that if the displayed HTML document has several frames, one
744 such event will be generated per frame.
745 @event{EVT_WEBVIEW_NAVIGATED(id, func)}
746 Process a @c wxEVT_WEBVIEW_NAVIGATED event generated after it was
747 confirmed that a resource would be requested. This event may not be vetoed.
748 Note that if the displayed HTML document has several frames, one such event
749 will be generated per frame.
750 @event{EVT_WEBVIEW_LOADED(id, func)}
751 Process a @c wxEVT_WEBVIEW_LOADED event generated when the document
752 is fully loaded and displayed. Note that if the displayed HTML document has
753 several frames, one such event will be generated per frame.
754 @event{EVT_WEBVIEW_ERROR(id, func)}
755 Process a @c wxEVT_WEBVIEW_ERROR event generated when a navigation
756 error occurs.
757 The integer associated with this event will be a wxWebNavigationError item.
758 The string associated with this event may contain a backend-specific more
759 precise error message/code.
760 @event{EVT_WEBVIEW_NEWWINDOW(id, func)}
761 Process a @c wxEVT_WEBVIEW_NEWWINDOW event, generated when a new
762 window is created. You must handle this event if you want anything to
763 happen, for example to load the page in a new window or tab.
764 @event{EVT_WEBVIEW_TITLE_CHANGED(id, func)}
765 Process a @c wxEVT_WEBVIEW_TITLE_CHANGED event, generated when
766 the page title changes. Use GetString to get the title.
767 @endEventTable
768
769 @since 2.9.3
770 @library{wxwebview}
771 @category{events,webview}
772
773 @see wxWebView
774 */
775 class wxWebViewEvent : public wxNotifyEvent
776 {
777 public:
778 wxWebViewEvent();
779 wxWebViewEvent(wxEventType type, int id, const wxString href,
780 const wxString target);
781
782 /**
783 Get the name of the target frame which the url of this event
784 has been or will be loaded into. This may return an emptry string
785 if the frame is not available.
786 */
787 const wxString& GetTarget() const;
788
789 /**
790 Get the URL being visited
791 */
792 const wxString& GetURL() const;
793 };
794
795
796 wxEventType wxEVT_WEBVIEW_NAVIGATING;
797 wxEventType wxEVT_WEBVIEW_NAVIGATED;
798 wxEventType wxEVT_WEBVIEW_LOADED;
799 wxEventType wxEVT_WEBVIEW_ERROR;
800 wxEventType wxEVT_WEBVIEW_NEWWINDOW;
801 wxEventType wxEVT_WEBVIEW_TITLE_CHANGED;