- /**
- * 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;
-
- /**
- * Retrieve whether the current HTML engine supports a type of zoom
- * @param type the type of zoom 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;
-
- // TODO: allow 'SetPage' to find files (e.g. images) from a virtual file
- // system if possible
- /**
- * 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
- */
- 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
- */
- virtual void SetPage(wxInputStream& html, wxString baseUrl)
- {
- wxStringOutputStream stream;
- stream.Write(html);
- SetPage(stream.GetString(), baseUrl);
- }
-
- // TODO:
- // wxString GetSelection(); // maybe?
- // void SetSelection(...); // maybe?
-
- // void MakeEditable(bool enable = true); // maybe?
- // bool IsEditable(); // maybe?
-
- // void EnableJavascript(bool enabled); // maybe?
- // wxString RunScript(const wxString& javascript); // maybe?
-
- // void SetScrollPos(int pos); // maybe?
- // int GetScrollPos(); // maybe?
-
- // wxString GetStatusText(); // maybe?
- // void SetStatusText(wxString text); // maybe?
- // * status text changed event?
- // * title changed event?
-
- // virtual bool IsOfflineMode() = 0; // maybe?
- // virtual void SetOfflineMode(bool offline) = 0; // maybe?
-
- // TODO: offer API to control the opening of new frames
- // (through <a target="..."> as well as through javascript), OR
- // provide a behavior consistent across ports.
- // - OSX : I receive an event for new frames opened with HTML target, and
- // currently block them all.
- // - IE : An event is recieved for new frames and they are currently
- // blocked
- // - GTK : All frame open requests are blocked. A slot exists that I could
- // connect to to be notified if ever needed
-
- /**
- * Opens a print dialog so that the user may print the currently
- * displayed page.
- */
- virtual void Print() = 0;
-
- /**
- * Returns whether the web control is currently busy (e.g. loading a page)
- */
- virtual bool IsBusy() = 0;
+ //Selection
+ virtual void SelectAll() = 0;
+ virtual bool HasSelection() const = 0;
+ virtual void DeleteSelection() = 0;
+ virtual wxString GetSelectedText() const = 0;
+ virtual wxString GetSelectedSource() const = 0;
+ virtual void ClearSelection() = 0;
+
+ //Clipboard functions
+ virtual bool CanCut() const = 0;
+ virtual bool CanCopy() const = 0;
+ virtual bool CanPaste() const = 0;
+ virtual void Cut() = 0;
+ virtual void Copy() = 0;
+ virtual void Paste() = 0;
+
+ //Undo / redo functionality
+ virtual bool CanUndo() const = 0;
+ virtual bool CanRedo() const = 0;
+ virtual void Undo() = 0;
+ virtual void Redo() = 0;
+
+ //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;
+
+protected:
+ virtual void DoSetPage(const wxString& html, const wxString& baseUrl) = 0;
+
+ wxDECLARE_ABSTRACT_CLASS(wxWebView);