Const correct the wxWebView api.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton 2011-08-17 10:26:09 +00:00
parent 49f07becce
commit e669ddde23
8 changed files with 151 additions and 151 deletions

View File

@ -63,60 +63,60 @@ public:
void ZoomIn(); void ZoomIn();
void ZoomOut(); void ZoomOut();
void SetWebkitZoom(float level); void SetWebkitZoom(float level);
float GetWebkitZoom(); float GetWebkitZoom() const;
virtual void Stop(); virtual void Stop();
virtual void LoadUrl(const wxString& url); virtual void LoadUrl(const wxString& url);
virtual void GoBack(); virtual void GoBack();
virtual void GoForward(); virtual void GoForward();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual bool CanGoBack(); virtual bool CanGoBack() const;
virtual bool CanGoForward(); virtual bool CanGoForward() const;
virtual void ClearHistory(); virtual void ClearHistory();
virtual void EnableHistory(bool enable = true); virtual void EnableHistory(bool enable = true);
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory(); virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory(); virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item); virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item);
virtual wxString GetCurrentURL(); virtual wxString GetCurrentURL() const;
virtual wxString GetCurrentTitle(); virtual wxString GetCurrentTitle() const;
virtual wxString GetPageSource(); virtual wxString GetPageSource() const;
virtual wxString GetPageText(); virtual wxString GetPageText() const;
//We do not want to hide the other overloads //We do not want to hide the other overloads
using wxWebView::SetPage; using wxWebView::SetPage;
virtual void SetPage(const wxString& html, const wxString& baseUrl); virtual void SetPage(const wxString& html, const wxString& baseUrl);
virtual void Print(); virtual void Print();
virtual bool IsBusy(); virtual bool IsBusy() const;
void SetZoomType(wxWebViewZoomType); void SetZoomType(wxWebViewZoomType);
wxWebViewZoomType GetZoomType() const; wxWebViewZoomType GetZoomType() const;
bool CanSetZoomType(wxWebViewZoomType) const; bool CanSetZoomType(wxWebViewZoomType) const;
virtual wxWebViewZoom GetZoom(); virtual wxWebViewZoom GetZoom() const;
virtual void SetZoom(wxWebViewZoom); virtual void SetZoom(wxWebViewZoom);
//Clipboard functions //Clipboard functions
virtual bool CanCut(); virtual bool CanCut() const;
virtual bool CanCopy(); virtual bool CanCopy() const;
virtual bool CanPaste(); virtual bool CanPaste() const;
virtual void Cut(); virtual void Cut();
virtual void Copy(); virtual void Copy();
virtual void Paste(); virtual void Paste();
//Undo / redo functionality //Undo / redo functionality
virtual bool CanUndo(); virtual bool CanUndo() const;
virtual bool CanRedo(); virtual bool CanRedo() const;
virtual void Undo(); virtual void Undo();
virtual void Redo(); virtual void Redo();
//Editing functions //Editing functions
virtual void SetEditable(bool enable = true); virtual void SetEditable(bool enable = true);
virtual bool IsEditable(); virtual bool IsEditable() const;
//Selection //Selection
virtual void DeleteSelection(); virtual void DeleteSelection();
virtual bool HasSelection(); virtual bool HasSelection() const;
virtual void SelectAll(); virtual void SelectAll();
virtual wxString GetSelectedText(); virtual wxString GetSelectedText() const;
virtual wxString GetSelectedSource(); virtual wxString GetSelectedSource() const;
virtual void ClearSelection(); virtual void ClearSelection();
virtual void RunScript(const wxString& javascript); virtual void RunScript(const wxString& javascript);

View File

@ -54,8 +54,8 @@ public:
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory(); virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory(); virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
virtual bool CanGoForward(); virtual bool CanGoForward() const;
virtual bool CanGoBack(); virtual bool CanGoBack() const;
virtual void GoBack(); virtual void GoBack();
virtual void GoForward(); virtual void GoForward();
virtual void ClearHistory(); virtual void ClearHistory();
@ -63,12 +63,12 @@ public:
virtual void Stop(); virtual void Stop();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual wxString GetPageSource(); virtual wxString GetPageSource() const;
virtual wxString GetPageText(); virtual wxString GetPageText() const;
virtual bool IsBusy(); virtual bool IsBusy() const;
virtual wxString GetCurrentURL(); virtual wxString GetCurrentURL() const;
virtual wxString GetCurrentTitle(); virtual wxString GetCurrentTitle() const;
virtual void SetZoomType(wxWebViewZoomType); virtual void SetZoomType(wxWebViewZoomType);
virtual wxWebViewZoomType GetZoomType() const; virtual wxWebViewZoomType GetZoomType() const;
@ -78,33 +78,33 @@ public:
virtual void SetPage(const wxString& html, const wxString& baseUrl); virtual void SetPage(const wxString& html, const wxString& baseUrl);
virtual wxWebViewZoom GetZoom(); virtual wxWebViewZoom GetZoom() const;
virtual void SetZoom(wxWebViewZoom zoom); virtual void SetZoom(wxWebViewZoom zoom);
//Clipboard functions //Clipboard functions
virtual bool CanCut(); virtual bool CanCut() const;
virtual bool CanCopy(); virtual bool CanCopy() const;
virtual bool CanPaste(); virtual bool CanPaste() const;
virtual void Cut(); virtual void Cut();
virtual void Copy(); virtual void Copy();
virtual void Paste(); virtual void Paste();
//Undo / redo functionality //Undo / redo functionality
virtual bool CanUndo(); virtual bool CanUndo() const;
virtual bool CanRedo(); virtual bool CanRedo() const;
virtual void Undo(); virtual void Undo();
virtual void Redo(); virtual void Redo();
//Editing functions //Editing functions
virtual void SetEditable(bool enable = true); virtual void SetEditable(bool enable = true);
virtual bool IsEditable(); virtual bool IsEditable() const;
//Selection //Selection
virtual void SelectAll(); virtual void SelectAll();
virtual bool HasSelection(); virtual bool HasSelection() const;
virtual void DeleteSelection(); virtual void DeleteSelection();
virtual wxString GetSelectedText(); virtual wxString GetSelectedText() const;
virtual wxString GetSelectedSource(); virtual wxString GetSelectedSource() const;
virtual void ClearSelection(); virtual void ClearSelection();
virtual void RunScript(const wxString& javascript); virtual void RunScript(const wxString& javascript);
@ -118,10 +118,10 @@ public:
bool IsOfflineMode(); bool IsOfflineMode();
void SetOfflineMode(bool offline); void SetOfflineMode(bool offline);
wxWebViewZoom GetIETextZoom(); wxWebViewZoom GetIETextZoom() const;
void SetIETextZoom(wxWebViewZoom level); void SetIETextZoom(wxWebViewZoom level);
wxWebViewZoom GetIEOpticalZoom(); wxWebViewZoom GetIEOpticalZoom() const;
void SetIEOpticalZoom(wxWebViewZoom level); void SetIEOpticalZoom(wxWebViewZoom level);
void onActiveXEvent(wxActiveXEvent& evt); void onActiveXEvent(wxActiveXEvent& evt);
@ -153,9 +153,9 @@ private:
bool m_historyEnabled; bool m_historyEnabled;
//Generic helper functions for IHtmlDocument commands //Generic helper functions for IHtmlDocument commands
bool CanExecCommand(wxString command); bool CanExecCommand(wxString command) const;
void ExecCommand(wxString command); void ExecCommand(wxString command);
IHTMLDocument2* GetDocument(); IHTMLDocument2* GetDocument() const;
wxDECLARE_DYNAMIC_CLASS(wxWebViewIE); wxDECLARE_DYNAMIC_CLASS(wxWebViewIE);
}; };

View File

@ -51,14 +51,14 @@ public:
const wxString& name = wxWebViewNameStr); const wxString& name = wxWebViewNameStr);
virtual ~wxWebViewWebKit(); virtual ~wxWebViewWebKit();
virtual bool CanGoBack(); virtual bool CanGoBack() const;
virtual bool CanGoForward(); virtual bool CanGoForward() const;
virtual void GoBack(); virtual void GoBack();
virtual void GoForward(); virtual void GoForward();
virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT); virtual void Reload(wxWebViewReloadFlags flags = wxWEB_VIEW_RELOAD_DEFAULT);
virtual void Stop(); virtual void Stop();
virtual wxString GetPageSource(); virtual wxString GetPageSource() const;
virtual wxString GetPageText(); virtual wxString GetPageText() const;
//We do not want to hide the other overloads //We do not want to hide the other overloads
using wxWebView::SetPage; using wxWebView::SetPage;
@ -67,16 +67,16 @@ public:
virtual void Print(); virtual void Print();
virtual void LoadUrl(const wxString& url); virtual void LoadUrl(const wxString& url);
virtual wxString GetCurrentURL(); virtual wxString GetCurrentURL() const;
virtual wxString GetCurrentTitle(); virtual wxString GetCurrentTitle() const;
virtual wxWebViewZoom GetZoom(); virtual wxWebViewZoom GetZoom() const;
virtual void SetZoom(wxWebViewZoom zoom); virtual void SetZoom(wxWebViewZoom zoom);
virtual void SetZoomType(wxWebViewZoomType zoomType); virtual void SetZoomType(wxWebViewZoomType zoomType);
virtual wxWebViewZoomType GetZoomType() const; virtual wxWebViewZoomType GetZoomType() const;
virtual bool CanSetZoomType(wxWebViewZoomType type) const; virtual bool CanSetZoomType(wxWebViewZoomType type) const;
virtual bool IsBusy() { return m_busy; } virtual bool IsBusy() const { return m_busy; }
//History functions //History functions
virtual void ClearHistory(); virtual void ClearHistory();
@ -86,29 +86,29 @@ public:
virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item); virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item);
//Undo / redo functionality //Undo / redo functionality
virtual bool CanUndo(); virtual bool CanUndo() const;
virtual bool CanRedo(); virtual bool CanRedo() const;
virtual void Undo(); virtual void Undo();
virtual void Redo(); virtual void Redo();
//Clipboard functions //Clipboard functions
virtual bool CanCut() { return false; } virtual bool CanCut() const { return false; }
virtual bool CanCopy() { return false; } virtual bool CanCopy() const { return false; }
virtual bool CanPaste() { return false; } virtual bool CanPaste() const { return false; }
virtual void Cut(); virtual void Cut();
virtual void Copy(); virtual void Copy();
virtual void Paste(); virtual void Paste();
//Editing functions //Editing functions
virtual void SetEditable(bool enable = true); virtual void SetEditable(bool enable = true);
virtual bool IsEditable(); virtual bool IsEditable() const;
//Selection //Selection
virtual void DeleteSelection(); virtual void DeleteSelection();
virtual bool HasSelection(); virtual bool HasSelection() const;
virtual void SelectAll(); virtual void SelectAll();
virtual wxString GetSelectedText(); virtual wxString GetSelectedText() const;
virtual wxString GetSelectedSource(); virtual wxString GetSelectedSource() const;
virtual void ClearSelection(); virtual void ClearSelection();
void RunScript(const wxString& javascript); void RunScript(const wxString& javascript);
@ -117,17 +117,17 @@ public:
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler); virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
// ---- methods not from the parent (common) interface // ---- methods not from the parent (common) interface
bool CanGetPageSource(); bool CanGetPageSource() const;
void SetScrollPos(int pos); void SetScrollPos(int pos);
int GetScrollPos(); int GetScrollPos();
bool CanIncreaseTextSize(); bool CanIncreaseTextSize() const;
void IncreaseTextSize(); void IncreaseTextSize();
bool CanDecreaseTextSize(); bool CanDecreaseTextSize() const;
void DecreaseTextSize(); void DecreaseTextSize();
float GetWebkitZoom(); float GetWebkitZoom() const;
void SetWebkitZoom(float zoom); void SetWebkitZoom(float zoom);
// don't hide base class virtuals // don't hide base class virtuals

View File

@ -165,12 +165,12 @@ public:
/** Get whether it is possible to navigate back in the history of /** Get whether it is possible to navigate back in the history of
* visited pages * visited pages
*/ */
virtual bool CanGoBack() = 0; virtual bool CanGoBack() const = 0;
/** Get whether it is possible to navigate forward in the history of /** Get whether it is possible to navigate forward in the history of
* visited pages * visited pages
*/ */
virtual bool CanGoForward() = 0; virtual bool CanGoForward() const = 0;
/** Navigate back in the history of visited pages. /** Navigate back in the history of visited pages.
* Only valid if CanGoBack() returned true. * Only valid if CanGoBack() returned true.
@ -214,13 +214,13 @@ public:
/** /**
* Get the URL of the currently displayed document * 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 * Get the title of the current web page, or its URL/path if title is not
* available * available
*/ */
virtual wxString GetCurrentTitle() = 0; virtual wxString GetCurrentTitle() const = 0;
// TODO: handle choosing a frame when calling GetPageSource()? // TODO: handle choosing a frame when calling GetPageSource()?
/** /**
@ -228,14 +228,14 @@ public:
* @return the HTML source code, or an empty string if no page is currently * @return the HTML source code, or an empty string if no page is currently
* shown * shown
*/ */
virtual wxString GetPageSource() = 0; virtual wxString GetPageSource() const = 0;
virtual wxString GetPageText() = 0; virtual wxString GetPageText() const = 0;
/** /**
* Get the zoom factor of the page * Get the zoom factor of the page
* @return How much the HTML document is zoomed (scaleed) * @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 * Set the zoom factor of the page
@ -290,13 +290,13 @@ public:
} }
virtual void SetEditable(bool enable = true) = 0; virtual void SetEditable(bool enable = true) = 0;
virtual bool IsEditable() = 0; virtual bool IsEditable() const = 0;
virtual void SelectAll() = 0; virtual void SelectAll() = 0;
virtual bool HasSelection() = 0; virtual bool HasSelection() const = 0;
virtual void DeleteSelection() = 0; virtual void DeleteSelection() = 0;
virtual wxString GetSelectedText() = 0; virtual wxString GetSelectedText() const = 0;
virtual wxString GetSelectedSource() = 0; virtual wxString GetSelectedSource() const = 0;
virtual void ClearSelection() = 0; virtual void ClearSelection() = 0;
virtual void RunScript(const wxString& javascript) = 0; virtual void RunScript(const wxString& javascript) = 0;
@ -325,19 +325,19 @@ public:
/** /**
* Returns whether the web control is currently busy (e.g. loading a page) * Returns whether the web control is currently busy (e.g. loading a page)
*/ */
virtual bool IsBusy() = 0; virtual bool IsBusy() const = 0;
//Clipboard functions //Clipboard functions
virtual bool CanCut() = 0; virtual bool CanCut() const = 0;
virtual bool CanCopy() = 0; virtual bool CanCopy() const = 0;
virtual bool CanPaste() = 0; virtual bool CanPaste() const = 0;
virtual void Cut() = 0; virtual void Cut() = 0;
virtual void Copy() = 0; virtual void Copy() = 0;
virtual void Paste() = 0; virtual void Paste() = 0;
//Undo / redo functionality //Undo / redo functionality
virtual bool CanUndo() = 0; virtual bool CanUndo() const = 0;
virtual bool CanRedo() = 0; virtual bool CanRedo() const = 0;
virtual void Undo() = 0; virtual void Undo() = 0;
virtual void Redo() = 0; virtual void Redo() = 0;

View File

@ -295,34 +295,34 @@ public:
Get the title of the current web page, or its URL/path if title is not Get the title of the current web page, or its URL/path if title is not
available. available.
*/ */
virtual wxString GetCurrentTitle() = 0; virtual wxString GetCurrentTitle() const = 0;
/** /**
Get the URL of the currently displayed document. 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. Get the HTML source code of the currently displayed document.
@return The HTML source code, or an empty string if no page is currently @return The HTML source code, or an empty string if no page is currently
shown. shown.
*/ */
virtual wxString GetPageSource() = 0; virtual wxString GetPageSource() const = 0;
/** /**
Get the text of the current page. 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). 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 Returns whether the web control is currently editable
*/ */
virtual bool IsEditable() = 0; virtual bool IsEditable() const = 0;
/** /**
Load a web page from a URL Load a web page from a URL
@ -395,21 +395,21 @@ public:
@note This always returns @c false on the OSX WebKit backend. @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. Returns @true if the current selection can be cut.
@note This always returns @c false on the OSX WebKit backend. @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. Returns @true if data can be pasted.
@note This always returns @c false on the OSX WebKit backend. @note This always returns @c false on the OSX WebKit backend.
*/ */
virtual bool CanPaste() = 0; virtual bool CanPaste() const = 0;
/** /**
Copies the current selection. Copies the current selection.
@ -434,13 +434,13 @@ public:
Returns @true if it is possible to navigate backward in the history of Returns @true if it is possible to navigate backward in the history of
visited pages. visited pages.
*/ */
virtual bool CanGoBack() = 0; virtual bool CanGoBack() const = 0;
/** /**
Returns @true if it is possible to navigate forward in the history of Returns @true if it is possible to navigate forward in the history of
visited pages. visited pages.
*/ */
virtual bool CanGoForward() = 0; virtual bool CanGoForward() const = 0;
/** /**
Clear the history, this will also remove the visible page. Clear the history, this will also remove the visible page.
@ -501,17 +501,17 @@ public:
/** /**
Returns the currently selected source, if any. Returns the currently selected source, if any.
*/ */
virtual wxString GetSelectedSource() = 0; virtual wxString GetSelectedSource() const = 0;
/** /**
Returns the currently selected text, if any. Returns the currently selected text, if any.
*/ */
virtual wxString GetSelectedText() = 0; virtual wxString GetSelectedText() const = 0;
/** /**
Returns @true if there is a current selection. Returns @true if there is a current selection.
*/ */
virtual bool HasSelection() = 0; virtual bool HasSelection() const = 0;
/** /**
Selects the entire page. Selects the entire page.
@ -525,12 +525,12 @@ public:
/** /**
Returns @true if there is an action to redo. 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. Returns @true if there is an action to undo.
*/ */
virtual bool CanUndo() = 0; virtual bool CanUndo() const = 0;
/** /**
Redos the last action. Redos the last action.
@ -558,7 +558,7 @@ public:
Get the zoom factor of the page. Get the zoom factor of the page.
@return The current level of zoom. @return The current level of zoom.
*/ */
virtual wxWebViewZoom GetZoom() = 0; virtual wxWebViewZoom GetZoom() const = 0;
/** /**
Get how the zoom factor is currently interpreted. Get how the zoom factor is currently interpreted.

View File

@ -475,7 +475,7 @@ void wxWebViewWebKit::SetWebkitZoom(float level)
webkit_web_view_set_zoom_level (WEBKIT_WEB_VIEW(web_view), level); 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)); return webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW(web_view));
} }
@ -514,13 +514,13 @@ void wxWebViewWebKit::GoForward()
} }
bool wxWebViewWebKit::CanGoBack() bool wxWebViewWebKit::CanGoBack() const
{ {
return webkit_web_view_can_go_back (WEBKIT_WEB_VIEW(web_view)); 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)); return webkit_web_view_can_go_forward (WEBKIT_WEB_VIEW(web_view));
} }
@ -599,17 +599,17 @@ void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item)
} }
} }
bool wxWebViewWebKit::CanCut() bool wxWebViewWebKit::CanCut() const
{ {
return webkit_web_view_can_cut_clipboard(WEBKIT_WEB_VIEW(web_view)); 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)); 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)); return webkit_web_view_can_paste_clipboard(WEBKIT_WEB_VIEW(web_view));
} }
@ -629,12 +629,12 @@ void wxWebViewWebKit::Paste()
webkit_web_view_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)); 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)); return webkit_web_view_can_redo(WEBKIT_WEB_VIEW(web_view));
} }
@ -649,7 +649,7 @@ void wxWebViewWebKit::Redo()
webkit_web_view_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 // FIXME: check which encoding the web kit control uses instead of
// assuming UTF8 (here and elsewhere too) // assuming UTF8 (here and elsewhere too)
@ -658,14 +658,14 @@ wxString wxWebViewWebKit::GetCurrentURL()
} }
wxString wxWebViewWebKit::GetCurrentTitle() wxString wxWebViewWebKit::GetCurrentTitle() const
{ {
return wxString::FromUTF8(webkit_web_view_get_title( return wxString::FromUTF8(webkit_web_view_get_title(
WEBKIT_WEB_VIEW(web_view))); WEBKIT_WEB_VIEW(web_view)));
} }
wxString wxWebViewWebKit::GetPageSource() wxString wxWebViewWebKit::GetPageSource() const
{ {
WebKitWebFrame* frame = webkit_web_view_get_main_frame( WebKitWebFrame* frame = webkit_web_view_get_main_frame(
WEBKIT_WEB_VIEW(web_view)); WEBKIT_WEB_VIEW(web_view));
@ -678,7 +678,7 @@ wxString wxWebViewWebKit::GetPageSource()
} }
wxWebViewZoom wxWebViewWebKit::GetZoom() wxWebViewZoom wxWebViewWebKit::GetZoom() const
{ {
float zoom = GetWebkitZoom(); float zoom = GetWebkitZoom();
@ -786,7 +786,7 @@ void wxWebViewWebKit::Print()
} }
bool wxWebViewWebKit::IsBusy() bool wxWebViewWebKit::IsBusy() const
{ {
return m_busy; return m_busy;
@ -817,7 +817,7 @@ void wxWebViewWebKit::SetEditable(bool enable)
webkit_web_view_set_editable(WEBKIT_WEB_VIEW(web_view), enable); 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)); return webkit_web_view_get_editable(WEBKIT_WEB_VIEW(web_view));
} }
@ -827,7 +827,7 @@ void wxWebViewWebKit::DeleteSelection()
webkit_web_view_delete_selection(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)); return webkit_web_view_has_selection(WEBKIT_WEB_VIEW(web_view));
} }
@ -837,7 +837,7 @@ void wxWebViewWebKit::SelectAll()
webkit_web_view_select_all(WEBKIT_WEB_VIEW(web_view)); webkit_web_view_select_all(WEBKIT_WEB_VIEW(web_view));
} }
wxString wxWebViewWebKit::GetSelectedText() wxString wxWebViewWebKit::GetSelectedText() const
{ {
WebKitDOMDocument* doc; WebKitDOMDocument* doc;
WebKitDOMDOMWindow* win; WebKitDOMDOMWindow* win;
@ -853,7 +853,7 @@ wxString wxWebViewWebKit::GetSelectedText()
wxConvUTF8); wxConvUTF8);
} }
wxString wxWebViewWebKit::GetSelectedSource() wxString wxWebViewWebKit::GetSelectedSource() const
{ {
WebKitDOMDocument* doc; WebKitDOMDocument* doc;
WebKitDOMDOMWindow* win; WebKitDOMDOMWindow* win;
@ -891,7 +891,7 @@ void wxWebViewWebKit::ClearSelection()
} }
wxString wxWebViewWebKit::GetPageText() wxString wxWebViewWebKit::GetPageText() const
{ {
WebKitDOMDocument* doc; WebKitDOMDocument* doc;
WebKitDOMHTMLElement* body; WebKitDOMHTMLElement* body;

View File

@ -126,7 +126,7 @@ void wxWebViewIE::SetPage(const wxString& html, const wxString& baseUrl)
} }
wxString wxWebViewIE::GetPageSource() wxString wxWebViewIE::GetPageSource() const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
IHTMLElement *bodyTag = NULL; IHTMLElement *bodyTag = NULL;
@ -150,7 +150,7 @@ wxString wxWebViewIE::GetPageSource()
return source; return source;
} }
wxWebViewZoom wxWebViewIE::GetZoom() wxWebViewZoom wxWebViewIE::GetZoom() const
{ {
if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_LAYOUT) if(m_zoomType == wxWEB_VIEW_ZOOM_TYPE_LAYOUT)
return GetIEOpticalZoom(); return GetIEOpticalZoom();
@ -190,7 +190,7 @@ void wxWebViewIE::SetIETextZoom(wxWebViewZoom level)
wxASSERT(result == S_OK); wxASSERT(result == S_OK);
} }
wxWebViewZoom wxWebViewIE::GetIETextZoom() wxWebViewZoom wxWebViewIE::GetIETextZoom() const
{ {
VARIANT zoomVariant; VARIANT zoomVariant;
VariantInit (&zoomVariant); VariantInit (&zoomVariant);
@ -242,7 +242,7 @@ void wxWebViewIE::SetIEOpticalZoom(wxWebViewZoom level)
wxASSERT(result == S_OK); wxASSERT(result == S_OK);
} }
wxWebViewZoom wxWebViewIE::GetIEOpticalZoom() wxWebViewZoom wxWebViewIE::GetIEOpticalZoom() const
{ {
VARIANT zoomVariant; VARIANT zoomVariant;
VariantInit (&zoomVariant); VariantInit (&zoomVariant);
@ -309,7 +309,7 @@ void wxWebViewIE::Print()
OLECMDEXECOPT_DODEFAULT, NULL, NULL); OLECMDEXECOPT_DODEFAULT, NULL, NULL);
} }
bool wxWebViewIE::CanGoBack() bool wxWebViewIE::CanGoBack() const
{ {
if(m_historyEnabled) if(m_historyEnabled)
return m_historyPosition > 0; return m_historyPosition > 0;
@ -317,7 +317,7 @@ bool wxWebViewIE::CanGoBack()
return false; return false;
} }
bool wxWebViewIE::CanGoForward() bool wxWebViewIE::CanGoForward() const
{ {
if(m_historyEnabled) if(m_historyEnabled)
return m_historyPosition != static_cast<int>(m_historyList.size()) - 1; return m_historyPosition != static_cast<int>(m_historyList.size()) - 1;
@ -433,8 +433,8 @@ void wxWebViewIE::SetOfflineMode(bool offline)
wxASSERT(success); wxASSERT(success);
} }
bool wxWebViewIE::IsBusy() bool wxWebViewIE::IsBusy() const
{ {
if (m_isBusy) return true; if (m_isBusy) return true;
wxVariant out = m_ie.GetProperty("Busy"); wxVariant out = m_ie.GetProperty("Busy");
@ -444,7 +444,7 @@ bool wxWebViewIE::IsBusy()
return out.GetBool(); return out.GetBool();
} }
wxString wxWebViewIE::GetCurrentURL() wxString wxWebViewIE::GetCurrentURL() const
{ {
wxVariant out = m_ie.GetProperty("LocationURL"); wxVariant out = m_ie.GetProperty("LocationURL");
@ -452,7 +452,7 @@ wxString wxWebViewIE::GetCurrentURL()
return out.GetString(); return out.GetString();
} }
wxString wxWebViewIE::GetCurrentTitle() wxString wxWebViewIE::GetCurrentTitle() const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
BSTR title; BSTR title;
@ -462,16 +462,16 @@ wxString wxWebViewIE::GetCurrentTitle()
return wxString(title); return wxString(title);
} }
bool wxWebViewIE::CanCut() bool wxWebViewIE::CanCut() const
{ {
return CanExecCommand("Cut"); return CanExecCommand("Cut");
} }
bool wxWebViewIE::CanCopy() bool wxWebViewIE::CanCopy() const
{ {
return CanExecCommand("Copy"); return CanExecCommand("Copy");
} }
bool wxWebViewIE::CanPaste() bool wxWebViewIE::CanPaste() const
{ {
return CanExecCommand("Paste"); return CanExecCommand("Paste");
} }
@ -491,11 +491,11 @@ void wxWebViewIE::Paste()
ExecCommand("Paste"); ExecCommand("Paste");
} }
bool wxWebViewIE::CanUndo() bool wxWebViewIE::CanUndo() const
{ {
return CanExecCommand("Undo"); return CanExecCommand("Undo");
} }
bool wxWebViewIE::CanRedo() bool wxWebViewIE::CanRedo() const
{ {
return CanExecCommand("Redo"); return CanExecCommand("Redo");
} }
@ -521,7 +521,7 @@ void wxWebViewIE::SetEditable(bool enable)
document->Release(); document->Release();
} }
bool wxWebViewIE::IsEditable() bool wxWebViewIE::IsEditable() const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
BSTR mode; BSTR mode;
@ -538,7 +538,7 @@ void wxWebViewIE::SelectAll()
ExecCommand("SelectAll"); ExecCommand("SelectAll");
} }
bool wxWebViewIE::HasSelection() bool wxWebViewIE::HasSelection() const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
IHTMLSelectionObject* selection; IHTMLSelectionObject* selection;
@ -560,7 +560,7 @@ void wxWebViewIE::DeleteSelection()
ExecCommand("Delete"); ExecCommand("Delete");
} }
wxString wxWebViewIE::GetSelectedText() wxString wxWebViewIE::GetSelectedText() const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
IHTMLSelectionObject* selection; IHTMLSelectionObject* selection;
@ -589,7 +589,7 @@ wxString wxWebViewIE::GetSelectedText()
return selected; return selected;
} }
wxString wxWebViewIE::GetSelectedSource() wxString wxWebViewIE::GetSelectedSource() const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
IHTMLSelectionObject* selection; IHTMLSelectionObject* selection;
@ -632,7 +632,7 @@ void wxWebViewIE::ClearSelection()
document->Release(); document->Release();
} }
wxString wxWebViewIE::GetPageText() wxString wxWebViewIE::GetPageText() const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
wxString text; wxString text;
@ -681,7 +681,7 @@ void wxWebViewIE::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler)
} }
} }
bool wxWebViewIE::CanExecCommand(wxString command) bool wxWebViewIE::CanExecCommand(wxString command) const
{ {
IHTMLDocument2* document = GetDocument(); IHTMLDocument2* document = GetDocument();
VARIANT_BOOL enabled; VARIANT_BOOL enabled;
@ -699,7 +699,7 @@ void wxWebViewIE::ExecCommand(wxString command)
document->Release(); document->Release();
} }
IHTMLDocument2* wxWebViewIE::GetDocument() IHTMLDocument2* wxWebViewIE::GetDocument() const
{ {
wxVariant variant = m_ie.GetProperty("Document"); wxVariant variant = m_ie.GetProperty("Document");
IHTMLDocument2* document = (IHTMLDocument2*)variant.GetVoidPtr(); IHTMLDocument2* document = (IHTMLDocument2*)variant.GetVoidPtr();

View File

@ -411,7 +411,7 @@ wxWebViewWebKit::~wxWebViewWebKit()
// public methods // public methods
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxWebViewWebKit::CanGoBack() bool wxWebViewWebKit::CanGoBack() const
{ {
if ( !m_webView ) if ( !m_webView )
return false; return false;
@ -419,7 +419,7 @@ bool wxWebViewWebKit::CanGoBack()
return [m_webView canGoBack]; return [m_webView canGoBack];
} }
bool wxWebViewWebKit::CanGoForward() bool wxWebViewWebKit::CanGoForward() const
{ {
if ( !m_webView ) if ( !m_webView )
return false; return false;
@ -469,7 +469,7 @@ void wxWebViewWebKit::Stop()
[[m_webView mainFrame] stopLoading]; [[m_webView mainFrame] stopLoading];
} }
bool wxWebViewWebKit::CanGetPageSource() bool wxWebViewWebKit::CanGetPageSource() const
{ {
if ( !m_webView ) if ( !m_webView )
return false; return false;
@ -478,7 +478,7 @@ bool wxWebViewWebKit::CanGetPageSource()
return ( [[dataSource representation] canProvideDocumentSource] ); return ( [[dataSource representation] canProvideDocumentSource] );
} }
wxString wxWebViewWebKit::GetPageSource() wxString wxWebViewWebKit::GetPageSource() const
{ {
if (CanGetPageSource()) if (CanGetPageSource())
@ -501,7 +501,7 @@ wxString wxWebViewWebKit::GetPageSource()
return wxEmptyString; return wxEmptyString;
} }
bool wxWebViewWebKit::CanIncreaseTextSize() bool wxWebViewWebKit::CanIncreaseTextSize() const
{ {
if ( !m_webView ) if ( !m_webView )
return false; return false;
@ -521,7 +521,7 @@ void wxWebViewWebKit::IncreaseTextSize()
[m_webView makeTextLarger:(WebView*)m_webView]; [m_webView makeTextLarger:(WebView*)m_webView];
} }
bool wxWebViewWebKit::CanDecreaseTextSize() bool wxWebViewWebKit::CanDecreaseTextSize() const
{ {
if ( !m_webView ) if ( !m_webView )
return false; return false;
@ -573,7 +573,7 @@ void wxWebViewWebKit::SetEditable(bool enable)
[m_webView setEditable:enable ]; [m_webView setEditable:enable ];
} }
bool wxWebViewWebKit::IsEditable() bool wxWebViewWebKit::IsEditable() const
{ {
if ( !m_webView ) if ( !m_webView )
return false; return false;
@ -629,7 +629,7 @@ void wxWebViewWebKit::SetScrollPos(int pos)
(NSString*)wxNSStringWithWxString( javascript )]; (NSString*)wxNSStringWithWxString( javascript )];
} }
wxString wxWebViewWebKit::GetSelectedText() wxString wxWebViewWebKit::GetSelectedText() const
{ {
NSString* selection = [[m_webView selectedDOMRange] markupString]; NSString* selection = [[m_webView selectedDOMRange] markupString];
if (!selection) return wxEmptyString; if (!selection) return wxEmptyString;
@ -741,17 +741,17 @@ void wxWebViewWebKit::LoadUrl(const wxString& url)
[NSURL URLWithString:wxNSStringWithWxString(url)]]]; [NSURL URLWithString:wxNSStringWithWxString(url)]]];
} }
wxString wxWebViewWebKit::GetCurrentURL() wxString wxWebViewWebKit::GetCurrentURL() const
{ {
return wxStringWithNSString([m_webView mainFrameURL]); return wxStringWithNSString([m_webView mainFrameURL]);
} }
wxString wxWebViewWebKit::GetCurrentTitle() wxString wxWebViewWebKit::GetCurrentTitle() const
{ {
return wxStringWithNSString([m_webView mainFrameTitle]); return wxStringWithNSString([m_webView mainFrameTitle]);
} }
float wxWebViewWebKit::GetWebkitZoom() float wxWebViewWebKit::GetWebkitZoom() const
{ {
return [m_webView textSizeMultiplier]; return [m_webView textSizeMultiplier];
} }
@ -761,7 +761,7 @@ void wxWebViewWebKit::SetWebkitZoom(float zoom)
[m_webView setTextSizeMultiplier:zoom]; [m_webView setTextSizeMultiplier:zoom];
} }
wxWebViewZoom wxWebViewWebKit::GetZoom() wxWebViewZoom wxWebViewWebKit::GetZoom() const
{ {
float zoom = GetWebkitZoom(); float zoom = GetWebkitZoom();
@ -865,7 +865,7 @@ void wxWebViewWebKit::DeleteSelection()
[(WebView*)m_webView deleteSelection]; [(WebView*)m_webView deleteSelection];
} }
bool wxWebViewWebKit::HasSelection() bool wxWebViewWebKit::HasSelection() const
{ {
DOMRange* range = [m_webView selectedDOMRange]; DOMRange* range = [m_webView selectedDOMRange];
if(!range) if(!range)
@ -889,7 +889,7 @@ void wxWebViewWebKit::SelectAll()
RunScript("window.getSelection().selectAllChildren(document.body);"); RunScript("window.getSelection().selectAllChildren(document.body);");
} }
wxString wxWebViewWebKit::GetSelectedSource() wxString wxWebViewWebKit::GetSelectedSource() const
{ {
wxString script = ("var range = window.getSelection().getRangeAt(0);" wxString script = ("var range = window.getSelection().getRangeAt(0);"
"var element = document.createElement('div');" "var element = document.createElement('div');"
@ -900,7 +900,7 @@ wxString wxWebViewWebKit::GetSelectedSource()
return wxStringWithNSString([result stringValue]); return wxStringWithNSString([result stringValue]);
} }
wxString wxWebViewWebKit::GetPageText() wxString wxWebViewWebKit::GetPageText() const
{ {
id result = [[m_webView windowScriptObject] id result = [[m_webView windowScriptObject]
evaluateWebScript:@"document.body.textContent"]; evaluateWebScript:@"document.body.textContent"];
@ -962,12 +962,12 @@ void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item)
[m_webView goToBackForwardItem:item->m_histItem]; [m_webView goToBackForwardItem:item->m_histItem];
} }
bool wxWebViewWebKit::CanUndo() bool wxWebViewWebKit::CanUndo() const
{ {
return [[m_webView undoManager] canUndo]; return [[m_webView undoManager] canUndo];
} }
bool wxWebViewWebKit::CanRedo() bool wxWebViewWebKit::CanRedo() const
{ {
return [[m_webView undoManager] canRedo]; return [[m_webView undoManager] canRedo];
} }