old behaviour.
- wxWebView::New now takes a string identifier for the backend to be used
rather than a wxWebViewBackend enum value.
+- wxWebView identifiers of the form WEB_VIEW_* have been renamed to WEBVIEW_*
+ for consistency with the rest of wxWidgets.
All:
virtual void LoadURL(const wxString& url);
virtual void GoBack();
virtual void GoForward();
- virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
+ virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT);
virtual bool CanGoBack() const;
virtual bool CanGoForward() const;
virtual void ClearHistory();
virtual void Redo();
//Find function
- virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT);
+ virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT);
//Editing functions
virtual void SetEditable(bool enable = true);
virtual void ClearHistory();
virtual void EnableHistory(bool enable = true);
virtual void Stop();
- virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
+ virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT);
virtual wxString GetPageSource() const;
virtual wxString GetPageText() const;
virtual void Redo();
//Find function
- virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT);
+ virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT);
//Editing functions
virtual void SetEditable(bool enable = true);
virtual bool CanGoForward() const;
virtual void GoBack();
virtual void GoForward();
- virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
+ virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT);
virtual void Stop();
virtual wxString GetPageSource() const;
virtual wxString GetPageText() const;
virtual void Redo();
//Find function
- virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT)
+ virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT)
{
wxUnusedVar(text);
wxUnusedVar(flags);
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef _WX_WEB_VIEW_H_
-#define _WX_WEB_VIEW_H_
+#ifndef _WX_WEBVIEW_H_
+#define _WX_WEBVIEW_H_
#include "wx/defs.h"
enum wxWebViewZoom
{
- wxWEB_VIEW_ZOOM_TINY,
- wxWEB_VIEW_ZOOM_SMALL,
- wxWEB_VIEW_ZOOM_MEDIUM,
- wxWEB_VIEW_ZOOM_LARGE,
- wxWEB_VIEW_ZOOM_LARGEST
+ wxWEBVIEW_ZOOM_TINY,
+ wxWEBVIEW_ZOOM_SMALL,
+ wxWEBVIEW_ZOOM_MEDIUM,
+ wxWEBVIEW_ZOOM_LARGE,
+ wxWEBVIEW_ZOOM_LARGEST
};
enum wxWebViewZoomType
{
//Scales entire page, including images
- wxWEB_VIEW_ZOOM_TYPE_LAYOUT,
- wxWEB_VIEW_ZOOM_TYPE_TEXT
+ wxWEBVIEW_ZOOM_TYPE_LAYOUT,
+ wxWEBVIEW_ZOOM_TYPE_TEXT
};
enum wxWebViewNavigationError
{
- wxWEB_NAV_ERR_CONNECTION,
- wxWEB_NAV_ERR_CERTIFICATE,
- wxWEB_NAV_ERR_AUTH,
- wxWEB_NAV_ERR_SECURITY,
- wxWEB_NAV_ERR_NOT_FOUND,
- wxWEB_NAV_ERR_REQUEST,
- wxWEB_NAV_ERR_USER_CANCELLED,
- wxWEB_NAV_ERR_OTHER
+ wxWEBVIEW_NAV_ERR_CONNECTION,
+ wxWEBVIEW_NAV_ERR_CERTIFICATE,
+ wxWEBVIEW_NAV_ERR_AUTH,
+ wxWEBVIEW_NAV_ERR_SECURITY,
+ wxWEBVIEW_NAV_ERR_NOT_FOUND,
+ wxWEBVIEW_NAV_ERR_REQUEST,
+ wxWEBVIEW_NAV_ERR_USER_CANCELLED,
+ wxWEBVIEW_NAV_ERR_OTHER
};
enum wxWebViewReloadFlags
{
//Default, may access cache
- wxWEB_VIEW_RELOAD_DEFAULT,
- wxWEB_VIEW_RELOAD_NO_CACHE
+ wxWEBVIEW_RELOAD_DEFAULT,
+ wxWEBVIEW_RELOAD_NO_CACHE
};
enum wxWebViewFindFlags
{
- wxWEB_VIEW_FIND_WRAP = 0x0001,
- wxWEB_VIEW_FIND_ENTIRE_WORD = 0x0002,
- wxWEB_VIEW_FIND_MATCH_CASE = 0x0004,
- wxWEB_VIEW_FIND_HIGHLIGHT_RESULT = 0x0008,
- wxWEB_VIEW_FIND_BACKWARDS = 0x0010,
- wxWEB_VIEW_FIND_DEFAULT = 0
+ wxWEBVIEW_FIND_WRAP = 0x0001,
+ wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002,
+ wxWEBVIEW_FIND_MATCH_CASE = 0x0004,
+ wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008,
+ wxWEBVIEW_FIND_BACKWARDS = 0x0010,
+ wxWEBVIEW_FIND_DEFAULT = 0
};
//Base class for custom scheme handlers
virtual void LoadURL(const wxString& url) = 0;
virtual void Print() = 0;
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) = 0;
- virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT) = 0;
+ virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0;
virtual void RunScript(const wxString& javascript) = 0;
virtual void SetEditable(bool enable = true) = 0;
void SetPage(const wxString& html, const wxString& baseUrl)
//Get the pointer to the underlying native engine.
virtual void* GetNativeBackend() const = 0;
//Find function
- virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT) = 0;
+ virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT) = 0;
protected:
virtual void DoSetPage(const wxString& html, const wxString& baseUrl) = 0;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWebViewEvent);
};
-wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebViewEvent );
-wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebViewEvent );
-wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebViewEvent );
-wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebViewEvent );
-wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebViewEvent );
-wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebViewEvent );
+wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_NAVIGATING, wxWebViewEvent );
+wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_NAVIGATED, wxWebViewEvent );
+wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_LOADED, wxWebViewEvent );
+wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_ERROR, wxWebViewEvent );
+wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_NEWWINDOW, wxWebViewEvent );
+wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, wxWebViewEvent );
typedef void (wxEvtHandler::*wxWebViewEventFunction)
(wxWebViewEvent&);
#define wxWebViewEventHandler(func) \
wxEVENT_HANDLER_CAST(wxWebViewEventFunction, func)
-#define EVT_WEB_VIEW_NAVIGATING(id, fn) \
- wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_NAVIGATING, id, \
+#define EVT_WEBVIEW_NAVIGATING(id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_NAVIGATING, id, \
wxWebViewEventHandler(fn))
-#define EVT_WEB_VIEW_NAVIGATED(id, fn) \
- wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_NAVIGATED, id, \
+#define EVT_WEBVIEW_NAVIGATED(id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_NAVIGATED, id, \
wxWebViewEventHandler(fn))
-#define EVT_WEB_VIEW_LOADED(id, fn) \
- wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_LOADED, id, \
+#define EVT_WEBVIEW_LOADED(id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_LOADED, id, \
wxWebViewEventHandler(fn))
-#define EVT_WEB_VIEW_ERROR(id, fn) \
- wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_ERROR, id, \
+#define EVT_WEBVIEW_ERROR(id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_ERROR, id, \
wxWebViewEventHandler(fn))
-#define EVT_WEB_VIEW_NEWWINDOW(id, fn) \
- wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, id, \
+#define EVT_WEBVIEW_NEWWINDOW(id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_NEWWINDOW, id, \
wxWebViewEventHandler(fn))
-#define EVT_WEB_VIEW_TITLE_CHANGED(id, fn) \
- wx__DECLARE_EVT1(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, id, \
+#define EVT_WEBVIEW_TITLE_CHANGED(id, fn) \
+ wx__DECLARE_EVT1(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, id, \
wxWebViewEventHandler(fn))
#endif // wxUSE_WEBVIEW
-#endif // _WX_WEB_VIEW_H_
+#endif // _WX_WEBVIEW_H_
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef _WX_WEB_VIEW_FILE_HANDLER_H_
-#define _WX_WEB_VIEW_FILE_HANDLER_H_
+#ifndef _WX_WEBVIEW_FILE_HANDLER_H_
+#define _WX_WEBVIEW_FILE_HANDLER_H_
#include "wx/setup.h"
#endif // wxUSE_WEBVIEW
-#endif // _WX_WEB_VIEW_FILE_HANDLER_H_
+#endif // _WX_WEBVIEW_FILE_HANDLER_H_
// Based on webviewarchivehandler.h file by Steven Lamerton
-#ifndef _WX_WEB_VIEW_FS_HANDLER_H_
-#define _WX_WEB_VIEW_FS_HANDLER_H_
+#ifndef _WX_WEBVIEW_FS_HANDLER_H_
+#define _WX_WEBVIEW_FS_HANDLER_H_
#include "wx/setup.h"
#endif // wxUSE_WEBVIEW
-#endif // _WX_WEB_VIEW_FS_HANDLER_H_
+#endif // _WX_WEBVIEW_FS_HANDLER_H_
*/
enum wxWebViewZoom
{
- wxWEB_VIEW_ZOOM_TINY,
- wxWEB_VIEW_ZOOM_SMALL,
- wxWEB_VIEW_ZOOM_MEDIUM, //!< default size
- wxWEB_VIEW_ZOOM_LARGE,
- wxWEB_VIEW_ZOOM_LARGEST
+ wxWEBVIEW_ZOOM_TINY,
+ wxWEBVIEW_ZOOM_SMALL,
+ wxWEBVIEW_ZOOM_MEDIUM, //!< default size
+ wxWEBVIEW_ZOOM_LARGE,
+ wxWEBVIEW_ZOOM_LARGEST
};
/**
/**
The entire layout scales when zooming, including images
*/
- wxWEB_VIEW_ZOOM_TYPE_LAYOUT,
+ wxWEBVIEW_ZOOM_TYPE_LAYOUT,
/**
Only the text changes in size when zooming, images and other layout
elements retain their initial size
*/
- wxWEB_VIEW_ZOOM_TYPE_TEXT
+ wxWEBVIEW_ZOOM_TYPE_TEXT
};
/**
enum wxWebViewNavigationError
{
/** Connection error (timeout, etc.) */
- wxWEB_NAV_ERR_CONNECTION,
+ wxWEBVIEW_NAV_ERR_CONNECTION,
/** Invalid certificate */
- wxWEB_NAV_ERR_CERTIFICATE,
+ wxWEBVIEW_NAV_ERR_CERTIFICATE,
/** Authentication required */
- wxWEB_NAV_ERR_AUTH,
+ wxWEBVIEW_NAV_ERR_AUTH,
/** Other security error */
- wxWEB_NAV_ERR_SECURITY,
+ wxWEBVIEW_NAV_ERR_SECURITY,
/** Requested resource not found */
- wxWEB_NAV_ERR_NOT_FOUND,
+ wxWEBVIEW_NAV_ERR_NOT_FOUND,
/** Invalid request/parameters (e.g. bad URL, bad protocol,
unsupported resource type) */
- wxWEB_NAV_ERR_REQUEST,
+ wxWEBVIEW_NAV_ERR_REQUEST,
/** The user cancelled (e.g. in a dialog) */
- wxWEB_NAV_ERR_USER_CANCELLED,
+ wxWEBVIEW_NAV_ERR_USER_CANCELLED,
/** Another (exotic) type of error that didn't fit in other categories*/
- wxWEB_NAV_ERR_OTHER
+ wxWEBVIEW_NAV_ERR_OTHER
};
/**
enum wxWebViewReloadFlags
{
/** Default reload, will access cache */
- wxWEB_VIEW_RELOAD_DEFAULT,
+ wxWEBVIEW_RELOAD_DEFAULT,
/** Reload the current view without accessing the cache */
- wxWEB_VIEW_RELOAD_NO_CACHE
+ wxWEBVIEW_RELOAD_NO_CACHE
};
/**
enum wxWebViewFindFlags
{
/** Causes the search to restart when end or beginning reached */
- wxWEB_VIEW_FIND_WRAP = 0x0001,
+ wxWEBVIEW_FIND_WRAP = 0x0001,
/** Matches an entire word when searching */
- wxWEB_VIEW_FIND_ENTIRE_WORD = 0x0002,
+ wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002,
/** Match case, i.e. case sensitive searching */
- wxWEB_VIEW_FIND_MATCH_CASE = 0x0004,
+ wxWEBVIEW_FIND_MATCH_CASE = 0x0004,
/** Highlights the search results */
- wxWEB_VIEW_FIND_HIGHLIGHT_RESULT = 0x0008,
+ wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008,
/** Searches for phrase in backward direction */
- wxWEB_VIEW_FIND_BACKWARDS = 0x0010,
+ wxWEBVIEW_FIND_BACKWARDS = 0x0010,
/** The default flag, which is simple searching */
- wxWEB_VIEW_FIND_DEFAULT = 0
+ wxWEBVIEW_FIND_DEFAULT = 0
};
@section descriptions Backend Descriptions
- @par wxWEB_VIEW_BACKEND_IE (MSW)
+ @par wxWEBVIEW_BACKEND_IE (MSW)
The IE backend uses Microsoft's Trident rendering engine, specifically the
version used by the locally installed copy of Internet Explorer. As such it
this</a> article for more information. This backend has full support for
custom schemes and virtual file systems.
- @par wxWEB_VIEW_WEBKIT (GTK)
+ @par wxWEBVIEW_WEBKIT (GTK)
Under GTK the WebKit backend uses
<a href="http://webkitgtk.org/">WebKitGTK+</a>. The current minimum version
resources such as images and stylesheets are currently loaded using the
data:// scheme.
- @par wxWEB_VIEW_WEBKIT (OSX)
+ @par wxWEBVIEW_WEBKIT (OSX)
The OSX WebKit backend uses Apple's
<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>
immediately and perform their work in the background. This includes
functions such as LoadUrl() and Reload(). To receive notification of the
progress and completion of these functions you need to handle the events
- that are provided. Specifically @c wxEVT_COMMAND_WEB_VIEW_LOADED notifies
+ that are provided. Specifically @c wxEVT_COMMAND_WEBVIEW_LOADED notifies
when the page or a sub-frame has finished loading and
- @c wxEVT_COMMAND_WEB_VIEW_ERROR notifies that an error has occurred.
+ @c wxEVT_COMMAND_WEBVIEW_ERROR notifies that an error has occurred.
@section vfs Virtual File Systems and Custom Schemes
@c scheme:///C:/example/docs.zip;protocol=zip/main.htm
@beginEventEmissionTable{wxWebViewEvent}
- @event{EVT_WEB_VIEW_NAVIGATING(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATING event, generated before trying
+ @event{EVT_WEBVIEW_NAVIGATING(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATING event, generated before trying
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.
- @event{EVT_WEB_VIEW_NAVIGATED(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATED event generated after it was
+ @event{EVT_WEBVIEW_NAVIGATED(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATED event generated after it was
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.
- @event{EVT_WEB_VIEW_LOADED(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document
+ @event{EVT_WEBVIEW_LOADED(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_LOADED event generated when the document
is fully loaded and displayed. Note that if the displayed HTML document has
several frames, one such event will be generated per frame.
- @event{EVT_WEB_VIEW_ERROR(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
+ @event{EVT_WEBVIEW_ERROR(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_ERROR event generated when a navigation
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.
- @event{EVT_WEB_VIEW_NEWWINDOW(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new
+ @event{EVT_WEBVIEW_NEWWINDOW(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_NEWWINDOW event, generated when a new
window is created. You must handle this event if you want anything to
happen, for example to load the page in a new window or tab.
- @event{EVT_WEB_VIEW_TITLE_CHANGED(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED event, generated when
+ @event{EVT_WEBVIEW_TITLE_CHANGED(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED event, generated when
the page title changes. Use GetString to get the title.
@endEventTable
Reload the currently displayed URL.
@param flags A bit array that may optionally contain reload options.
*/
- virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT) = 0;
+ virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0;
/**
Runs the given javascript code.
- @note When using wxWEB_VIEW_BACKEND_IE you must wait for the current
+ @note When using wxWEBVIEW_BACKEND_IE you must wait for the current
page to finish loading before calling RunScript().
*/
virtual void RunScript(const wxString& javascript) = 0;
@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.
- @note When using wxWEB_VIEW_BACKEND_IE you must wait for the current
+ @note When using wxWEBVIEW_BACKEND_IE you must wait for the current
page to finish loading before calling SetPage().
*/
virtual void SetPage(const wxString& html, const wxString& baseUrl) = 0;
/**
Stop the current page loading process, if any.
- May trigger an error event of type @c wxWEB_NAV_ERR_USER_CANCELLED.
- TODO: make @c wxWEB_NAV_ERR_USER_CANCELLED errors uniform across ports.
+ 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.
*/
virtual void Stop() = 0;
virtual void ClearSelection() = 0;
/**
- Deletes the current selection. Note that for @c wxWEB_VIEW_BACKEND_WEBKIT
+ Deletes the current selection. Note that for @c wxWEBVIEW_BACKEND_WEBKIT
the selection must be editable, either through SetEditable or the
correct HTML attribute.
*/
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
- @c wxWEB_VIEW_FIND_ENTIRE_WORD or @c wxWEB_VIEW_FIND_MATCH_CASE
+ @c wxWEBVIEW_FIND_ENTIRE_WORD or @c wxWEBVIEW_FIND_MATCH_CASE
are changed, since this will require a new search. To reset the
search, for example reseting the highlights call the function
with an empty search phrase. This always returns @c wxNOT_FOUND
on the OSX WebKit backend.
@since 2.9.5
*/
- virtual long Find(const wxString& text, wxWebViewFindFlags flags = wxWEB_VIEW_FIND_DEFAULT) = 0;
+ virtual long Find(const wxString& text, wxWebViewFindFlags flags = wxWEBVIEW_FIND_DEFAULT) = 0;
/**
@name Zoom
wxWebView objects.
@beginEventEmissionTable{wxWebViewEvent}
- @event{EVT_WEB_VIEW_NAVIGATING(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATING event, generated before trying
+ @event{EVT_WEBVIEW_NAVIGATING(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATING event, generated before trying
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.
- @event{EVT_WEB_VIEW_NAVIGATED(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_NAVIGATED event generated after it was
+ @event{EVT_WEBVIEW_NAVIGATED(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_NAVIGATED event generated after it was
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.
- @event{EVT_WEB_VIEW_LOADED(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_LOADED event generated when the document
+ @event{EVT_WEBVIEW_LOADED(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_LOADED event generated when the document
is fully loaded and displayed. Note that if the displayed HTML document has
several frames, one such event will be generated per frame.
- @event{EVT_WEB_VIEW_ERROR(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
+ @event{EVT_WEBVIEW_ERROR(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_ERROR event generated when a navigation
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.
- @event{EVT_WEB_VIEW_NEWWINDOW(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new
+ @event{EVT_WEBVIEW_NEWWINDOW(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_NEWWINDOW event, generated when a new
window is created. You must handle this event if you want anything to
happen, for example to load the page in a new window or tab.
- @event{EVT_WEB_VIEW_TITLE_CHANGED(id, func)}
- Process a @c wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED event, generated when
+ @event{EVT_WEBVIEW_TITLE_CHANGED(id, func)}
+ Process a @c wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED event, generated when
the page title changes. Use GetString to get the title.
@endEventTable
};
-wxEventType wxEVT_COMMAND_WEB_VIEW_NAVIGATING;
-wxEventType wxEVT_COMMAND_WEB_VIEW_NAVIGATED;
-wxEventType wxEVT_COMMAND_WEB_VIEW_LOADED;
-wxEventType wxEVT_COMMAND_WEB_VIEW_ERROR;
-wxEventType wxEVT_COMMAND_WEB_VIEW_NEWWINDOW;
-wxEventType wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED;
+wxEventType wxEVT_COMMAND_WEBVIEW_NAVIGATING;
+wxEventType wxEVT_COMMAND_WEBVIEW_NAVIGATED;
+wxEventType wxEVT_COMMAND_WEBVIEW_LOADED;
+wxEventType wxEVT_COMMAND_WEBVIEW_ERROR;
+wxEventType wxEVT_COMMAND_WEBVIEW_NEWWINDOW;
+wxEventType wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED;
m_toolbar->Realize();
// Set find values.
- m_findFlags = wxWEB_VIEW_FIND_DEFAULT;
+ m_findFlags = wxWEBVIEW_FIND_DEFAULT;
m_findText = wxEmptyString;
m_findCount = 0;
m_tools_handle_navigation->Check();
m_tools_handle_new_window->Check();
m_tools_enable_history->Check();
- if(!m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT))
+ if(!m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT))
m_tools_layout->Enable(false);
wxCommandEventHandler(WebFrame::OnFindText), NULL, this );
// Connect the webview events
- Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_NAVIGATING,
+ Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_NAVIGATING,
wxWebViewEventHandler(WebFrame::OnNavigationRequest), NULL, this);
- Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_NAVIGATED,
+ Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_NAVIGATED,
wxWebViewEventHandler(WebFrame::OnNavigationComplete), NULL, this);
- Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_LOADED,
+ Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_LOADED,
wxWebViewEventHandler(WebFrame::OnDocumentLoaded), NULL, this);
- Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_ERROR,
+ Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_ERROR,
wxWebViewEventHandler(WebFrame::OnError), NULL, this);
- Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_NEWWINDOW,
+ Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_NEWWINDOW,
wxWebViewEventHandler(WebFrame::OnNewWindow), NULL, this);
- Connect(m_browser->GetId(), wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
+ Connect(m_browser->GetId(), wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED,
wxWebViewEventHandler(WebFrame::OnTitleChanged), NULL, this);
// Connect the menu events
int flags = 0;
if(m_find_toolbar_wrap->IsChecked())
- flags |= wxWEB_VIEW_FIND_WRAP;
+ flags |= wxWEBVIEW_FIND_WRAP;
if(m_find_toolbar_wholeword->IsChecked())
- flags |= wxWEB_VIEW_FIND_ENTIRE_WORD;
+ flags |= wxWEBVIEW_FIND_ENTIRE_WORD;
if(m_find_toolbar_matchcase->IsChecked())
- flags |= wxWEB_VIEW_FIND_MATCH_CASE;
+ flags |= wxWEBVIEW_FIND_MATCH_CASE;
if(m_find_toolbar_highlight->IsChecked())
- flags |= wxWEB_VIEW_FIND_HIGHLIGHT_RESULT;
+ flags |= wxWEBVIEW_FIND_HIGHLIGHT_RESULT;
if(m_find_toolbar_previous->GetId() == evt.GetId())
- flags |= wxWEB_VIEW_FIND_BACKWARDS;
+ flags |= wxWEBVIEW_FIND_BACKWARDS;
wxString find_text = m_find_ctrl->GetValue();
long count = m_browser->Find(find_text, flags);
wxWebViewZoom zoom = m_browser->GetZoom();
switch (zoom)
{
- case wxWEB_VIEW_ZOOM_TINY:
+ case wxWEBVIEW_ZOOM_TINY:
m_tools_tiny->Check();
break;
- case wxWEB_VIEW_ZOOM_SMALL:
+ case wxWEBVIEW_ZOOM_SMALL:
m_tools_small->Check();
break;
- case wxWEB_VIEW_ZOOM_MEDIUM:
+ case wxWEBVIEW_ZOOM_MEDIUM:
m_tools_medium->Check();
break;
- case wxWEB_VIEW_ZOOM_LARGE:
+ case wxWEBVIEW_ZOOM_LARGE:
m_tools_large->Check();
break;
- case wxWEB_VIEW_ZOOM_LARGEST:
+ case wxWEBVIEW_ZOOM_LARGEST:
m_tools_largest->Check();
break;
}
{
if (evt.GetId() == m_tools_tiny->GetId())
{
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY);
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY);
}
else if (evt.GetId() == m_tools_small->GetId())
{
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_SMALL);
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_SMALL);
}
else if (evt.GetId() == m_tools_medium->GetId())
{
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_MEDIUM);
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_MEDIUM);
}
else if (evt.GetId() == m_tools_large->GetId())
{
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_LARGE);
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_LARGE);
}
else if (evt.GetId() == m_tools_largest->GetId())
{
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_LARGEST);
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_LARGEST);
}
else
{
void WebFrame::OnZoomLayout(wxCommandEvent& WXUNUSED(evt))
{
if(m_tools_layout->IsChecked())
- m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT);
+ m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT);
else
- m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT);
+ m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT);
}
void WebFrame::OnHistory(wxCommandEvent& evt)
wxString category;
switch (evt.GetInt())
{
- WX_ERROR_CASE(wxWEB_NAV_ERR_CONNECTION);
- WX_ERROR_CASE(wxWEB_NAV_ERR_CERTIFICATE);
- WX_ERROR_CASE(wxWEB_NAV_ERR_AUTH);
- WX_ERROR_CASE(wxWEB_NAV_ERR_SECURITY);
- WX_ERROR_CASE(wxWEB_NAV_ERR_NOT_FOUND);
- WX_ERROR_CASE(wxWEB_NAV_ERR_REQUEST);
- WX_ERROR_CASE(wxWEB_NAV_ERR_USER_CANCELLED);
- WX_ERROR_CASE(wxWEB_NAV_ERR_OTHER);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CONNECTION);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_CERTIFICATE);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_AUTH);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_SECURITY);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_NOT_FOUND);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_REQUEST);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_USER_CANCELLED);
+ WX_ERROR_CASE(wxWEBVIEW_NAV_ERR_OTHER);
}
wxLogMessage("%s", "Error; url='" + evt.GetURL() + "', error='" + category + " (" + evt.GetString() + ")'");
wxIMPLEMENT_ABSTRACT_CLASS(wxWebView, wxControl);
wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewEvent, wxCommandEvent);
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATING, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NAVIGATED, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_LOADED, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_ERROR, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_NEWWINDOW, wxWebViewEvent );
-wxDEFINE_EVENT( wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_NAVIGATING, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_NAVIGATED, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_LOADED, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_ERROR, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_NEWWINDOW, wxWebViewEvent );
+wxDEFINE_EVENT( wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED, wxWebViewEvent );
wxStringWebViewFactoryMap wxWebView::m_factoryMap;
}
webKitCtrl->m_busy = false;
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_LOADED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_LOADED,
webKitCtrl->GetId(),
url, target);
else if (status == WEBKIT_LOAD_COMMITTED)
{
webKitCtrl->m_busy = true;
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED,
webKitCtrl->GetId(),
url, target);
const gchar* uri = webkit_network_request_get_uri(request);
wxString target = webkit_web_frame_get_name (frame);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATING,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATING,
webKitCtrl->GetId(),
wxString( uri, wxConvUTF8 ),
target);
wxWebViewWebKit* webKitWindow)
{
webKitWindow->m_busy = false;
- wxWebViewNavigationError type = wxWEB_NAV_ERR_OTHER;
+ wxWebViewNavigationError type = wxWEBVIEW_NAV_ERR_OTHER;
GError* error = (GError*)web_error;
wxString description(error->message, wxConvUTF8);
switch (error->code)
{
case SOUP_STATUS_CANCELLED:
- type = wxWEB_NAV_ERR_USER_CANCELLED;
+ type = wxWEBVIEW_NAV_ERR_USER_CANCELLED;
break;
case SOUP_STATUS_CANT_RESOLVE:
case SOUP_STATUS_NOT_FOUND:
- type = wxWEB_NAV_ERR_NOT_FOUND;
+ type = wxWEBVIEW_NAV_ERR_NOT_FOUND;
break;
case SOUP_STATUS_CANT_RESOLVE_PROXY:
case SOUP_STATUS_CANT_CONNECT_PROXY:
case SOUP_STATUS_SSL_FAILED:
case SOUP_STATUS_IO_ERROR:
- type = wxWEB_NAV_ERR_CONNECTION;
+ type = wxWEBVIEW_NAV_ERR_CONNECTION;
break;
case SOUP_STATUS_MALFORMED:
//case SOUP_STATUS_TOO_MANY_REDIRECTS:
- type = wxWEB_NAV_ERR_REQUEST;
+ type = wxWEBVIEW_NAV_ERR_REQUEST;
break;
//case SOUP_STATUS_NO_CONTENT:
//case SOUP_STATUS_RESET_CONTENT:
case SOUP_STATUS_BAD_REQUEST:
- type = wxWEB_NAV_ERR_REQUEST;
+ type = wxWEBVIEW_NAV_ERR_REQUEST;
break;
case SOUP_STATUS_UNAUTHORIZED:
case SOUP_STATUS_FORBIDDEN:
- type = wxWEB_NAV_ERR_AUTH;
+ type = wxWEBVIEW_NAV_ERR_AUTH;
break;
case SOUP_STATUS_METHOD_NOT_ALLOWED:
case SOUP_STATUS_NOT_ACCEPTABLE:
- type = wxWEB_NAV_ERR_SECURITY;
+ type = wxWEBVIEW_NAV_ERR_SECURITY;
break;
case SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED:
- type = wxWEB_NAV_ERR_AUTH;
+ type = wxWEBVIEW_NAV_ERR_AUTH;
break;
case SOUP_STATUS_REQUEST_TIMEOUT:
- type = wxWEB_NAV_ERR_CONNECTION;
+ type = wxWEBVIEW_NAV_ERR_CONNECTION;
break;
//case SOUP_STATUS_PAYMENT_REQUIRED:
case SOUP_STATUS_REQUEST_ENTITY_TOO_LARGE:
case SOUP_STATUS_REQUEST_URI_TOO_LONG:
case SOUP_STATUS_UNSUPPORTED_MEDIA_TYPE:
- type = wxWEB_NAV_ERR_REQUEST;
+ type = wxWEBVIEW_NAV_ERR_REQUEST;
break;
case SOUP_STATUS_BAD_GATEWAY:
case SOUP_STATUS_SERVICE_UNAVAILABLE:
case SOUP_STATUS_GATEWAY_TIMEOUT:
- type = wxWEB_NAV_ERR_CONNECTION;
+ type = wxWEBVIEW_NAV_ERR_CONNECTION;
break;
case SOUP_STATUS_HTTP_VERSION_NOT_SUPPORTED:
- type = wxWEB_NAV_ERR_REQUEST;
+ type = wxWEBVIEW_NAV_ERR_REQUEST;
break;
//case SOUP_STATUS_INSUFFICIENT_STORAGE:
//case SOUP_STATUS_NOT_EXTENDED:
//WEBKIT_NETWORK_ERROR_TRANSPORT:
case WEBKIT_NETWORK_ERROR_UNKNOWN_PROTOCOL:
- type = wxWEB_NAV_ERR_REQUEST;
+ type = wxWEBVIEW_NAV_ERR_REQUEST;
break;
case WEBKIT_NETWORK_ERROR_CANCELLED:
- type = wxWEB_NAV_ERR_USER_CANCELLED;
+ type = wxWEBVIEW_NAV_ERR_USER_CANCELLED;
break;
case WEBKIT_NETWORK_ERROR_FILE_DOES_NOT_EXIST:
- type = wxWEB_NAV_ERR_NOT_FOUND;
+ type = wxWEBVIEW_NAV_ERR_NOT_FOUND;
break;
}
}
//case WEBKIT_POLICY_ERROR_CANNOT_SHOW_URL:
//case WEBKIT_POLICY_ERROR_FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE:
case WEBKIT_POLICY_ERROR_CANNOT_USE_RESTRICTED_PORT:
- type = wxWEB_NAV_ERR_SECURITY;
+ type = wxWEBVIEW_NAV_ERR_SECURITY;
break;
}
}
}
*/
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR,
webKitWindow->GetId(),
uri, "");
event.SetString(description);
const gchar* uri = webkit_network_request_get_uri(request);
wxString target = webkit_web_frame_get_name (frame);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NEWWINDOW,
webKitCtrl->GetId(),
wxString( uri, wxConvUTF8 ),
target);
gchar *title,
wxWebViewWebKit *webKitCtrl)
{
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED,
webKitCtrl->GetId(),
webKitCtrl->GetCurrentURL(),
"");
void wxWebViewWebKit::Reload(wxWebViewReloadFlags flags)
{
- if (flags & wxWEB_VIEW_RELOAD_NO_CACHE)
+ if (flags & wxWEBVIEW_RELOAD_NO_CACHE)
{
webkit_web_view_reload_bypass_cache(m_web_view);
}
// arbitrary way to map float zoom to our common zoom enum
if (zoom <= 0.65)
{
- return wxWEB_VIEW_ZOOM_TINY;
+ return wxWEBVIEW_ZOOM_TINY;
}
else if (zoom > 0.65 && zoom <= 0.90)
{
- return wxWEB_VIEW_ZOOM_SMALL;
+ return wxWEBVIEW_ZOOM_SMALL;
}
else if (zoom > 0.90 && zoom <= 1.15)
{
- return wxWEB_VIEW_ZOOM_MEDIUM;
+ return wxWEBVIEW_ZOOM_MEDIUM;
}
else if (zoom > 1.15 && zoom <= 1.45)
{
- return wxWEB_VIEW_ZOOM_LARGE;
+ return wxWEBVIEW_ZOOM_LARGE;
}
else if (zoom > 1.45)
{
- return wxWEB_VIEW_ZOOM_LARGEST;
+ return wxWEBVIEW_ZOOM_LARGEST;
}
// to shut up compilers, this can never be reached logically
wxASSERT(false);
- return wxWEB_VIEW_ZOOM_MEDIUM;
+ return wxWEBVIEW_ZOOM_MEDIUM;
}
// arbitrary way to map our common zoom enum to float zoom
switch (zoom)
{
- case wxWEB_VIEW_ZOOM_TINY:
+ case wxWEBVIEW_ZOOM_TINY:
SetWebkitZoom(0.6f);
break;
- case wxWEB_VIEW_ZOOM_SMALL:
+ case wxWEBVIEW_ZOOM_SMALL:
SetWebkitZoom(0.8f);
break;
- case wxWEB_VIEW_ZOOM_MEDIUM:
+ case wxWEBVIEW_ZOOM_MEDIUM:
SetWebkitZoom(1.0f);
break;
- case wxWEB_VIEW_ZOOM_LARGE:
+ case wxWEBVIEW_ZOOM_LARGE:
SetWebkitZoom(1.3);
break;
- case wxWEB_VIEW_ZOOM_LARGEST:
+ case wxWEBVIEW_ZOOM_LARGEST:
SetWebkitZoom(1.6);
break;
void wxWebViewWebKit::SetZoomType(wxWebViewZoomType type)
{
webkit_web_view_set_full_content_zoom(m_web_view,
- (type == wxWEB_VIEW_ZOOM_TYPE_LAYOUT ?
+ (type == wxWEBVIEW_ZOOM_TYPE_LAYOUT ?
TRUE : FALSE));
}
{
gboolean fczoom = webkit_web_view_get_full_content_zoom(m_web_view);
- if (fczoom) return wxWEB_VIEW_ZOOM_TYPE_LAYOUT;
- else return wxWEB_VIEW_ZOOM_TYPE_TEXT;
+ if (fczoom) return wxWEBVIEW_ZOOM_TYPE_LAYOUT;
+ else return wxWEBVIEW_ZOOM_TYPE_TEXT;
}
bool wxWebViewWebKit::CanSetZoomType(wxWebViewZoomType) const
{
bool newSearch = false;
if(text != m_findText ||
- (flags & wxWEB_VIEW_FIND_MATCH_CASE) != (m_findFlags & wxWEB_VIEW_FIND_MATCH_CASE))
+ (flags & wxWEBVIEW_FIND_MATCH_CASE) != (m_findFlags & wxWEBVIEW_FIND_MATCH_CASE))
{
newSearch = true;
//If it is a new search we need to clear existing highlights
}
bool wrap = false, matchCase = false, forward = true;
- if(flags & wxWEB_VIEW_FIND_WRAP)
+ if(flags & wxWEBVIEW_FIND_WRAP)
wrap = true;
- if(flags & wxWEB_VIEW_FIND_MATCH_CASE)
+ if(flags & wxWEBVIEW_FIND_MATCH_CASE)
matchCase = true;
- if(flags & wxWEB_VIEW_FIND_BACKWARDS)
+ if(flags & wxWEBVIEW_FIND_BACKWARDS)
forward = false;
if(newSearch)
}
//Highlight them if needed
- bool highlight = flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT ? true : false;
+ bool highlight = flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT ? true : false;
webkit_web_view_set_highlight_text_matches(m_web_view, highlight);
if(!webkit_web_view_search_text(m_web_view, wxGTK_CONV(text), matchCase, forward, wrap))
enum //Internal find flags
{
- wxWEB_VIEW_FIND_ADD_POINTERS = 0x0001,
- wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT = 0x0002
+ wxWEBVIEW_FIND_ADD_POINTERS = 0x0001,
+ wxWEBVIEW_FIND_REMOVE_HIGHLIGHT = 0x0002
};
}
m_historyLoadingFromList = false;
m_historyEnabled = true;
m_historyPosition = -1;
- m_zoomType = wxWEB_VIEW_ZOOM_TYPE_TEXT;
+ m_zoomType = wxWEBVIEW_ZOOM_TYPE_TEXT;
FindClear();
if (::CoCreateInstance(CLSID_WebBrowser, NULL,
//We send the events when we are done to mimic webkit
//Navigated event
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED,
GetId(), baseUrl, "");
event.SetEventObject(this);
HandleWindowEvent(event);
//Document complete event
- event.SetEventType(wxEVT_COMMAND_WEB_VIEW_LOADED);
+ event.SetEventType(wxEVT_COMMAND_WEBVIEW_LOADED);
event.SetEventObject(this);
HandleWindowEvent(event);
}
{
switch( m_zoomType )
{
- case wxWEB_VIEW_ZOOM_TYPE_LAYOUT:
+ case wxWEBVIEW_ZOOM_TYPE_LAYOUT:
return GetIEOpticalZoom();
- case wxWEB_VIEW_ZOOM_TYPE_TEXT:
+ case wxWEBVIEW_ZOOM_TYPE_TEXT:
return GetIETextZoom();
default:
wxFAIL;
}
//Dummy return to stop compiler warnings
- return wxWEB_VIEW_ZOOM_MEDIUM;
+ return wxWEBVIEW_ZOOM_MEDIUM;
}
{
switch( m_zoomType )
{
- case wxWEB_VIEW_ZOOM_TYPE_LAYOUT:
+ case wxWEBVIEW_ZOOM_TYPE_LAYOUT:
SetIEOpticalZoom(zoom);
break;
- case wxWEB_VIEW_ZOOM_TYPE_TEXT:
+ case wxWEBVIEW_ZOOM_TYPE_TEXT:
SetIETextZoom(zoom);
break;
default:
//We make a somewhat arbitray map here, taken from values used by webkit
switch(level)
{
- case wxWEB_VIEW_ZOOM_TINY:
+ case wxWEBVIEW_ZOOM_TINY:
V_I4(&zoomVariant) = 60;
break;
- case wxWEB_VIEW_ZOOM_SMALL:
+ case wxWEBVIEW_ZOOM_SMALL:
V_I4(&zoomVariant) = 80;
break;
- case wxWEB_VIEW_ZOOM_MEDIUM:
+ case wxWEBVIEW_ZOOM_MEDIUM:
V_I4(&zoomVariant) = 100;
break;
- case wxWEB_VIEW_ZOOM_LARGE:
+ case wxWEBVIEW_ZOOM_LARGE:
V_I4(&zoomVariant) = 130;
break;
- case wxWEB_VIEW_ZOOM_LARGEST:
+ case wxWEBVIEW_ZOOM_LARGEST:
V_I4(&zoomVariant) = 160;
break;
default:
//We make a somewhat arbitray map here, taken from values used by webkit
if (zoom <= 65)
{
- return wxWEB_VIEW_ZOOM_TINY;
+ return wxWEBVIEW_ZOOM_TINY;
}
else if (zoom > 65 && zoom <= 90)
{
- return wxWEB_VIEW_ZOOM_SMALL;
+ return wxWEBVIEW_ZOOM_SMALL;
}
else if (zoom > 90 && zoom <= 115)
{
- return wxWEB_VIEW_ZOOM_MEDIUM;
+ return wxWEBVIEW_ZOOM_MEDIUM;
}
else if (zoom > 115 && zoom <= 145)
{
- return wxWEB_VIEW_ZOOM_LARGE;
+ return wxWEBVIEW_ZOOM_LARGE;
}
else /*if (zoom > 145) */ //Using else removes a compiler warning
{
- return wxWEB_VIEW_ZOOM_LARGEST;
+ return wxWEBVIEW_ZOOM_LARGEST;
}
}
key.QueryValue("Version", value);
long version = wxAtoi(value.Left(1));
- if(version <= 6 && type == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
+ if(version <= 6 && type == wxWEBVIEW_ZOOM_TYPE_LAYOUT)
return false;
else
return true;
switch(flags)
{
- case wxWEB_VIEW_RELOAD_DEFAULT:
+ case wxWEBVIEW_RELOAD_DEFAULT:
V_I2(&level) = REFRESH_NORMAL;
break;
- case wxWEB_VIEW_RELOAD_NO_CACHE:
+ case wxWEBVIEW_RELOAD_NO_CACHE:
V_I2(&level) = REFRESH_COMPLETELY;
break;
default:
if(text.IsEmpty())
{
ClearSelection();
- if(m_findFlags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT)
+ if(m_findFlags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT)
{
- FindInternal(m_findText, (m_findFlags &~ wxWEB_VIEW_FIND_HIGHLIGHT_RESULT), wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT);
+ FindInternal(m_findText, (m_findFlags &~ wxWEBVIEW_FIND_HIGHLIGHT_RESULT), wxWEBVIEW_FIND_REMOVE_HIGHLIGHT);
}
FindClear();
return wxNOT_FOUND;
if(m_findText == text)
{
//Just do a highlight?
- if((flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT) != (m_findFlags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT))
+ if((flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT) != (m_findFlags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT))
{
m_findFlags = flags;
if(!m_findPointers.empty())
{
- FindInternal(m_findText, m_findFlags, ((flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT) == 0 ? wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT : 0));
+ FindInternal(m_findText, m_findFlags, ((flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT) == 0 ? wxWEBVIEW_FIND_REMOVE_HIGHLIGHT : 0));
}
return m_findPosition;
}
- else if(((m_findFlags & wxWEB_VIEW_FIND_ENTIRE_WORD) == (flags & wxWEB_VIEW_FIND_ENTIRE_WORD)) && ((m_findFlags & wxWEB_VIEW_FIND_MATCH_CASE) == (flags&wxWEB_VIEW_FIND_MATCH_CASE)))
+ else if(((m_findFlags & wxWEBVIEW_FIND_ENTIRE_WORD) == (flags & wxWEBVIEW_FIND_ENTIRE_WORD)) && ((m_findFlags & wxWEBVIEW_FIND_MATCH_CASE) == (flags&wxWEBVIEW_FIND_MATCH_CASE)))
{
m_findFlags = flags;
- return FindNext(((flags & wxWEB_VIEW_FIND_BACKWARDS) ? -1 : 1));
+ return FindNext(((flags & wxWEBVIEW_FIND_BACKWARDS) ? -1 : 1));
}
}
//Remove old highlight if any.
- if(m_findFlags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT)
+ if(m_findFlags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT)
{
- FindInternal(m_findText, (m_findFlags &~ wxWEB_VIEW_FIND_HIGHLIGHT_RESULT), wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT);
+ FindInternal(m_findText, (m_findFlags &~ wxWEBVIEW_FIND_HIGHLIGHT_RESULT), wxWEBVIEW_FIND_REMOVE_HIGHLIGHT);
}
//Reset find variables.
FindClear();
m_findText = text;
m_findFlags = flags;
//find the text and return count.
- FindInternal(text, flags, wxWEB_VIEW_FIND_ADD_POINTERS);
+ FindInternal(text, flags, wxWEBVIEW_FIND_ADD_POINTERS);
return m_findPointers.empty() ? wxNOT_FOUND : m_findPointers.size();
}
ptrBegin->SetGravity(wxPOINTER_GRAVITY_Right);
ptrBegin->MoveToContainer(pIMC, TRUE);
//Create the find flag from the wx one.
- if(flags & wxWEB_VIEW_FIND_ENTIRE_WORD)
+ if(flags & wxWEBVIEW_FIND_ENTIRE_WORD)
{
find_flag |= wxFINDTEXT_WHOLEWORD;
}
- if(flags & wxWEB_VIEW_FIND_MATCH_CASE)
+ if(flags & wxWEBVIEW_FIND_MATCH_CASE)
{
find_flag |= wxFINDTEXT_MATCHCASE;
}
if(IsElementVisible(elm))
{
//Highlight the word if the flag was set.
- if(flags & wxWEB_VIEW_FIND_HIGHLIGHT_RESULT)
+ if(flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT)
{
IHTMLElement* pFontEl;
pIMS->CreateElement(wxTAGID_FONT, attr_bstr, &pFontEl);
pIMS->InsertElement(pFontEl, ptrBegin, ptrEnd);
}
- if(internal_flag & wxWEB_VIEW_FIND_REMOVE_HIGHLIGHT)
+ if(internal_flag & wxWEBVIEW_FIND_REMOVE_HIGHLIGHT)
{
IHTMLElement* pFontEl;
ptrBegin->CurrentScope(&pFontEl);
pIMS->RemoveElement(pFontEl);
pFontEl->Release();
}
- if(internal_flag & wxWEB_VIEW_FIND_ADD_POINTERS)
+ if(internal_flag & wxWEBVIEW_FIND_ADD_POINTERS)
{
wxIMarkupPointer *cptrBegin, *cptrEnd;
pIMS->CreateMarkupPointer(&cptrBegin);
if(m_findPosition >= (signed)m_findPointers.size())
{
- if(m_findFlags & wxWEB_VIEW_FIND_WRAP)
+ if(m_findFlags & wxWEBVIEW_FIND_WRAP)
{
m_findPosition = 0;
}
}
else if(m_findPosition < 0)
{
- if(m_findFlags & wxWEB_VIEW_FIND_WRAP)
+ if(m_findFlags & wxWEBVIEW_FIND_WRAP)
{
m_findPosition = m_findPointers.size()-1;
}
{
//Reset find variables.
m_findText.Empty();
- m_findFlags = wxWEB_VIEW_FIND_DEFAULT;
+ m_findFlags = wxWEBVIEW_FIND_DEFAULT;
m_findPosition = -1;
//The m_findPointers contains pointers for the found text.
wxString url = evt[1].GetString();
wxString target = evt[3].GetString();
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATING,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATING,
GetId(), url, target);
//skip empty javascript events.
wxString url = evt[1].GetString();
// TODO: set target parameter if possible
wxString target = wxEmptyString;
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED,
GetId(), url, target);
event.SetEventObject(this);
HandleWindowEvent(event);
FindClear();
// TODO: set target parameter if possible
wxString target = wxEmptyString;
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_LOADED, GetId(),
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_LOADED, GetId(),
url, target);
event.SetEventObject(this);
HandleWindowEvent(event);
{
wxString title = evt[0].GetString();
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED,
GetId(), GetCurrentURL(), "");
event.SetString(title);
event.SetEventObject(this);
case DISPID_NAVIGATEERROR:
{
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR, GetId(),
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR, GetId(),
evt[1].GetString(), evt[2].GetString());
event.SetEventObject(this);
switch (evt[3].GetLong())
{
// 400 Error codes
- WX_ERROR_CASE(HTTP_STATUS_BAD_REQUEST, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_DENIED, wxWEB_NAV_ERR_AUTH)
- WX_ERROR_CASE(HTTP_STATUS_PAYMENT_REQ, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(HTTP_STATUS_FORBIDDEN, wxWEB_NAV_ERR_AUTH)
- WX_ERROR_CASE(HTTP_STATUS_NOT_FOUND, wxWEB_NAV_ERR_NOT_FOUND)
- WX_ERROR_CASE(HTTP_STATUS_BAD_METHOD, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_NONE_ACCEPTABLE, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(HTTP_STATUS_PROXY_AUTH_REQ, wxWEB_NAV_ERR_AUTH)
- WX_ERROR_CASE(HTTP_STATUS_REQUEST_TIMEOUT, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(HTTP_STATUS_CONFLICT, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_GONE, wxWEB_NAV_ERR_NOT_FOUND)
- WX_ERROR_CASE(HTTP_STATUS_LENGTH_REQUIRED, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_PRECOND_FAILED, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_REQUEST_TOO_LARGE, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_URI_TOO_LONG, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_UNSUPPORTED_MEDIA, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(HTTP_STATUS_RETRY_WITH, wxWEB_NAV_ERR_OTHER)
+ WX_ERROR_CASE(HTTP_STATUS_BAD_REQUEST, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_DENIED, wxWEBVIEW_NAV_ERR_AUTH)
+ WX_ERROR_CASE(HTTP_STATUS_PAYMENT_REQ, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(HTTP_STATUS_FORBIDDEN, wxWEBVIEW_NAV_ERR_AUTH)
+ WX_ERROR_CASE(HTTP_STATUS_NOT_FOUND, wxWEBVIEW_NAV_ERR_NOT_FOUND)
+ WX_ERROR_CASE(HTTP_STATUS_BAD_METHOD, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_NONE_ACCEPTABLE, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(HTTP_STATUS_PROXY_AUTH_REQ, wxWEBVIEW_NAV_ERR_AUTH)
+ WX_ERROR_CASE(HTTP_STATUS_REQUEST_TIMEOUT, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(HTTP_STATUS_CONFLICT, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_GONE, wxWEBVIEW_NAV_ERR_NOT_FOUND)
+ WX_ERROR_CASE(HTTP_STATUS_LENGTH_REQUIRED, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_PRECOND_FAILED, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_REQUEST_TOO_LARGE, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_URI_TOO_LONG, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_UNSUPPORTED_MEDIA, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_RETRY_WITH, wxWEBVIEW_NAV_ERR_OTHER)
// 500 - Error codes
- WX_ERROR_CASE(HTTP_STATUS_SERVER_ERROR, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(HTTP_STATUS_NOT_SUPPORTED, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(HTTP_STATUS_BAD_GATEWAY, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(HTTP_STATUS_SERVICE_UNAVAIL, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(HTTP_STATUS_GATEWAY_TIMEOUT, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(HTTP_STATUS_VERSION_NOT_SUP, wxWEB_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(HTTP_STATUS_SERVER_ERROR, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(HTTP_STATUS_NOT_SUPPORTED, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(HTTP_STATUS_BAD_GATEWAY, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(HTTP_STATUS_SERVICE_UNAVAIL, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(HTTP_STATUS_GATEWAY_TIMEOUT, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(HTTP_STATUS_VERSION_NOT_SUP, wxWEBVIEW_NAV_ERR_REQUEST)
// URL Moniker error codes
- WX_ERROR_CASE(INET_E_INVALID_URL, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(INET_E_NO_SESSION, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(INET_E_CANNOT_CONNECT, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(INET_E_RESOURCE_NOT_FOUND, wxWEB_NAV_ERR_NOT_FOUND)
- WX_ERROR_CASE(INET_E_OBJECT_NOT_FOUND, wxWEB_NAV_ERR_NOT_FOUND)
- WX_ERROR_CASE(INET_E_DATA_NOT_AVAILABLE, wxWEB_NAV_ERR_NOT_FOUND)
- WX_ERROR_CASE(INET_E_DOWNLOAD_FAILURE, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(INET_E_AUTHENTICATION_REQUIRED, wxWEB_NAV_ERR_AUTH)
- WX_ERROR_CASE(INET_E_NO_VALID_MEDIA, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(INET_E_CONNECTION_TIMEOUT, wxWEB_NAV_ERR_CONNECTION)
- WX_ERROR_CASE(INET_E_INVALID_REQUEST, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(INET_E_UNKNOWN_PROTOCOL, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(INET_E_SECURITY_PROBLEM, wxWEB_NAV_ERR_SECURITY)
- WX_ERROR_CASE(INET_E_CANNOT_LOAD_DATA, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(INET_E_REDIRECT_FAILED, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(INET_E_REDIRECT_TO_DIR, wxWEB_NAV_ERR_REQUEST)
- WX_ERROR_CASE(INET_E_CANNOT_LOCK_REQUEST, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(INET_E_USE_EXTEND_BINDING, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(INET_E_TERMINATED_BIND, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(INET_E_INVALID_CERTIFICATE, wxWEB_NAV_ERR_CERTIFICATE)
- WX_ERROR_CASE(INET_E_CODE_DOWNLOAD_DECLINED, wxWEB_NAV_ERR_USER_CANCELLED)
- WX_ERROR_CASE(INET_E_RESULT_DISPATCHED, wxWEB_NAV_ERR_OTHER)
- WX_ERROR_CASE(INET_E_CANNOT_REPLACE_SFP_FILE, wxWEB_NAV_ERR_SECURITY)
- WX_ERROR_CASE(INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY, wxWEB_NAV_ERR_SECURITY)
- WX_ERROR_CASE(INET_E_CODE_INSTALL_SUPPRESSED, wxWEB_NAV_ERR_SECURITY)
+ WX_ERROR_CASE(INET_E_INVALID_URL, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(INET_E_NO_SESSION, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(INET_E_CANNOT_CONNECT, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(INET_E_RESOURCE_NOT_FOUND, wxWEBVIEW_NAV_ERR_NOT_FOUND)
+ WX_ERROR_CASE(INET_E_OBJECT_NOT_FOUND, wxWEBVIEW_NAV_ERR_NOT_FOUND)
+ WX_ERROR_CASE(INET_E_DATA_NOT_AVAILABLE, wxWEBVIEW_NAV_ERR_NOT_FOUND)
+ WX_ERROR_CASE(INET_E_DOWNLOAD_FAILURE, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(INET_E_AUTHENTICATION_REQUIRED, wxWEBVIEW_NAV_ERR_AUTH)
+ WX_ERROR_CASE(INET_E_NO_VALID_MEDIA, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(INET_E_CONNECTION_TIMEOUT, wxWEBVIEW_NAV_ERR_CONNECTION)
+ WX_ERROR_CASE(INET_E_INVALID_REQUEST, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(INET_E_UNKNOWN_PROTOCOL, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(INET_E_SECURITY_PROBLEM, wxWEBVIEW_NAV_ERR_SECURITY)
+ WX_ERROR_CASE(INET_E_CANNOT_LOAD_DATA, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(INET_E_REDIRECT_FAILED, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(INET_E_REDIRECT_TO_DIR, wxWEBVIEW_NAV_ERR_REQUEST)
+ WX_ERROR_CASE(INET_E_CANNOT_LOCK_REQUEST, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(INET_E_USE_EXTEND_BINDING, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(INET_E_TERMINATED_BIND, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(INET_E_INVALID_CERTIFICATE, wxWEBVIEW_NAV_ERR_CERTIFICATE)
+ WX_ERROR_CASE(INET_E_CODE_DOWNLOAD_DECLINED, wxWEBVIEW_NAV_ERR_USER_CANCELLED)
+ WX_ERROR_CASE(INET_E_RESULT_DISPATCHED, wxWEBVIEW_NAV_ERR_OTHER)
+ WX_ERROR_CASE(INET_E_CANNOT_REPLACE_SFP_FILE, wxWEBVIEW_NAV_ERR_SECURITY)
+ WX_ERROR_CASE(INET_E_CODE_INSTALL_BLOCKED_BY_HASH_POLICY, wxWEBVIEW_NAV_ERR_SECURITY)
+ WX_ERROR_CASE(INET_E_CODE_INSTALL_SUPPRESSED, wxWEBVIEW_NAV_ERR_SECURITY)
}
HandleWindowEvent(event);
break;
{
wxString url = evt[4].GetString();
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NEWWINDOW,
GetId(), url, wxEmptyString);
event.SetEventObject(this);
HandleWindowEvent(event);
if ( !m_webView )
return;
- if (flags & wxWEB_VIEW_RELOAD_NO_CACHE)
+ if (flags & wxWEBVIEW_RELOAD_NO_CACHE)
{
// TODO: test this indeed bypasses the cache
[[m_webView preferences] setUsesPageCache:NO];
{
// there is only one supported zoom type at the moment so this setter
// does nothing beyond checking sanity
- wxASSERT(zoomType == wxWEB_VIEW_ZOOM_TYPE_TEXT);
+ wxASSERT(zoomType == wxWEBVIEW_ZOOM_TYPE_TEXT);
}
wxWebViewZoomType wxWebViewWebKit::GetZoomType() const
// for now that's the only one that is supported
// FIXME: does the default zoom type change depending on webkit versions? :S
// Then this will be wrong
- return wxWEB_VIEW_ZOOM_TYPE_TEXT;
+ return wxWEBVIEW_ZOOM_TYPE_TEXT;
}
bool wxWebViewWebKit::CanSetZoomType(wxWebViewZoomType type) const
// for now that's the only one that is supported
// TODO: I know recent versions of webkit support layout zoom too,
// check if we can support it
- case wxWEB_VIEW_ZOOM_TYPE_TEXT:
+ case wxWEBVIEW_ZOOM_TYPE_TEXT:
return true;
default:
// arbitrary way to map float zoom to our common zoom enum
if (zoom <= 0.55)
{
- return wxWEB_VIEW_ZOOM_TINY;
+ return wxWEBVIEW_ZOOM_TINY;
}
else if (zoom > 0.55 && zoom <= 0.85)
{
- return wxWEB_VIEW_ZOOM_SMALL;
+ return wxWEBVIEW_ZOOM_SMALL;
}
else if (zoom > 0.85 && zoom <= 1.15)
{
- return wxWEB_VIEW_ZOOM_MEDIUM;
+ return wxWEBVIEW_ZOOM_MEDIUM;
}
else if (zoom > 1.15 && zoom <= 1.45)
{
- return wxWEB_VIEW_ZOOM_LARGE;
+ return wxWEBVIEW_ZOOM_LARGE;
}
else if (zoom > 1.45)
{
- return wxWEB_VIEW_ZOOM_LARGEST;
+ return wxWEBVIEW_ZOOM_LARGEST;
}
// to shut up compilers, this can never be reached logically
wxASSERT(false);
- return wxWEB_VIEW_ZOOM_MEDIUM;
+ return wxWEBVIEW_ZOOM_MEDIUM;
}
void wxWebViewWebKit::SetZoom(wxWebViewZoom zoom)
// arbitrary way to map our common zoom enum to float zoom
switch (zoom)
{
- case wxWEB_VIEW_ZOOM_TINY:
+ case wxWEBVIEW_ZOOM_TINY:
SetWebkitZoom(0.4f);
break;
- case wxWEB_VIEW_ZOOM_SMALL:
+ case wxWEBVIEW_ZOOM_SMALL:
SetWebkitZoom(0.7f);
break;
- case wxWEB_VIEW_ZOOM_MEDIUM:
+ case wxWEBVIEW_ZOOM_MEDIUM:
SetWebkitZoom(1.0f);
break;
- case wxWEB_VIEW_ZOOM_LARGE:
+ case wxWEBVIEW_ZOOM_LARGE:
SetWebkitZoom(1.3);
break;
- case wxWEB_VIEW_ZOOM_LARGEST:
+ case wxWEBVIEW_ZOOM_LARGEST:
SetWebkitZoom(1.6);
break;
if (webKitWindow && frame == [sender mainFrame]){
NSString *url = [[[[frame dataSource] request] URL] absoluteString];
wxString target = wxStringWithNSString([frame name]);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATED,
webKitWindow->GetId(),
wxStringWithNSString( url ),
target);
NSString *url = [[[[frame dataSource] request] URL] absoluteString];
wxString target = wxStringWithNSString([frame name]);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_LOADED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_LOADED,
webKitWindow->GetId(),
wxStringWithNSString( url ),
target);
wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out)
{
- *out = wxWEB_NAV_ERR_OTHER;
+ *out = wxWEBVIEW_NAV_ERR_OTHER;
if ([[error domain] isEqualToString:NSURLErrorDomain])
{
case NSURLErrorCannotFindHost:
case NSURLErrorFileDoesNotExist:
case NSURLErrorRedirectToNonExistentLocation:
- *out = wxWEB_NAV_ERR_NOT_FOUND;
+ *out = wxWEBVIEW_NAV_ERR_NOT_FOUND;
break;
case NSURLErrorResourceUnavailable:
#endif
case NSURLErrorBadURL:
case NSURLErrorFileIsDirectory:
- *out = wxWEB_NAV_ERR_REQUEST;
+ *out = wxWEBVIEW_NAV_ERR_REQUEST;
break;
case NSURLErrorTimedOut:
//case NSURLErrorInternationalRoamingOff:
//case NSURLErrorCallIsActive:
//case NSURLErrorDataNotAllowed:
- *out = wxWEB_NAV_ERR_CONNECTION;
+ *out = wxWEBVIEW_NAV_ERR_CONNECTION;
break;
case NSURLErrorCancelled:
case NSURLErrorUserCancelledAuthentication:
- *out = wxWEB_NAV_ERR_USER_CANCELLED;
+ *out = wxWEBVIEW_NAV_ERR_USER_CANCELLED;
break;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
case NSURLErrorCannotParseResponse:
#endif
case NSURLErrorBadServerResponse:
- *out = wxWEB_NAV_ERR_REQUEST;
+ *out = wxWEBVIEW_NAV_ERR_REQUEST;
break;
case NSURLErrorUserAuthenticationRequired:
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
case NSURLErrorClientCertificateRequired:
#endif
- *out = wxWEB_NAV_ERR_AUTH;
+ *out = wxWEBVIEW_NAV_ERR_AUTH;
break;
case NSURLErrorNoPermissionsToReadFile:
- *out = wxWEB_NAV_ERR_SECURITY;
+ *out = wxWEBVIEW_NAV_ERR_SECURITY;
break;
case NSURLErrorServerCertificateHasBadDate:
case NSURLErrorServerCertificateHasUnknownRoot:
case NSURLErrorServerCertificateNotYetValid:
case NSURLErrorClientCertificateRejected:
- *out = wxWEB_NAV_ERR_CERTIFICATE;
+ *out = wxWEBVIEW_NAV_ERR_CERTIFICATE;
break;
}
}
wxWebViewNavigationError type;
wxString description = nsErrorToWxHtmlError(error, &type);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR,
webKitWindow->GetId(),
wxStringWithNSString( url ),
wxEmptyString);
wxWebViewNavigationError type;
wxString description = nsErrorToWxHtmlError(error, &type);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_ERROR,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_ERROR,
webKitWindow->GetId(),
wxStringWithNSString( url ),
wxEmptyString);
forFrame:(WebFrame *)frame
{
wxString target = wxStringWithNSString([frame name]);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_TITLE_CHANGED,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED,
webKitWindow->GetId(),
webKitWindow->GetCurrentURL(),
target);
webKitWindow->m_busy = true;
NSString *url = [[request URL] absoluteString];
wxString target = wxStringWithNSString([frame name]);
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATING,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NAVIGATING,
webKitWindow->GetId(),
wxStringWithNSString( url ), target);
wxUnusedVar(actionInformation);
NSString *url = [[request URL] absoluteString];
- wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NEWWINDOW,
+ wxWebViewEvent event(wxEVT_COMMAND_WEBVIEW_NEWWINDOW,
webKitWindow->GetId(),
wxStringWithNSString( url ), "");
{
m_browser = wxWebView::New(wxTheApp->GetTopWindow(), wxID_ANY);
- m_loaded = new EventCounter(m_browser, wxEVT_COMMAND_WEB_VIEW_LOADED);
+ m_loaded = new EventCounter(m_browser, wxEVT_COMMAND_WEBVIEW_LOADED);
ENSURE_LOADED;
}
void WebTestCase::Zoom()
{
- if(m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT))
+ if(m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT))
{
- m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_LAYOUT);
- CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TYPE_LAYOUT, m_browser->GetZoomType());
+ m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_LAYOUT);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TYPE_LAYOUT, m_browser->GetZoomType());
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY);
- CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TINY, m_browser->GetZoom());
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TINY, m_browser->GetZoom());
}
//Reset the zoom level
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_MEDIUM);
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_MEDIUM);
- if(m_browser->CanSetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT))
+ if(m_browser->CanSetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT))
{
- m_browser->SetZoomType(wxWEB_VIEW_ZOOM_TYPE_TEXT);
- CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TYPE_TEXT, m_browser->GetZoomType());
+ m_browser->SetZoomType(wxWEBVIEW_ZOOM_TYPE_TEXT);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TYPE_TEXT, m_browser->GetZoomType());
- m_browser->SetZoom(wxWEB_VIEW_ZOOM_TINY);
- CPPUNIT_ASSERT_EQUAL(wxWEB_VIEW_ZOOM_TINY, m_browser->GetZoom());
+ m_browser->SetZoom(wxWEBVIEW_ZOOM_TINY);
+ CPPUNIT_ASSERT_EQUAL(wxWEBVIEW_ZOOM_TINY, m_browser->GetZoom());
}
}