* engine for the current platform*/
wxWEB_VIEW_BACKEND_DEFAULT,
- /** The OSX-native WebKit web engine */
- wxWEB_VIEW_BACKEND_OSX_WEBKIT,
-
- /** The GTK port of the WebKit engine */
- wxWEB_VIEW_BACKEND_GTK_WEBKIT,
+ /** The WebKit web engine */
+ wxWEB_VIEW_BACKEND_WEBKIT,
/** Use Microsoft Internet Explorer as web engine */
wxWEB_VIEW_BACKEND_IE
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
- is fully loaded and displayed.
+ 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_ERRROR(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
error occurs.
precise error message/code.
@event{EVT_WEB_VIEW_NEWWINDOW(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new
- window is created. This event may be vetoed to prevent a new window showing,
- for example if you want to open the url in the existing window or a new tab.
+ 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
+ the page title changes. Use GetString to get the title.
@endEventTable
@library{wxweb}
*/
virtual wxString GetPageSource() = 0;
+ /**
+ Get the text of the current page.
+ */
+ virtual wxString GetPageText() = 0;
+
/**
Returns whether the web control is currently busy (e.g. loading a page).
*/
- virtual bool IsBusy() = 0;
+ virtual bool IsBusy() = 0;
+
+ /**
+ Returns whether the web control is currently editable
+ */
+ virtual bool IsEditable() = 0;
/**
Load a web page from a URL
@param flags A bit array that may optionally contain reload options.
*/
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT) = 0;
+
+ /**
+ Runs the given javascript code.
+ */
+ virtual void RunScript(const wxString& javascript) = 0;
+
+ /**
+ 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;
/**
Set the displayed page source to the contents of the given string.
@param baseUrl URL assigned to the HTML data, to be used to resolve
relative paths, for instance.
*/
- virtual void SetPage(wxInputStream& html, wxString baseUrl)
- {
- wxStringOutputStream stream;
- stream.Write(html);
- SetPage(stream.GetString(), baseUrl);
- }
+ virtual void SetPage(wxInputStream& html, wxString baseUrl);
/**
Stop the current page loading process, if any.
Loads a history item.
*/
virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) = 0;
+
+ /**
+ @name Selection
+ */
+
+ /**
+ Clears the current selection.
+ */
+ virtual void ClearSelection() = 0;
+
+ /**
+ Deletes the current selection. Note that for @c wxWEB_VIEW_BACKEND_WEBKIT
+ the selection must be editable, either through SetEditable or the
+ correct HTML attribute.
+ */
+ virtual void DeleteSelection() = 0;
+
+ /**
+ Returns the currently selected source, if any.
+ */
+ virtual wxString GetSelectedSource() = 0;
+
+ /**
+ Returns the currently selected text, if any.
+ */
+ virtual wxString GetSelectedText() = 0;
+
+ /**
+ Returns @true if there is a current selection.
+ */
+ virtual bool HasSelection() = 0;
+
+ /**
+ Selects the entire page.
+ */
+ virtual void SelectAll() = 0;
/**
@name Undo / Redo
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
- is fully loaded and displayed.
+ 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_ERRROR(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_ERROR event generated when a navigation
error occurs.
precise error message/code.
@event{EVT_WEB_VIEW_NEWWINDOW(id, func)}
Process a @c wxEVT_COMMAND_WEB_VIEW_NEWWINDOW event, generated when a new
- window is created. This event may be vetoed to prevent a new window showing,
- for example if you want to open the url in the existing window or a new tab.
+ 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
+ the page title changes. Use GetString to get the title.
@endEventTable
@library{wxweb}
wxWebNavigationEvent();
wxWebNavigationEvent(wxEventType type, int id, const wxString href,
const wxString target, bool canVeto);
+
/**
- Get the URL being visited
+ Get the name of the target frame which the url of this event
+ has been or will be loaded into. This may return an emptry string
+ if the frame is not avaliable.
*/
- const wxString& GetHref() const { return m_href; }
+ const wxString& GetTarget() const;
/**
- Get the target (frame or window) in which the URL that caused this event
- is viewed, or an empty string if not available.
+ Get the URL being visited
*/
- const wxString& GetTarget() const;
+ const wxString& GetURL() const;
virtual wxEvent* Clone() const;
/**
Get whether this event may be vetoed (stopped/prevented). Only
- meaningful for events fired before navigation takes place or new
- window events.
+ meaningful for events fired before navigation takes place.
*/
bool CanVeto() const;
/**
Veto (prevent/stop) this event. Only meaningful for events fired
- before navigation takes place or new window events. Only valid
- if CanVeto() returned true.
+ before navigation takes place. Only valid if CanVeto() returned true.
*/
void Veto();
};
\ No newline at end of file