void ZoomIn();
void ZoomOut();
void SetWebkitZoom(float level);
- float GetWebkitZoom();
+ float GetWebkitZoom() const;
virtual void Stop();
virtual void LoadUrl(const wxString& url);
virtual void GoBack();
virtual void GoForward();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
- virtual bool CanGoBack();
- virtual bool CanGoForward();
+ virtual bool CanGoBack() const;
+ virtual bool CanGoForward() const;
virtual void ClearHistory();
virtual void EnableHistory(bool enable = true);
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item);
- virtual wxString GetCurrentURL();
- virtual wxString GetCurrentTitle();
- virtual wxString GetPageSource();
- virtual wxString GetPageText();
+ virtual wxString GetCurrentURL() const;
+ virtual wxString GetCurrentTitle() const;
+ virtual wxString GetPageSource() const;
+ virtual wxString GetPageText() const;
//We do not want to hide the other overloads
using wxWebView::SetPage;
virtual void SetPage(const wxString& html, const wxString& baseUrl);
virtual void Print();
- virtual bool IsBusy();
+ virtual bool IsBusy() const;
void SetZoomType(wxWebViewZoomType);
wxWebViewZoomType GetZoomType() const;
bool CanSetZoomType(wxWebViewZoomType) const;
- virtual wxWebViewZoom GetZoom();
+ virtual wxWebViewZoom GetZoom() const;
virtual void SetZoom(wxWebViewZoom);
//Clipboard functions
- virtual bool CanCut();
- virtual bool CanCopy();
- virtual bool CanPaste();
+ virtual bool CanCut() const;
+ virtual bool CanCopy() const;
+ virtual bool CanPaste() const;
virtual void Cut();
virtual void Copy();
virtual void Paste();
//Undo / redo functionality
- virtual bool CanUndo();
- virtual bool CanRedo();
+ virtual bool CanUndo() const;
+ virtual bool CanRedo() const;
virtual void Undo();
virtual void Redo();
//Editing functions
virtual void SetEditable(bool enable = true);
- virtual bool IsEditable();
+ virtual bool IsEditable() const;
//Selection
virtual void DeleteSelection();
- virtual bool HasSelection();
+ virtual bool HasSelection() const;
virtual void SelectAll();
- virtual wxString GetSelectedText();
- virtual wxString GetSelectedSource();
+ virtual wxString GetSelectedText() const;
+ virtual wxString GetSelectedSource() const;
virtual void ClearSelection();
virtual void RunScript(const wxString& javascript);
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
- virtual bool CanGoForward();
- virtual bool CanGoBack();
+ virtual bool CanGoForward() const;
+ virtual bool CanGoBack() const;
virtual void GoBack();
virtual void GoForward();
virtual void ClearHistory();
virtual void Stop();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
- virtual wxString GetPageSource();
- virtual wxString GetPageText();
+ virtual wxString GetPageSource() const;
+ virtual wxString GetPageText() const;
- virtual bool IsBusy();
- virtual wxString GetCurrentURL();
- virtual wxString GetCurrentTitle();
+ virtual bool IsBusy() const;
+ virtual wxString GetCurrentURL() const;
+ virtual wxString GetCurrentTitle() const;
virtual void SetZoomType(wxWebViewZoomType);
virtual wxWebViewZoomType GetZoomType() const;
virtual void SetPage(const wxString& html, const wxString& baseUrl);
- virtual wxWebViewZoom GetZoom();
+ virtual wxWebViewZoom GetZoom() const;
virtual void SetZoom(wxWebViewZoom zoom);
//Clipboard functions
- virtual bool CanCut();
- virtual bool CanCopy();
- virtual bool CanPaste();
+ virtual bool CanCut() const;
+ virtual bool CanCopy() const;
+ virtual bool CanPaste() const;
virtual void Cut();
virtual void Copy();
virtual void Paste();
//Undo / redo functionality
- virtual bool CanUndo();
- virtual bool CanRedo();
+ virtual bool CanUndo() const;
+ virtual bool CanRedo() const;
virtual void Undo();
virtual void Redo();
//Editing functions
virtual void SetEditable(bool enable = true);
- virtual bool IsEditable();
+ virtual bool IsEditable() const;
//Selection
virtual void SelectAll();
- virtual bool HasSelection();
+ virtual bool HasSelection() const;
virtual void DeleteSelection();
- virtual wxString GetSelectedText();
- virtual wxString GetSelectedSource();
+ virtual wxString GetSelectedText() const;
+ virtual wxString GetSelectedSource() const;
virtual void ClearSelection();
virtual void RunScript(const wxString& javascript);
bool IsOfflineMode();
void SetOfflineMode(bool offline);
- wxWebViewZoom GetIETextZoom();
+ wxWebViewZoom GetIETextZoom() const;
void SetIETextZoom(wxWebViewZoom level);
- wxWebViewZoom GetIEOpticalZoom();
+ wxWebViewZoom GetIEOpticalZoom() const;
void SetIEOpticalZoom(wxWebViewZoom level);
void onActiveXEvent(wxActiveXEvent& evt);
bool m_historyEnabled;
//Generic helper functions for IHtmlDocument commands
- bool CanExecCommand(wxString command);
+ bool CanExecCommand(wxString command) const;
void ExecCommand(wxString command);
- IHTMLDocument2* GetDocument();
+ IHTMLDocument2* GetDocument() const;
wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
};
const wxString& name = wxWebViewNameStr);
virtual ~wxWebViewWebKit();
- virtual bool CanGoBack();
- virtual bool CanGoForward();
+ virtual bool CanGoBack() const;
+ virtual bool CanGoForward() const;
virtual void GoBack();
virtual void GoForward();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual void Stop();
- virtual wxString GetPageSource();
- virtual wxString GetPageText();
+ virtual wxString GetPageSource() const;
+ virtual wxString GetPageText() const;
//We do not want to hide the other overloads
using wxWebView::SetPage;
virtual void Print();
virtual void LoadUrl(const wxString& url);
- virtual wxString GetCurrentURL();
- virtual wxString GetCurrentTitle();
- virtual wxWebViewZoom GetZoom();
+ virtual wxString GetCurrentURL() const;
+ virtual wxString GetCurrentTitle() const;
+ virtual wxWebViewZoom GetZoom() const;
virtual void SetZoom(wxWebViewZoom zoom);
virtual void SetZoomType(wxWebViewZoomType zoomType);
virtual wxWebViewZoomType GetZoomType() const;
virtual bool CanSetZoomType(wxWebViewZoomType type) const;
- virtual bool IsBusy() { return m_busy; }
+ virtual bool IsBusy() const { return m_busy; }
//History functions
virtual void ClearHistory();
virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item);
//Undo / redo functionality
- virtual bool CanUndo();
- virtual bool CanRedo();
+ virtual bool CanUndo() const;
+ virtual bool CanRedo() const;
virtual void Undo();
virtual void Redo();
//Clipboard functions
- virtual bool CanCut() { return false; }
- virtual bool CanCopy() { return false; }
- virtual bool CanPaste() { return false; }
+ virtual bool CanCut() const { return false; }
+ virtual bool CanCopy() const { return false; }
+ virtual bool CanPaste() const { return false; }
virtual void Cut();
virtual void Copy();
virtual void Paste();
//Editing functions
virtual void SetEditable(bool enable = true);
- virtual bool IsEditable();
+ virtual bool IsEditable() const;
//Selection
virtual void DeleteSelection();
- virtual bool HasSelection();
+ virtual bool HasSelection() const;
virtual void SelectAll();
- virtual wxString GetSelectedText();
- virtual wxString GetSelectedSource();
+ virtual wxString GetSelectedText() const;
+ virtual wxString GetSelectedSource() const;
virtual void ClearSelection();
void RunScript(const wxString& javascript);
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
// ---- methods not from the parent (common) interface
- bool CanGetPageSource();
+ bool CanGetPageSource() const;
void SetScrollPos(int pos);
int GetScrollPos();
- bool CanIncreaseTextSize();
+ bool CanIncreaseTextSize() const;
void IncreaseTextSize();
- bool CanDecreaseTextSize();
+ bool CanDecreaseTextSize() const;
void DecreaseTextSize();
- float GetWebkitZoom();
+ float GetWebkitZoom() const;
void SetWebkitZoom(float zoom);
// don't hide base class virtuals
/** Get whether it is possible to navigate back in the history of
* visited pages
*/
- virtual bool CanGoBack() = 0;
+ virtual bool CanGoBack() const = 0;
/** Get whether it is possible to navigate forward in the history of
* visited pages
*/
- virtual bool CanGoForward() = 0;
+ virtual bool CanGoForward() const = 0;
/** Navigate back in the history of visited pages.
* Only valid if CanGoBack() returned true.
/**
* Get the URL of the currently displayed document
*/
- virtual wxString GetCurrentURL() = 0;
+ virtual wxString GetCurrentURL() const = 0;
/**
* Get the title of the current web page, or its URL/path if title is not
* available
*/
- virtual wxString GetCurrentTitle() = 0;
+ virtual wxString GetCurrentTitle() const = 0;
// TODO: handle choosing a frame when calling GetPageSource()?
/**
* @return the HTML source code, or an empty string if no page is currently
* shown
*/
- virtual wxString GetPageSource() = 0;
- virtual wxString GetPageText() = 0;
+ virtual wxString GetPageSource() const = 0;
+ virtual wxString GetPageText() const = 0;
/**
* Get the zoom factor of the page
* @return How much the HTML document is zoomed (scaleed)
*/
- virtual wxWebViewZoom GetZoom() = 0;
+ virtual wxWebViewZoom GetZoom() const = 0;
/**
* Set the zoom factor of the page
}
virtual void SetEditable(bool enable = true) = 0;
- virtual bool IsEditable() = 0;
+ virtual bool IsEditable() const = 0;
virtual void SelectAll() = 0;
- virtual bool HasSelection() = 0;
+ virtual bool HasSelection() const = 0;
virtual void DeleteSelection() = 0;
- virtual wxString GetSelectedText() = 0;
- virtual wxString GetSelectedSource() = 0;
+ virtual wxString GetSelectedText() const = 0;
+ virtual wxString GetSelectedSource() const = 0;
virtual void ClearSelection() = 0;
virtual void RunScript(const wxString& javascript) = 0;
/**
* Returns whether the web control is currently busy (e.g. loading a page)
*/
- virtual bool IsBusy() = 0;
+ virtual bool IsBusy() const = 0;
//Clipboard functions
- virtual bool CanCut() = 0;
- virtual bool CanCopy() = 0;
- virtual bool CanPaste() = 0;
+ 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() = 0;
- virtual bool CanRedo() = 0;
+ virtual bool CanUndo() const = 0;
+ virtual bool CanRedo() const = 0;
virtual void Undo() = 0;
virtual void Redo() = 0;
Get the title of the current web page, or its URL/path if title is not
available.
*/
- virtual wxString GetCurrentTitle() = 0;
+ virtual wxString GetCurrentTitle() const = 0;
/**
Get the URL of the currently displayed document.
*/
- virtual wxString GetCurrentURL() = 0;
+ virtual wxString GetCurrentURL() const = 0;
/**
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.
*/
- virtual wxString GetPageSource() = 0;
+ virtual wxString GetPageSource() const = 0;
/**
Get the text of the current page.
*/
- virtual wxString GetPageText() = 0;
+ virtual wxString GetPageText() const = 0;
/**
Returns whether the web control is currently busy (e.g. loading a page).
*/
- virtual bool IsBusy() = 0;
+ virtual bool IsBusy() const = 0;
/**
Returns whether the web control is currently editable
*/
- virtual bool IsEditable() = 0;
+ virtual bool IsEditable() const = 0;
/**
Load a web page from a URL
@note This always returns @c false on the OSX WebKit backend.
*/
- virtual bool CanCopy() = 0;
+ virtual bool CanCopy() const = 0;
/**
Returns @true if the current selection can be cut.
@note This always returns @c false on the OSX WebKit backend.
*/
- virtual bool CanCut() = 0;
+ virtual bool CanCut() const = 0;
/**
Returns @true if data can be pasted.
@note This always returns @c false on the OSX WebKit backend.
*/
- virtual bool CanPaste() = 0;
+ virtual bool CanPaste() const = 0;
/**
Copies the current selection.
Returns @true if it is possible to navigate backward in the history of
visited pages.
*/
- virtual bool CanGoBack() = 0;
+ virtual bool CanGoBack() const = 0;
/**
Returns @true if it is possible to navigate forward in the history of
visited pages.
*/
- virtual bool CanGoForward() = 0;
+ virtual bool CanGoForward() const = 0;
/**
Clear the history, this will also remove the visible page.
/**
Returns the currently selected source, if any.
*/
- virtual wxString GetSelectedSource() = 0;
+ virtual wxString GetSelectedSource() const = 0;
/**
Returns the currently selected text, if any.
*/
- virtual wxString GetSelectedText() = 0;
+ virtual wxString GetSelectedText() const = 0;
/**
Returns @true if there is a current selection.
*/
- virtual bool HasSelection() = 0;
+ virtual bool HasSelection() const = 0;
/**
Selects the entire page.
/**
Returns @true if there is an action to redo.
*/
- virtual bool CanRedo() = 0;
+ virtual bool CanRedo() const = 0;
/**
Returns @true if there is an action to undo.
*/
- virtual bool CanUndo() = 0;
+ virtual bool CanUndo() const = 0;
/**
Redos the last action.
Get the zoom factor of the page.
@return The current level of zoom.
*/
- virtual wxWebViewZoom GetZoom() = 0;
+ virtual wxWebViewZoom GetZoom() const = 0;
/**
Get how the zoom factor is currently interpreted.
webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW(web_view), level);
}
-float wxWebViewWebKit::GetWebkitZoom()
+float wxWebViewWebKit::GetWebkitZoom() const
{
return webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW(web_view));
}
}
-bool wxWebViewWebKit::CanGoBack()
+bool wxWebViewWebKit::CanGoBack() const
{
return webkit_web_view_can_go_back (WEBKIT_WEB_VIEW(web_view));
}
-bool wxWebViewWebKit::CanGoForward()
+bool wxWebViewWebKit::CanGoForward() const
{
return webkit_web_view_can_go_forward (WEBKIT_WEB_VIEW(web_view));
}
}
}
-bool wxWebViewWebKit::CanCut()
+bool wxWebViewWebKit::CanCut() const
{
return webkit_web_view_can_cut_clipboard(WEBKIT_WEB_VIEW(web_view));
}
-bool wxWebViewWebKit::CanCopy()
+bool wxWebViewWebKit::CanCopy() const
{
return webkit_web_view_can_copy_clipboard(WEBKIT_WEB_VIEW(web_view));
}
-bool wxWebViewWebKit::CanPaste()
+bool wxWebViewWebKit::CanPaste() const
{
return webkit_web_view_can_paste_clipboard(WEBKIT_WEB_VIEW(web_view));
}
webkit_web_view_paste_clipboard(WEBKIT_WEB_VIEW(web_view));
}
-bool wxWebViewWebKit::CanUndo()
+bool wxWebViewWebKit::CanUndo() const
{
return webkit_web_view_can_undo(WEBKIT_WEB_VIEW(web_view));
}
-bool wxWebViewWebKit::CanRedo()
+bool wxWebViewWebKit::CanRedo() const
{
return webkit_web_view_can_redo(WEBKIT_WEB_VIEW(web_view));
}
webkit_web_view_redo(WEBKIT_WEB_VIEW(web_view));
}
-wxString wxWebViewWebKit::GetCurrentURL()
+wxString wxWebViewWebKit::GetCurrentURL() const
{
// FIXME: check which encoding the web kit control uses instead of
// assuming UTF8 (here and elsewhere too)
}
-wxString wxWebViewWebKit::GetCurrentTitle()
+wxString wxWebViewWebKit::GetCurrentTitle() const
{
return wxString::FromUTF8(webkit_web_view_get_title(
WEBKIT_WEB_VIEW(web_view)));
}
-wxString wxWebViewWebKit::GetPageSource()
+wxString wxWebViewWebKit::GetPageSource() const
{
WebKitWebFrame* frame = webkit_web_view_get_main_frame(
WEBKIT_WEB_VIEW(web_view));
}
-wxWebViewZoom wxWebViewWebKit::GetZoom()
+wxWebViewZoom wxWebViewWebKit::GetZoom() const
{
float zoom = GetWebkitZoom();
}
-bool wxWebViewWebKit::IsBusy()
+bool wxWebViewWebKit::IsBusy() const
{
return m_busy;
webkit_web_view_set_editable(WEBKIT_WEB_VIEW(web_view), enable);
}
-bool wxWebViewWebKit::IsEditable()
+bool wxWebViewWebKit::IsEditable() const
{
return webkit_web_view_get_editable(WEBKIT_WEB_VIEW(web_view));
}
webkit_web_view_delete_selection(WEBKIT_WEB_VIEW(web_view));
}
-bool wxWebViewWebKit::HasSelection()
+bool wxWebViewWebKit::HasSelection() const
{
return webkit_web_view_has_selection(WEBKIT_WEB_VIEW(web_view));
}
webkit_web_view_select_all(WEBKIT_WEB_VIEW(web_view));
}
-wxString wxWebViewWebKit::GetSelectedText()
+wxString wxWebViewWebKit::GetSelectedText() const
{
WebKitDOMDocument* doc;
WebKitDOMDOMWindow* win;
wxConvUTF8);
}
-wxString wxWebViewWebKit::GetSelectedSource()
+wxString wxWebViewWebKit::GetSelectedSource() const
{
WebKitDOMDocument* doc;
WebKitDOMDOMWindow* win;
}
-wxString wxWebViewWebKit::GetPageText()
+wxString wxWebViewWebKit::GetPageText() const
{
WebKitDOMDocument* doc;
WebKitDOMHTMLElement* body;
}
-wxString wxWebViewIE::GetPageSource()
+wxString wxWebViewIE::GetPageSource() const
{
IHTMLDocument2* document = GetDocument();
IHTMLElement *bodyTag = NULL;
return source;
}
-wxWebViewZoom wxWebViewIE::GetZoom()
+wxWebViewZoom wxWebViewIE::GetZoom() const
{
if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
return GetIEOpticalZoom();
wxASSERT(result == S_OK);
}
-wxWebViewZoom wxWebViewIE::GetIETextZoom()
+wxWebViewZoom wxWebViewIE::GetIETextZoom() const
{
VARIANT zoomVariant;
VariantInit (&zoomVariant);
wxASSERT(result == S_OK);
}
-wxWebViewZoom wxWebViewIE::GetIEOpticalZoom()
+wxWebViewZoom wxWebViewIE::GetIEOpticalZoom() const
{
VARIANT zoomVariant;
VariantInit (&zoomVariant);
OLECMDEXECOPT_DODEFAULT, NULL, NULL);
}
-bool wxWebViewIE::CanGoBack()
+bool wxWebViewIE::CanGoBack() const
{
if(m_historyEnabled)
return m_historyPosition > 0;
return false;
}
-bool wxWebViewIE::CanGoForward()
+bool wxWebViewIE::CanGoForward() const
{
if(m_historyEnabled)
return m_historyPosition != static_cast<int>(m_historyList.size()) - 1;
wxASSERT(success);
}
-bool wxWebViewIE::IsBusy()
-{
+bool wxWebViewIE::IsBusy() const
+{
if (m_isBusy) return true;
wxVariant out = m_ie.GetProperty("Busy");
return out.GetBool();
}
-wxString wxWebViewIE::GetCurrentURL()
+wxString wxWebViewIE::GetCurrentURL() const
{
wxVariant out = m_ie.GetProperty("LocationURL");
return out.GetString();
}
-wxString wxWebViewIE::GetCurrentTitle()
+wxString wxWebViewIE::GetCurrentTitle() const
{
IHTMLDocument2* document = GetDocument();
BSTR title;
return wxString(title);
}
-bool wxWebViewIE::CanCut()
+bool wxWebViewIE::CanCut() const
{
return CanExecCommand("Cut");
}
-bool wxWebViewIE::CanCopy()
+bool wxWebViewIE::CanCopy() const
{
return CanExecCommand("Copy");
}
-bool wxWebViewIE::CanPaste()
+bool wxWebViewIE::CanPaste() const
{
return CanExecCommand("Paste");
}
ExecCommand("Paste");
}
-bool wxWebViewIE::CanUndo()
+bool wxWebViewIE::CanUndo() const
{
return CanExecCommand("Undo");
}
-bool wxWebViewIE::CanRedo()
+bool wxWebViewIE::CanRedo() const
{
return CanExecCommand("Redo");
}
document->Release();
}
-bool wxWebViewIE::IsEditable()
+bool wxWebViewIE::IsEditable() const
{
IHTMLDocument2* document = GetDocument();
BSTR mode;
ExecCommand("SelectAll");
}
-bool wxWebViewIE::HasSelection()
+bool wxWebViewIE::HasSelection() const
{
IHTMLDocument2* document = GetDocument();
IHTMLSelectionObject* selection;
ExecCommand("Delete");
}
-wxString wxWebViewIE::GetSelectedText()
+wxString wxWebViewIE::GetSelectedText() const
{
IHTMLDocument2* document = GetDocument();
IHTMLSelectionObject* selection;
return selected;
}
-wxString wxWebViewIE::GetSelectedSource()
+wxString wxWebViewIE::GetSelectedSource() const
{
IHTMLDocument2* document = GetDocument();
IHTMLSelectionObject* selection;
document->Release();
}
-wxString wxWebViewIE::GetPageText()
+wxString wxWebViewIE::GetPageText() const
{
IHTMLDocument2* document = GetDocument();
wxString text;
}
}
-bool wxWebViewIE::CanExecCommand(wxString command)
+bool wxWebViewIE::CanExecCommand(wxString command) const
{
IHTMLDocument2* document = GetDocument();
VARIANT_BOOL enabled;
document->Release();
}
-IHTMLDocument2* wxWebViewIE::GetDocument()
+IHTMLDocument2* wxWebViewIE::GetDocument() const
{
wxVariant variant = m_ie.GetProperty("Document");
IHTMLDocument2* document = (IHTMLDocument2*)variant.GetVoidPtr();
// public methods
// ----------------------------------------------------------------------------
-bool wxWebViewWebKit::CanGoBack()
+bool wxWebViewWebKit::CanGoBack() const
{
if ( !m_webView )
return false;
return [m_webView canGoBack];
}
-bool wxWebViewWebKit::CanGoForward()
+bool wxWebViewWebKit::CanGoForward() const
{
if ( !m_webView )
return false;
[[m_webView mainFrame] stopLoading];
}
-bool wxWebViewWebKit::CanGetPageSource()
+bool wxWebViewWebKit::CanGetPageSource() const
{
if ( !m_webView )
return false;
return ( [[dataSource representation] canProvideDocumentSource] );
}
-wxString wxWebViewWebKit::GetPageSource()
+wxString wxWebViewWebKit::GetPageSource() const
{
if (CanGetPageSource())
return wxEmptyString;
}
-bool wxWebViewWebKit::CanIncreaseTextSize()
+bool wxWebViewWebKit::CanIncreaseTextSize() const
{
if ( !m_webView )
return false;
[m_webView makeTextLarger:(WebView*)m_webView];
}
-bool wxWebViewWebKit::CanDecreaseTextSize()
+bool wxWebViewWebKit::CanDecreaseTextSize() const
{
if ( !m_webView )
return false;
[m_webView setEditable:enable ];
}
-bool wxWebViewWebKit::IsEditable()
+bool wxWebViewWebKit::IsEditable() const
{
if ( !m_webView )
return false;
(NSString*)wxNSStringWithWxString( javascript )];
}
-wxString wxWebViewWebKit::GetSelectedText()
+wxString wxWebViewWebKit::GetSelectedText() const
{
NSString* selection = [[m_webView selectedDOMRange] markupString];
if (!selection) return wxEmptyString;
[NSURL URLWithString:wxNSStringWithWxString(url)]]];
}
-wxString wxWebViewWebKit::GetCurrentURL()
+wxString wxWebViewWebKit::GetCurrentURL() const
{
return wxStringWithNSString([m_webView mainFrameURL]);
}
-wxString wxWebViewWebKit::GetCurrentTitle()
+wxString wxWebViewWebKit::GetCurrentTitle() const
{
return wxStringWithNSString([m_webView mainFrameTitle]);
}
-float wxWebViewWebKit::GetWebkitZoom()
+float wxWebViewWebKit::GetWebkitZoom() const
{
return [m_webView textSizeMultiplier];
}
[m_webView setTextSizeMultiplier:zoom];
}
-wxWebViewZoom wxWebViewWebKit::GetZoom()
+wxWebViewZoom wxWebViewWebKit::GetZoom() const
{
float zoom = GetWebkitZoom();
[(WebView*)m_webView deleteSelection];
}
-bool wxWebViewWebKit::HasSelection()
+bool wxWebViewWebKit::HasSelection() const
{
DOMRange* range = [m_webView selectedDOMRange];
if(!range)
RunScript("window.getSelection().selectAllChildren(document.body);");
}
-wxString wxWebViewWebKit::GetSelectedSource()
+wxString wxWebViewWebKit::GetSelectedSource() const
{
wxString script = ("var range = window.getSelection().getRangeAt(0);"
"var element = document.createElement('div');"
return wxStringWithNSString([result stringValue]);
}
-wxString wxWebViewWebKit::GetPageText()
+wxString wxWebViewWebKit::GetPageText() const
{
id result = [[m_webView windowScriptObject]
evaluateWebScript:@"document.body.textContent"];
[m_webView goToBackForwardItem:item->m_histItem];
}
-bool wxWebViewWebKit::CanUndo()
+bool wxWebViewWebKit::CanUndo() const
{
return [[m_webView undoManager] canUndo];
}
-bool wxWebViewWebKit::CanRedo()
+bool wxWebViewWebKit::CanRedo() const
{
return [[m_webView undoManager] canRedo];
}