]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/webview.h
Add files necessary to run Expat configure.
[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 @c wxWEBVIEW_BACKEND_IE you must wait for the current
470 page to finish loading before calling SetPage(). The baseURL
471 parameter is not used in this backend.
472 */
473 virtual void SetPage(const wxString& html, const wxString& baseUrl) = 0;
474
475 /**
476 Set the displayed page source to the contents of the given stream.
477 @param html The stream to read HTML data from.
478 @param baseUrl URL assigned to the HTML data, to be used to resolve
479 relative paths, for instance.
480 */
481 virtual void SetPage(wxInputStream& html, wxString baseUrl);
482
483 /**
484 Stop the current page loading process, if any.
485 May trigger an error event of type @c wxWEBVIEW_NAV_ERR_USER_CANCELLED.
486 TODO: make @c wxWEBVIEW_NAV_ERR_USER_CANCELLED errors uniform across ports.
487 */
488 virtual void Stop() = 0;
489
490 /**
491 @name Clipboard
492 */
493
494 /**
495 Returns @true if the current selection can be copied.
496
497 @note This always returns @c true on the OSX WebKit backend.
498 */
499 virtual bool CanCopy() const = 0;
500
501 /**
502 Returns @true if the current selection can be cut.
503
504 @note This always returns @c true on the OSX WebKit backend.
505 */
506 virtual bool CanCut() const = 0;
507
508 /**
509 Returns @true if data can be pasted.
510
511 @note This always returns @c true on the OSX WebKit backend.
512 */
513 virtual bool CanPaste() const = 0;
514
515 /**
516 Copies the current selection.
517 */
518 virtual void Copy() = 0;
519
520 /**
521 Cuts the current selection.
522 */
523 virtual void Cut() = 0;
524
525 /**
526 Pastes the current data.
527 */
528 virtual void Paste() = 0;
529
530 /**
531 @name Context Menu
532 */
533
534 /**
535 Enable or disable the right click context menu.
536
537 By default the standard context menu is enabled, this method can be
538 used to disable it or re-enable it later.
539
540 @since 2.9.5
541 */
542 virtual void EnableContextMenu(bool enable = true);
543
544 /**
545 Returns @true if a context menu will be shown on right click.
546
547 @since 2.9.5
548 */
549 virtual bool IsContextMenuEnabled() const;
550
551 /**
552 @name History
553 */
554
555 /**
556 Returns @true if it is possible to navigate backward in the history of
557 visited pages.
558 */
559 virtual bool CanGoBack() const = 0;
560
561 /**
562 Returns @true if it is possible to navigate forward in the history of
563 visited pages.
564 */
565 virtual bool CanGoForward() const = 0;
566
567 /**
568 Clear the history, this will also remove the visible page.
569 */
570 virtual void ClearHistory() = 0;
571
572 /**
573 Enable or disable the history. This will also clear the history.
574 */
575 virtual void EnableHistory(bool enable = true) = 0;
576
577 /**
578 Returns a list of items in the back history. The first item in the
579 vector is the first page that was loaded by the control.
580 */
581 virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory() = 0;
582
583 /**
584 Returns a list of items in the forward history. The first item in the
585 vector is the next item in the history with respect to the curently
586 loaded page.
587 */
588 virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory() = 0;
589
590 /**
591 Navigate back in the history of visited pages.
592 Only valid if CanGoBack() returns true.
593 */
594 virtual void GoBack() = 0;
595
596 /**
597 Navigate forward in the history of visited pages.
598 Only valid if CanGoForward() returns true.
599 */
600 virtual void GoForward() = 0;
601
602 /**
603 Loads a history item.
604 */
605 virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item) = 0;
606
607 /**
608 @name Selection
609 */
610
611 /**
612 Clears the current selection.
613 */
614 virtual void ClearSelection() = 0;
615
616 /**
617 Deletes the current selection. Note that for @c wxWEBVIEW_BACKEND_WEBKIT
618 the selection must be editable, either through SetEditable or the
619 correct HTML attribute.
620 */
621 virtual void DeleteSelection() = 0;
622
623 /**
624 Returns the currently selected source, if any.
625 */
626 virtual wxString GetSelectedSource() const = 0;
627
628 /**
629 Returns the currently selected text, if any.
630 */
631 virtual wxString GetSelectedText() const = 0;
632
633 /**
634 Returns @true if there is a current selection.
635 */
636 virtual bool HasSelection() const = 0;
637
638 /**
639 Selects the entire page.
640 */
641 virtual void SelectAll() = 0;
642
643 /**
644 @name Undo / Redo
645 */
646
647 /**
648 Returns @true if there is an action to redo.
649 */
650 virtual bool CanRedo() const = 0;
651
652 /**
653 Returns @true if there is an action to undo.
654 */
655 virtual bool CanUndo() const = 0;
656
657 /**
658 Redos the last action.
659 */
660 virtual void Redo() = 0;
661
662 /**
663 Undos the last action.
664 */
665 virtual void Undo() = 0;
666
667 /**
668 @name Finding
669 */
670
671 /**
672 Finds a phrase on the current page and if found, the control will
673 scroll the phrase into view and select it.
674 @param text The phrase to search for.
675 @param flags The flags for the search.
676 @return If search phrase was not found in combination with the flags
677 then @c wxNOT_FOUND is returned. If called for the first time
678 with search phrase then the total number of results will be
679 returned. Then for every time its called with the same search
680 phrase it will return the number of the current match.
681 @note This function will restart the search if the flags
682 @c wxWEBVIEW_FIND_ENTIRE_WORD or @c wxWEBVIEW_FIND_MATCH_CASE
683 are changed, since this will require a new search. To reset the
684 search, for example reseting the highlights call the function
685 with an empty search phrase. This always returns @c wxNOT_FOUND
686 on the OSX WebKit backend.
687 @since 2.9.5
688 */
689 virtual long Find(const wxString& text, wxWebViewFindFlags flags = wxWEBVIEW_FIND_DEFAULT) = 0;
690
691 /**
692 @name Zoom
693 */
694
695 /**
696 Retrieve whether the current HTML engine supports a zoom type.
697 @param type The zoom type to test.
698 @return Whether this type of zoom is supported by this HTML engine
699 (and thus can be set through SetZoomType()).
700 */
701 virtual bool CanSetZoomType(wxWebViewZoomType type) const = 0;
702
703 /**
704 Get the zoom factor of the page.
705 @return The current level of zoom.
706 */
707 virtual wxWebViewZoom GetZoom() const = 0;
708
709 /**
710 Get how the zoom factor is currently interpreted.
711 @return How the zoom factor is currently interpreted by the HTML engine.
712 */
713 virtual wxWebViewZoomType GetZoomType() const = 0;
714
715 /**
716 Set the zoom factor of the page.
717 @param zoom How much to zoom (scale) the HTML document.
718 */
719 virtual void SetZoom(wxWebViewZoom zoom) = 0;
720
721 /**
722 Set how to interpret the zoom factor.
723 @param zoomType How the zoom factor should be interpreted by the
724 HTML engine.
725 @note invoke CanSetZoomType() first, some HTML renderers may not
726 support all zoom types.
727 */
728 virtual void SetZoomType(wxWebViewZoomType zoomType) = 0;
729 };
730
731
732
733
734 /**
735 @class wxWebViewEvent
736
737 A navigation event holds information about events associated with
738 wxWebView objects.
739
740 @beginEventEmissionTable{wxWebViewEvent}
741 @event{EVT_WEBVIEW_NAVIGATING(id, func)}
742 Process a @c wxEVT_WEBVIEW_NAVIGATING event, generated before trying
743 to get a resource. This event may be vetoed to prevent navigating to this
744 resource. Note that if the displayed HTML document has several frames, one
745 such event will be generated per frame.
746 @event{EVT_WEBVIEW_NAVIGATED(id, func)}
747 Process a @c wxEVT_WEBVIEW_NAVIGATED event generated after it was
748 confirmed that a resource would be requested. This event may not be vetoed.
749 Note that if the displayed HTML document has several frames, one such event
750 will be generated per frame.
751 @event{EVT_WEBVIEW_LOADED(id, func)}
752 Process a @c wxEVT_WEBVIEW_LOADED event generated when the document
753 is fully loaded and displayed. Note that if the displayed HTML document has
754 several frames, one such event will be generated per frame.
755 @event{EVT_WEBVIEW_ERROR(id, func)}
756 Process a @c wxEVT_WEBVIEW_ERROR event generated when a navigation
757 error occurs.
758 The integer associated with this event will be a #wxWebViewNavigationError item.
759 The string associated with this event may contain a backend-specific more
760 precise error message/code.
761 @event{EVT_WEBVIEW_NEWWINDOW(id, func)}
762 Process a @c wxEVT_WEBVIEW_NEWWINDOW event, generated when a new
763 window is created. You must handle this event if you want anything to
764 happen, for example to load the page in a new window or tab.
765 @event{EVT_WEBVIEW_TITLE_CHANGED(id, func)}
766 Process a @c wxEVT_WEBVIEW_TITLE_CHANGED event, generated when
767 the page title changes. Use GetString to get the title.
768 @endEventTable
769
770 @since 2.9.3
771 @library{wxwebview}
772 @category{events,webview}
773
774 @see wxWebView
775 */
776 class wxWebViewEvent : public wxNotifyEvent
777 {
778 public:
779 wxWebViewEvent();
780 wxWebViewEvent(wxEventType type, int id, const wxString href,
781 const wxString target);
782
783 /**
784 Get the name of the target frame which the url of this event
785 has been or will be loaded into. This may return an emptry string
786 if the frame is not available.
787 */
788 const wxString& GetTarget() const;
789
790 /**
791 Get the URL being visited
792 */
793 const wxString& GetURL() const;
794 };
795
796
797 wxEventType wxEVT_WEBVIEW_NAVIGATING;
798 wxEventType wxEVT_WEBVIEW_NAVIGATED;
799 wxEventType wxEVT_WEBVIEW_LOADED;
800 wxEventType wxEVT_WEBVIEW_ERROR;
801 wxEventType wxEVT_WEBVIEW_NEWWINDOW;
802 wxEventType wxEVT_WEBVIEW_TITLE_CHANGED;