+void wxWebViewWebKit::ClearHistory()
+{
+ [m_webView setMaintainsBackForwardList:NO];
+ [m_webView setMaintainsBackForwardList:YES];
+}
+
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetBackwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > backhist;
+ WebBackForwardList* history = [m_webView backForwardList];
+ int count = [history backListCount];
+ for(int i = -count; i < 0; i++)
+ {
+ WebHistoryItem* item = [history itemAtIndex:i];
+ wxString url = wxStringWithNSString([item URLString]);
+ wxString title = wxStringWithNSString([item title]);
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(url, title);
+ wxitem->m_histItem = item;
+ wxSharedPtr<wxWebViewHistoryItem> itemptr(wxitem);
+ backhist.push_back(itemptr);
+ }
+ return backhist;
+}
+
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetForwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > forwardhist;
+ WebBackForwardList* history = [m_webView backForwardList];
+ int count = [history forwardListCount];
+ for(int i = 1; i <= count; i++)
+ {
+ WebHistoryItem* item = [history itemAtIndex:i];
+ wxString url = wxStringWithNSString([item URLString]);
+ wxString title = wxStringWithNSString([item title]);
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(url, title);
+ wxitem->m_histItem = item;
+ wxSharedPtr<wxWebViewHistoryItem> itemptr(wxitem);
+ forwardhist.push_back(itemptr);
+ }
+ return forwardhist;
+}
+
+void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item)
+{
+ [m_webView goToBackForwardItem:item->m_histItem];
+}
+
+bool wxWebViewWebKit::CanUndo() const
+{
+ return [[m_webView undoManager] canUndo];
+}
+
+bool wxWebViewWebKit::CanRedo() const
+{
+ return [[m_webView undoManager] canRedo];
+}
+
+void wxWebViewWebKit::Undo()
+{
+ [[m_webView undoManager] undo];
+}
+
+void wxWebViewWebKit::Redo()
+{
+ [[m_webView undoManager] redo];
+}
+
+void wxWebViewWebKit::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler)
+{
+ g_stringHandlerMap[handler->GetName()] = handler;
+}
+