2011-07-02 12:24:56 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: webview.h
|
|
|
|
// Purpose: interface of wxWebView
|
|
|
|
// Author: wxWidgets team
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
2012-02-18 14:59:59 -05:00
|
|
|
Zoom levels available in wxWebView
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
enum wxWebViewZoom
|
|
|
|
{
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_ZOOM_TINY,
|
|
|
|
wxWEBVIEW_ZOOM_SMALL,
|
|
|
|
wxWEBVIEW_ZOOM_MEDIUM, //!< default size
|
|
|
|
wxWEBVIEW_ZOOM_LARGE,
|
|
|
|
wxWEBVIEW_ZOOM_LARGEST
|
2011-07-02 12:24:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
The type of zooming that the web view control can perform
|
|
|
|
*/
|
|
|
|
enum wxWebViewZoomType
|
|
|
|
{
|
2012-03-28 14:00:30 -04:00
|
|
|
/**
|
|
|
|
The entire layout scales when zooming, including images
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_ZOOM_TYPE_LAYOUT,
|
2012-03-28 14:00:30 -04:00
|
|
|
/**
|
2011-07-02 12:24:56 -04:00
|
|
|
Only the text changes in size when zooming, images and other layout
|
2012-03-28 14:00:30 -04:00
|
|
|
elements retain their initial size
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_ZOOM_TYPE_TEXT
|
2011-07-02 12:24:56 -04:00
|
|
|
};
|
|
|
|
|
2012-03-28 14:00:30 -04:00
|
|
|
/**
|
2011-07-02 12:24:56 -04:00
|
|
|
Types of errors that can cause navigation to fail
|
|
|
|
*/
|
2011-08-15 07:03:26 -04:00
|
|
|
enum wxWebViewNavigationError
|
2011-07-02 12:24:56 -04:00
|
|
|
{
|
|
|
|
/** Connection error (timeout, etc.) */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_CONNECTION,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** Invalid certificate */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_CERTIFICATE,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** Authentication required */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_AUTH,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** Other security error */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_SECURITY,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** Requested resource not found */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_NOT_FOUND,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** Invalid request/parameters (e.g. bad URL, bad protocol,
|
|
|
|
unsupported resource type) */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_REQUEST,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** The user cancelled (e.g. in a dialog) */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_USER_CANCELLED,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** Another (exotic) type of error that didn't fit in other categories*/
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_NAV_ERR_OTHER
|
2011-07-02 12:24:56 -04:00
|
|
|
};
|
|
|
|
|
2012-03-28 14:00:30 -04:00
|
|
|
/**
|
|
|
|
Type of refresh
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
enum wxWebViewReloadFlags
|
|
|
|
{
|
|
|
|
/** Default reload, will access cache */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_RELOAD_DEFAULT,
|
2011-07-02 12:24:56 -04:00
|
|
|
/** Reload the current view without accessing the cache */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_RELOAD_NO_CACHE
|
2011-07-02 12:24:56 -04:00
|
|
|
};
|
|
|
|
|
2012-08-28 13:13:13 -04:00
|
|
|
/**
|
|
|
|
Find flags used when searching for text on page.
|
|
|
|
*/
|
|
|
|
enum wxWebViewFindFlags
|
|
|
|
{
|
|
|
|
/** Causes the search to restart when end or beginning reached */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_FIND_WRAP = 0x0001,
|
2012-08-28 13:13:13 -04:00
|
|
|
|
|
|
|
/** Matches an entire word when searching */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002,
|
2012-08-28 13:13:13 -04:00
|
|
|
|
|
|
|
/** Match case, i.e. case sensitive searching */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_FIND_MATCH_CASE = 0x0004,
|
2012-08-28 13:13:13 -04:00
|
|
|
|
|
|
|
/** Highlights the search results */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008,
|
2012-08-28 13:13:13 -04:00
|
|
|
|
|
|
|
/** Searches for phrase in backward direction */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_FIND_BACKWARDS = 0x0010,
|
2012-08-28 13:13:13 -04:00
|
|
|
|
|
|
|
/** The default flag, which is simple searching */
|
2013-02-01 04:38:53 -05:00
|
|
|
wxWEBVIEW_FIND_DEFAULT = 0
|
2012-08-28 13:13:13 -04:00
|
|
|
};
|
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
2011-08-15 08:31:31 -04:00
|
|
|
@class wxWebViewHistoryItem
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
A simple class that contains the URL and title of an element of the history
|
2012-03-28 14:00:30 -04:00
|
|
|
of a wxWebView.
|
|
|
|
|
2011-09-10 14:09:12 -04:00
|
|
|
@since 2.9.3
|
2011-08-19 09:30:46 -04:00
|
|
|
@library{wxwebview}
|
|
|
|
@category{webview}
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-02 13:11:46 -04:00
|
|
|
@see wxWebView
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2011-08-15 08:31:31 -04:00
|
|
|
class wxWebViewHistoryItem
|
2011-07-02 12:24:56 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Construtor.
|
|
|
|
*/
|
2011-08-15 08:31:31 -04:00
|
|
|
wxWebViewHistoryItem(const wxString& url, const wxString& title);
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
|
|
|
@return The url of the page.
|
|
|
|
*/
|
|
|
|
wxString GetUrl();
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
|
|
|
@return The title of the page.
|
|
|
|
*/
|
|
|
|
wxString GetTitle();
|
|
|
|
};
|
|
|
|
|
2013-01-13 14:22:24 -05:00
|
|
|
/**
|
|
|
|
@class wxWebViewFactory
|
|
|
|
|
|
|
|
An abstract factory class for creating wxWebView backends. Each
|
|
|
|
implementation of wxWebView should have its own factory.
|
|
|
|
|
|
|
|
@since 2.9.5
|
|
|
|
@library{wxwebview}
|
|
|
|
@category{webview}
|
|
|
|
|
|
|
|
@see wxWebView
|
|
|
|
*/
|
|
|
|
class wxWebViewFactory : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Function to create a new wxWebView with two-step creation,
|
|
|
|
wxWebView::Create should be called on the returned object.
|
|
|
|
@return the created wxWebView
|
|
|
|
*/
|
|
|
|
virtual wxWebView* Create() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Function to create a new wxWebView with parameters.
|
|
|
|
@param parent Parent window for the control
|
|
|
|
@param id ID of this control
|
|
|
|
@param url Initial URL to load
|
|
|
|
@param pos Position of the control
|
|
|
|
@param size Size of the control
|
2013-07-21 06:30:22 -04:00
|
|
|
@param style
|
|
|
|
Window style. For generic window styles, please see wxWindow.
|
|
|
|
@param name Window name.
|
2013-01-13 14:22:24 -05:00
|
|
|
@return the created wxWebView
|
|
|
|
*/
|
|
|
|
virtual wxWebView* Create(wxWindow* parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& url = wxWebViewDefaultURLStr,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxWebViewNameStr) = 0;
|
|
|
|
};
|
|
|
|
|
2011-08-04 14:46:49 -04:00
|
|
|
/**
|
2011-08-14 08:15:34 -04:00
|
|
|
@class wxWebViewHandler
|
2012-03-28 14:00:30 -04:00
|
|
|
|
|
|
|
The base class for handling custom schemes in wxWebView, for example to
|
2011-08-04 14:46:49 -04:00
|
|
|
allow virtual file system support.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-09-10 14:09:12 -04:00
|
|
|
@since 2.9.3
|
2011-08-19 09:30:46 -04:00
|
|
|
@library{wxwebview}
|
|
|
|
@category{webview}
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-08-04 14:46:49 -04:00
|
|
|
@see wxWebView
|
|
|
|
*/
|
2011-08-14 08:15:34 -04:00
|
|
|
class wxWebViewHandler
|
2011-08-04 14:46:49 -04:00
|
|
|
{
|
|
|
|
public:
|
2011-08-14 08:15:34 -04:00
|
|
|
/**
|
|
|
|
Constructor. Takes the name of the scheme that will be handled by this
|
|
|
|
class for example @c file or @c zip.
|
|
|
|
*/
|
|
|
|
wxWebViewHandler(const wxString& scheme);
|
|
|
|
|
2011-08-04 14:46:49 -04:00
|
|
|
/**
|
|
|
|
@return A pointer to the file represented by @c uri.
|
2012-03-28 14:00:30 -04:00
|
|
|
*/
|
2011-08-04 14:46:49 -04:00
|
|
|
virtual wxFSFile* GetFile(const wxString &uri) = 0;
|
|
|
|
|
|
|
|
/**
|
2011-08-14 08:15:34 -04:00
|
|
|
@return The name of the scheme, as passed to the constructor.
|
2011-08-04 14:46:49 -04:00
|
|
|
*/
|
2011-11-16 20:25:56 -05:00
|
|
|
virtual wxString GetName() const;
|
2011-08-04 14:46:49 -04:00
|
|
|
};
|
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
|
|
|
@class wxWebView
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
This control may be used to render web (HTML / CSS / javascript) documents.
|
2012-03-28 14:00:30 -04:00
|
|
|
It is designed to allow the creation of multiple backends for each port,
|
2011-08-08 10:03:15 -04:00
|
|
|
although currently just one is available. It differs from wxHtmlWindow in
|
|
|
|
that each backend is actually a full rendering engine, Trident on MSW and
|
2015-06-04 18:54:02 -04:00
|
|
|
Webkit on OS X and GTK. This allows the correct viewing of complex pages with
|
2012-03-28 14:00:30 -04:00
|
|
|
javascript and css.
|
|
|
|
|
2011-08-08 08:05:58 -04:00
|
|
|
@section descriptions Backend Descriptions
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2013-02-01 04:38:53 -05:00
|
|
|
@par wxWEBVIEW_BACKEND_IE (MSW)
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-08-08 08:12:51 -04:00
|
|
|
The IE backend uses Microsoft's Trident rendering engine, specifically the
|
2011-08-08 08:05:58 -04:00
|
|
|
version used by the locally installed copy of Internet Explorer. As such it
|
2012-03-28 14:00:30 -04:00
|
|
|
is only available for the MSW port. By default recent versions of the
|
2011-08-08 08:05:58 -04:00
|
|
|
<a href="http://msdn.microsoft.com/en-us/library/aa752085%28v=VS.85%29.aspx">WebBrowser</a>
|
|
|
|
control, which this backend uses, emulate Internet Explorer 7. This can be
|
2012-03-28 14:00:30 -04:00
|
|
|
changed with a registry setting, see
|
2011-07-04 07:34:33 -04:00
|
|
|
<a href="http://msdn.microsoft.com/en-us/library/ee330730%28v=vs.85%29.aspx#browser_emulation">
|
2011-08-08 08:05:58 -04:00
|
|
|
this</a> article for more information. This backend has full support for
|
2011-10-02 12:20:15 -04:00
|
|
|
custom schemes and virtual file systems.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2013-02-01 04:38:53 -05:00
|
|
|
@par wxWEBVIEW_WEBKIT (GTK)
|
2012-03-28 14:00:30 -04:00
|
|
|
|
|
|
|
Under GTK the WebKit backend uses
|
2011-08-08 08:05:58 -04:00
|
|
|
<a href="http://webkitgtk.org/">WebKitGTK+</a>. The current minimum version
|
2011-08-08 08:12:51 -04:00
|
|
|
required is 1.3.1 which ships by default with Ubuntu Natty and Debian
|
2012-03-28 14:00:30 -04:00
|
|
|
Wheezy and has the package name libwebkitgtk-dev. Custom schemes and
|
2011-08-08 08:12:51 -04:00
|
|
|
virtual files systems are supported under this backend, however embedded
|
2011-08-12 06:49:52 -04:00
|
|
|
resources such as images and stylesheets are currently loaded using the
|
|
|
|
data:// scheme.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2013-02-01 04:38:53 -05:00
|
|
|
@par wxWEBVIEW_WEBKIT (OSX)
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2015-06-04 18:54:02 -04:00
|
|
|
The OS X WebKit backend uses Apple's
|
2011-08-08 08:05:58 -04:00
|
|
|
<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>
|
2011-08-12 06:49:52 -04:00
|
|
|
class. This backend has full support for custom schemes and virtual file
|
|
|
|
systems.
|
2011-08-08 07:22:40 -04:00
|
|
|
|
|
|
|
@section async Asynchronous Notifications
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-08-08 07:22:40 -04:00
|
|
|
Many of the methods in wxWebView are asynchronous, i.e. they return
|
|
|
|
immediately and perform their work in the background. This includes
|
2013-02-27 03:12:42 -05:00
|
|
|
functions such as LoadURL() and Reload(). To receive notification of the
|
2011-08-08 07:22:40 -04:00
|
|
|
progress and completion of these functions you need to handle the events
|
2013-04-25 06:11:03 -04:00
|
|
|
that are provided. Specifically @c wxEVT_WEBVIEW_LOADED notifies
|
2012-03-28 14:00:30 -04:00
|
|
|
when the page or a sub-frame has finished loading and
|
2013-04-25 06:11:03 -04:00
|
|
|
@c wxEVT_WEBVIEW_ERROR notifies that an error has occurred.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-08-04 14:46:49 -04:00
|
|
|
@section vfs Virtual File Systems and Custom Schemes
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-08-04 14:46:49 -04:00
|
|
|
wxWebView supports the registering of custom scheme handlers, for example
|
2012-03-28 14:00:30 -04:00
|
|
|
@c file or @c http. To do this create a new class which inherits from
|
|
|
|
wxWebViewHandler, where wxWebHandler::GetFile() returns a pointer to a
|
2011-08-04 14:46:49 -04:00
|
|
|
wxFSFile which represents the given url. You can then register your handler
|
|
|
|
with RegisterHandler() it will be called for all pages and resources.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2012-09-11 05:26:58 -04:00
|
|
|
wxWebViewFSHandler is provided to access the virtual file system encapsulated by
|
|
|
|
wxFileSystem. The wxMemoryFSHandler documentation gives an example of how this
|
|
|
|
may be used.
|
|
|
|
|
|
|
|
wxWebViewArchiveHandler is provided to allow the navigation of pages inside a zip
|
|
|
|
archive. It supports paths of the form:
|
|
|
|
@c scheme:///C:/example/docs.zip;protocol=zip/main.htm
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-08-15 07:03:26 -04:00
|
|
|
@beginEventEmissionTable{wxWebViewEvent}
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_NAVIGATING(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_NAVIGATING event, generated before trying
|
2011-07-02 12:24:56 -04:00
|
|
|
to get a resource. This event may be vetoed to prevent navigating to this
|
|
|
|
resource. Note that if the displayed HTML document has several frames, one
|
|
|
|
such event will be generated per frame.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_NAVIGATED(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_NAVIGATED event generated after it was
|
2011-07-02 12:24:56 -04:00
|
|
|
confirmed that a resource would be requested. This event may not be vetoed.
|
|
|
|
Note that if the displayed HTML document has several frames, one such event
|
|
|
|
will be generated per frame.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_LOADED(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_LOADED event generated when the document
|
2012-03-28 14:00:30 -04:00
|
|
|
is fully loaded and displayed. Note that if the displayed HTML document has
|
2011-07-04 14:27:14 -04:00
|
|
|
several frames, one such event will be generated per frame.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_ERROR(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_ERROR event generated when a navigation
|
2011-07-02 12:24:56 -04:00
|
|
|
error occurs.
|
|
|
|
The integer associated with this event will be a wxWebNavigationError item.
|
|
|
|
The string associated with this event may contain a backend-specific more
|
|
|
|
precise error message/code.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_NEWWINDOW(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_NEWWINDOW event, generated when a new
|
2012-03-28 14:00:30 -04:00
|
|
|
window is created. You must handle this event if you want anything to
|
2011-07-25 09:23:05 -04:00
|
|
|
happen, for example to load the page in a new window or tab.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_TITLE_CHANGED(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_TITLE_CHANGED event, generated when
|
2011-07-30 07:26:55 -04:00
|
|
|
the page title changes. Use GetString to get the title.
|
2011-07-02 12:24:56 -04:00
|
|
|
@endEventTable
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-09-10 14:09:12 -04:00
|
|
|
@since 2.9.3
|
2011-08-19 09:30:46 -04:00
|
|
|
@library{wxwebview}
|
|
|
|
@category{ctrl,webview}
|
2011-08-17 07:19:29 -04:00
|
|
|
@see wxWebViewHandler, wxWebViewEvent
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
class wxWebView : public wxControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
Creation function for two-step creation.
|
|
|
|
*/
|
|
|
|
virtual bool Create(wxWindow* parent,
|
|
|
|
wxWindowID id,
|
2011-11-16 20:25:56 -05:00
|
|
|
const wxString& url = wxWebViewDefaultURLStr,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxWebViewNameStr) = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
2013-01-13 14:22:24 -05:00
|
|
|
Factory function to create a new wxWebView with two-step creation,
|
|
|
|
wxWebView::Create should be called on the returned object.
|
|
|
|
@param backend The backend web rendering engine to use.
|
|
|
|
@c wxWebViewBackendDefault, @c wxWebViewBackendIE and
|
|
|
|
@c wxWebViewBackendWebKit are predefined where appropriate.
|
|
|
|
@return The created wxWebView
|
|
|
|
@since 2.9.5
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2013-01-13 14:22:24 -05:00
|
|
|
static wxWebView* New(const wxString& backend = wxWebViewBackendDefault);
|
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
2013-01-13 14:22:24 -05:00
|
|
|
Factory function to create a new wxWebView using a wxWebViewFactory.
|
|
|
|
@param parent Parent window for the control
|
2011-07-02 12:24:56 -04:00
|
|
|
@param id ID of this control
|
2013-01-13 14:22:24 -05:00
|
|
|
@param url Initial URL to load
|
|
|
|
@param pos Position of the control
|
|
|
|
@param size Size of the control
|
|
|
|
@param backend The backend web rendering engine to use.
|
|
|
|
@c wxWebViewBackendDefault, @c wxWebViewBackendIE and
|
|
|
|
@c wxWebViewBackendWebKit are predefined where appropriate.
|
2013-07-21 06:30:22 -04:00
|
|
|
@param style
|
|
|
|
Window style. For generic window styles, please see wxWindow.
|
|
|
|
@param name Window name.
|
2013-01-13 14:22:24 -05:00
|
|
|
@return The created wxWebView, or @c NULL if the requested backend
|
2011-07-02 12:24:56 -04:00
|
|
|
is not available
|
2013-01-13 14:22:24 -05:00
|
|
|
@since 2.9.5
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
static wxWebView* New(wxWindow* parent,
|
2013-01-13 14:22:24 -05:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& url = wxWebViewDefaultURLStr,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
const wxString& backend = wxWebViewBackendDefault,
|
|
|
|
long style = 0,
|
|
|
|
const wxString& name = wxWebViewNameStr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Allows the registering of new backend for wxWebView. @a backend can be
|
|
|
|
used as an argument to New().
|
|
|
|
@param backend The name for the new backend to be registered under
|
|
|
|
@param factory A shared pointer to the factory which creates the
|
|
|
|
appropriate backend.
|
|
|
|
@since 2.9.5
|
|
|
|
*/
|
|
|
|
static void RegisterFactory(const wxString& backend,
|
|
|
|
wxSharedPtr<wxWebViewFactory> factory);
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the title of the current web page, or its URL/path if title is not
|
|
|
|
available.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual wxString GetCurrentTitle() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the URL of the currently displayed document.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual wxString GetCurrentURL() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
2012-07-24 17:59:21 -04:00
|
|
|
/**
|
|
|
|
Return the pointer to the native backend used by this control.
|
|
|
|
|
|
|
|
This method can be used to retrieve the pointer to the native rendering
|
|
|
|
engine used by this control. The return value needs to be down-casted
|
|
|
|
to the appropriate type depending on the platform: under Windows, it's
|
|
|
|
a pointer to IWebBrowser2 interface, under OS X it's a WebView pointer
|
|
|
|
and under GTK it's a WebKitWebView.
|
|
|
|
|
|
|
|
For example, you could set the WebKit options using this method:
|
|
|
|
@code
|
|
|
|
#include <webkit/webkit.h>
|
|
|
|
|
|
|
|
#ifdef __WXGTK__
|
|
|
|
WebKitWebView*
|
|
|
|
wv = static_cast<WebKitWebView*>(m_window->GetNativeBackend());
|
|
|
|
|
|
|
|
WebKitWebSettings* settings = webkit_web_view_get_settings(wv);
|
|
|
|
g_object_set(G_OBJECT(settings),
|
|
|
|
"enable-frame-flattening", TRUE,
|
|
|
|
NULL);
|
|
|
|
#endif
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@since 2.9.5
|
|
|
|
*/
|
|
|
|
virtual void* GetNativeBackend() const = 0;
|
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
|
|
|
Get the HTML source code of the currently displayed document.
|
|
|
|
@return The HTML source code, or an empty string if no page is currently
|
|
|
|
shown.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual wxString GetPageSource() const = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-13 13:25:05 -04:00
|
|
|
/**
|
|
|
|
Get the text of the current page.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual wxString GetPageText() const = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
2012-11-30 19:14:07 -05:00
|
|
|
Returns whether the web control is currently busy (e.g.\ loading a page).
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool IsBusy() const = 0;
|
2011-07-08 15:34:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns whether the web control is currently editable
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool IsEditable() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Load a web page from a URL
|
|
|
|
@param url The URL of the page to be loaded.
|
|
|
|
@note Web engines generally report errors asynchronously, so if you wish
|
|
|
|
to know whether loading the URL was successful, register to receive
|
|
|
|
navigation error events.
|
|
|
|
*/
|
2011-08-17 06:55:59 -04:00
|
|
|
virtual void LoadURL(const wxString& url) = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Opens a print dialog so that the user may print the currently
|
|
|
|
displayed page.
|
|
|
|
*/
|
|
|
|
virtual void Print() = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-08-04 14:46:49 -04:00
|
|
|
/**
|
|
|
|
Registers a custom scheme handler.
|
2011-08-08 11:12:33 -04:00
|
|
|
@param handler A shared pointer to a wxWebHandler.
|
2011-08-04 14:46:49 -04:00
|
|
|
*/
|
2011-08-14 08:15:34 -04:00
|
|
|
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Reload the currently displayed URL.
|
|
|
|
@param flags A bit array that may optionally contain reload options.
|
|
|
|
*/
|
2013-02-01 04:38:53 -05:00
|
|
|
virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-15 08:38:47 -04:00
|
|
|
/**
|
2012-03-28 14:00:30 -04:00
|
|
|
Runs the given javascript code.
|
2013-02-01 04:38:53 -05:00
|
|
|
@note When using wxWEBVIEW_BACKEND_IE you must wait for the current
|
2012-10-28 17:01:06 -04:00
|
|
|
page to finish loading before calling RunScript().
|
2011-07-15 08:38:47 -04:00
|
|
|
*/
|
|
|
|
virtual void RunScript(const wxString& javascript) = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-08 15:34:56 -04:00
|
|
|
/**
|
|
|
|
Set the editable property of the web control. Enabling allows the user
|
|
|
|
to edit the page even if the @c contenteditable attribute is not set.
|
|
|
|
The exact capabilities vary with the backend being used.
|
|
|
|
*/
|
|
|
|
virtual void SetEditable(bool enable = true) = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set the displayed page source to the contents of the given string.
|
|
|
|
@param html The string that contains the HTML data to display.
|
|
|
|
@param baseUrl URL assigned to the HTML data, to be used to resolve
|
|
|
|
relative paths, for instance.
|
2013-05-24 10:04:56 -04:00
|
|
|
@note When using @c wxWEBVIEW_BACKEND_IE you must wait for the current
|
|
|
|
page to finish loading before calling SetPage(). The baseURL
|
|
|
|
parameter is not used in this backend.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
virtual void SetPage(const wxString& html, const wxString& baseUrl) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the displayed page source to the contents of the given stream.
|
|
|
|
@param html The stream to read HTML data from.
|
|
|
|
@param baseUrl URL assigned to the HTML data, to be used to resolve
|
|
|
|
relative paths, for instance.
|
|
|
|
*/
|
2011-07-15 14:49:40 -04:00
|
|
|
virtual void SetPage(wxInputStream& html, wxString baseUrl);
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Stop the current page loading process, if any.
|
2013-02-01 04:38:53 -05:00
|
|
|
May trigger an error event of type @c wxWEBVIEW_NAV_ERR_USER_CANCELLED.
|
|
|
|
TODO: make @c wxWEBVIEW_NAV_ERR_USER_CANCELLED errors uniform across ports.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
virtual void Stop() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
@name Clipboard
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the current selection can be copied.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2015-06-04 18:54:02 -04:00
|
|
|
@note This always returns @c true on the OS X WebKit backend.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool CanCopy() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the current selection can be cut.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2015-06-04 18:54:02 -04:00
|
|
|
@note This always returns @c true on the OS X WebKit backend.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool CanCut() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if data can be pasted.
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2015-06-04 18:54:02 -04:00
|
|
|
@note This always returns @c true on the OS X WebKit backend.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool CanPaste() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
2012-03-28 14:00:30 -04:00
|
|
|
Copies the current selection.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
virtual void Copy() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Cuts the current selection.
|
|
|
|
*/
|
|
|
|
virtual void Cut() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Pastes the current data.
|
|
|
|
*/
|
|
|
|
virtual void Paste() = 0;
|
|
|
|
|
2012-12-31 08:21:21 -05:00
|
|
|
/**
|
|
|
|
@name Context Menu
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2012-12-31 08:40:17 -05:00
|
|
|
Enable or disable the right click context menu.
|
|
|
|
|
|
|
|
By default the standard context menu is enabled, this method can be
|
|
|
|
used to disable it or re-enable it later.
|
|
|
|
|
|
|
|
@since 2.9.5
|
2012-12-31 08:21:21 -05:00
|
|
|
*/
|
|
|
|
virtual void EnableContextMenu(bool enable = true);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if a context menu will be shown on right click.
|
2012-12-31 08:40:17 -05:00
|
|
|
|
|
|
|
@since 2.9.5
|
2012-12-31 08:21:21 -05:00
|
|
|
*/
|
|
|
|
virtual bool IsContextMenuEnabled() const;
|
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
|
|
|
@name History
|
|
|
|
*/
|
|
|
|
|
2012-03-28 14:00:30 -04:00
|
|
|
/**
|
2011-07-02 12:24:56 -04:00
|
|
|
Returns @true if it is possible to navigate backward in the history of
|
|
|
|
visited pages.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool CanGoBack() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
2012-03-28 14:00:30 -04:00
|
|
|
/**
|
2011-07-02 12:24:56 -04:00
|
|
|
Returns @true if it is possible to navigate forward in the history of
|
|
|
|
visited pages.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool CanGoForward() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Clear the history, this will also remove the visible page.
|
|
|
|
*/
|
|
|
|
virtual void ClearHistory() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Enable or disable the history. This will also clear the history.
|
|
|
|
*/
|
|
|
|
virtual void EnableHistory(bool enable = true) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns a list of items in the back history. The first item in the
|
|
|
|
vector is the first page that was loaded by the control.
|
|
|
|
*/
|
2011-08-15 08:31:31 -04:00
|
|
|
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory() = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
2012-03-28 14:00:30 -04:00
|
|
|
Returns a list of items in the forward history. The first item in the
|
2013-10-26 14:51:16 -04:00
|
|
|
vector is the next item in the history with respect to the currently
|
2011-07-02 12:24:56 -04:00
|
|
|
loaded page.
|
|
|
|
*/
|
2011-08-15 08:31:31 -04:00
|
|
|
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory() = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
2012-03-28 14:00:30 -04:00
|
|
|
/**
|
2011-07-02 12:24:56 -04:00
|
|
|
Navigate back in the history of visited pages.
|
|
|
|
Only valid if CanGoBack() returns true.
|
|
|
|
*/
|
|
|
|
virtual void GoBack() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Navigate forward in the history of visited pages.
|
|
|
|
Only valid if CanGoForward() returns true.
|
|
|
|
*/
|
|
|
|
virtual void GoForward() = 0;
|
|
|
|
|
|
|
|
/**
|
2012-03-28 14:00:30 -04:00
|
|
|
Loads a history item.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
2011-08-15 08:31:31 -04:00
|
|
|
virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item) = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-09 10:31:29 -04:00
|
|
|
/**
|
|
|
|
@name Selection
|
|
|
|
*/
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-15 05:36:08 -04:00
|
|
|
/**
|
2012-03-28 14:00:30 -04:00
|
|
|
Clears the current selection.
|
2011-07-15 05:36:08 -04:00
|
|
|
*/
|
|
|
|
virtual void ClearSelection() = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-09 10:31:29 -04:00
|
|
|
/**
|
2013-02-01 04:38:53 -05:00
|
|
|
Deletes the current selection. Note that for @c wxWEBVIEW_BACKEND_WEBKIT
|
2012-03-28 14:00:30 -04:00
|
|
|
the selection must be editable, either through SetEditable or the
|
2011-07-09 10:31:29 -04:00
|
|
|
correct HTML attribute.
|
|
|
|
*/
|
|
|
|
virtual void DeleteSelection() = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-11 14:26:07 -04:00
|
|
|
/**
|
2011-07-13 11:30:25 -04:00
|
|
|
Returns the currently selected source, if any.
|
2011-07-11 14:26:07 -04:00
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual wxString GetSelectedSource() const = 0;
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-07-10 14:11:43 -04:00
|
|
|
/**
|
|
|
|
Returns the currently selected text, if any.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual wxString GetSelectedText() const = 0;
|
2011-07-09 10:31:29 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if there is a current selection.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool HasSelection() const = 0;
|
2011-07-09 10:31:29 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Selects the entire page.
|
|
|
|
*/
|
|
|
|
virtual void SelectAll() = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
@name Undo / Redo
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if there is an action to redo.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool CanRedo() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if there is an action to undo.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual bool CanUndo() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Redos the last action.
|
|
|
|
*/
|
|
|
|
virtual void Redo() = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Undos the last action.
|
|
|
|
*/
|
|
|
|
virtual void Undo() = 0;
|
|
|
|
|
2012-08-28 13:13:13 -04:00
|
|
|
/**
|
|
|
|
@name Finding
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
Finds a phrase on the current page and if found, the control will
|
|
|
|
scroll the phrase into view and select it.
|
|
|
|
@param text The phrase to search for.
|
|
|
|
@param flags The flags for the search.
|
|
|
|
@return If search phrase was not found in combination with the flags
|
|
|
|
then @c wxNOT_FOUND is returned. If called for the first time
|
2012-09-11 05:26:58 -04:00
|
|
|
with search phrase then the total number of results will be
|
2012-08-28 13:13:13 -04:00
|
|
|
returned. Then for every time its called with the same search
|
|
|
|
phrase it will return the number of the current match.
|
|
|
|
@note This function will restart the search if the flags
|
2013-02-01 04:38:53 -05:00
|
|
|
@c wxWEBVIEW_FIND_ENTIRE_WORD or @c wxWEBVIEW_FIND_MATCH_CASE
|
2012-08-28 13:13:13 -04:00
|
|
|
are changed, since this will require a new search. To reset the
|
2013-10-26 14:51:16 -04:00
|
|
|
search, for example resetting the highlights call the function
|
2012-08-28 13:13:13 -04:00
|
|
|
with an empty search phrase. This always returns @c wxNOT_FOUND
|
2015-06-04 18:54:02 -04:00
|
|
|
on the OS X WebKit backend.
|
2012-08-28 13:13:13 -04:00
|
|
|
@since 2.9.5
|
|
|
|
*/
|
2013-02-01 04:38:53 -05:00
|
|
|
virtual long Find(const wxString& text, wxWebViewFindFlags flags = wxWEBVIEW_FIND_DEFAULT) = 0;
|
2012-08-28 13:13:13 -04:00
|
|
|
|
2011-07-02 12:24:56 -04:00
|
|
|
/**
|
|
|
|
@name Zoom
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
Retrieve whether the current HTML engine supports a zoom type.
|
|
|
|
@param type The zoom type to test.
|
|
|
|
@return Whether this type of zoom is supported by this HTML engine
|
|
|
|
(and thus can be set through SetZoomType()).
|
|
|
|
*/
|
|
|
|
virtual bool CanSetZoomType(wxWebViewZoomType type) const = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the zoom factor of the page.
|
|
|
|
@return The current level of zoom.
|
|
|
|
*/
|
2011-08-17 06:26:09 -04:00
|
|
|
virtual wxWebViewZoom GetZoom() const = 0;
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get how the zoom factor is currently interpreted.
|
|
|
|
@return How the zoom factor is currently interpreted by the HTML engine.
|
|
|
|
*/
|
|
|
|
virtual wxWebViewZoomType GetZoomType() const = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the zoom factor of the page.
|
|
|
|
@param zoom How much to zoom (scale) the HTML document.
|
|
|
|
*/
|
|
|
|
virtual void SetZoom(wxWebViewZoom zoom) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set how to interpret the zoom factor.
|
|
|
|
@param zoomType How the zoom factor should be interpreted by the
|
|
|
|
HTML engine.
|
|
|
|
@note invoke CanSetZoomType() first, some HTML renderers may not
|
|
|
|
support all zoom types.
|
|
|
|
*/
|
|
|
|
virtual void SetZoomType(wxWebViewZoomType zoomType) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2011-08-15 07:03:26 -04:00
|
|
|
@class wxWebViewEvent
|
2011-07-02 12:24:56 -04:00
|
|
|
|
2012-03-28 14:00:30 -04:00
|
|
|
A navigation event holds information about events associated with
|
2011-07-02 12:24:56 -04:00
|
|
|
wxWebView objects.
|
|
|
|
|
2011-08-15 07:03:26 -04:00
|
|
|
@beginEventEmissionTable{wxWebViewEvent}
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_NAVIGATING(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_NAVIGATING event, generated before trying
|
2011-07-02 12:24:56 -04:00
|
|
|
to get a resource. This event may be vetoed to prevent navigating to this
|
|
|
|
resource. Note that if the displayed HTML document has several frames, one
|
|
|
|
such event will be generated per frame.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_NAVIGATED(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_NAVIGATED event generated after it was
|
2011-07-02 12:24:56 -04:00
|
|
|
confirmed that a resource would be requested. This event may not be vetoed.
|
|
|
|
Note that if the displayed HTML document has several frames, one such event
|
|
|
|
will be generated per frame.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_LOADED(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_LOADED event generated when the document
|
2012-03-28 14:00:30 -04:00
|
|
|
is fully loaded and displayed. Note that if the displayed HTML document has
|
2011-07-04 14:27:14 -04:00
|
|
|
several frames, one such event will be generated per frame.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_ERROR(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_ERROR event generated when a navigation
|
2011-07-02 12:24:56 -04:00
|
|
|
error occurs.
|
2013-05-24 10:38:39 -04:00
|
|
|
The integer associated with this event will be a #wxWebViewNavigationError item.
|
2011-07-02 12:24:56 -04:00
|
|
|
The string associated with this event may contain a backend-specific more
|
|
|
|
precise error message/code.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_NEWWINDOW(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_NEWWINDOW event, generated when a new
|
2012-03-28 14:00:30 -04:00
|
|
|
window is created. You must handle this event if you want anything to
|
2011-07-25 09:23:05 -04:00
|
|
|
happen, for example to load the page in a new window or tab.
|
2013-02-01 04:38:53 -05:00
|
|
|
@event{EVT_WEBVIEW_TITLE_CHANGED(id, func)}
|
2013-04-25 06:11:03 -04:00
|
|
|
Process a @c wxEVT_WEBVIEW_TITLE_CHANGED event, generated when
|
2011-07-30 07:26:55 -04:00
|
|
|
the page title changes. Use GetString to get the title.
|
2011-07-02 12:24:56 -04:00
|
|
|
@endEventTable
|
2012-03-28 14:00:30 -04:00
|
|
|
|
2011-09-10 14:09:12 -04:00
|
|
|
@since 2.9.3
|
2011-08-19 09:30:46 -04:00
|
|
|
@library{wxwebview}
|
|
|
|
@category{events,webview}
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
@see wxWebView
|
|
|
|
*/
|
2011-08-17 07:19:29 -04:00
|
|
|
class wxWebViewEvent : public wxNotifyEvent
|
2011-07-02 12:24:56 -04:00
|
|
|
{
|
|
|
|
public:
|
2011-08-15 07:03:26 -04:00
|
|
|
wxWebViewEvent();
|
|
|
|
wxWebViewEvent(wxEventType type, int id, const wxString href,
|
2011-08-17 07:19:29 -04:00
|
|
|
const wxString target);
|
2011-07-02 12:24:56 -04:00
|
|
|
|
|
|
|
/**
|
2011-07-25 09:37:29 -04:00
|
|
|
Get the name of the target frame which the url of this event
|
2013-10-26 14:51:16 -04:00
|
|
|
has been or will be loaded into. This may return an empty string
|
2012-02-18 14:59:59 -05:00
|
|
|
if the frame is not available.
|
2011-07-02 12:24:56 -04:00
|
|
|
*/
|
|
|
|
const wxString& GetTarget() const;
|
|
|
|
|
2011-07-25 10:30:07 -04:00
|
|
|
/**
|
|
|
|
Get the URL being visited
|
|
|
|
*/
|
|
|
|
const wxString& GetURL() const;
|
2011-11-16 20:25:56 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-04-25 06:11:03 -04:00
|
|
|
wxEventType wxEVT_WEBVIEW_NAVIGATING;
|
|
|
|
wxEventType wxEVT_WEBVIEW_NAVIGATED;
|
|
|
|
wxEventType wxEVT_WEBVIEW_LOADED;
|
|
|
|
wxEventType wxEVT_WEBVIEW_ERROR;
|
|
|
|
wxEventType wxEVT_WEBVIEW_NEWWINDOW;
|
|
|
|
wxEventType wxEVT_WEBVIEW_TITLE_CHANGED;
|