+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: include/wx/gtk/webhistoryitem.h
-// Purpose: wxWebHistoryItem header for GTK
-// Author: Steven Lamerton
-// Id: $Id$
-// Copyright: (c) 2011 Steven Lamerton
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef _WX_GTK_WEBHISTORYITEM_H_
-#define _WX_GTK_WEBHISTORYITEM_H_
-
-#include "wx/setup.h"
-
-#if wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
-
-#include "webkit/webkit.h"
-
-class WXDLLIMPEXP_WEB wxWebHistoryItem
-{
-public:
- wxWebHistoryItem(const wxString& url, const wxString& title) :
- m_url(url), m_title(title) {}
- wxString GetUrl() { return m_url; }
- wxString GetTitle() { return m_title; }
-
- friend class wxWebViewWebKit;
-
-private:
- wxString m_url, m_title;
- WebKitWebHistoryItem* m_histItem;
-};
-
-#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
-
-#endif // _WX_GTK_WEBHISTORYITEM_H_
virtual bool CanGoForward();
virtual void ClearHistory();
virtual void EnableHistory(bool enable = true);
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory();
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory();
- virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item);
+ 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();
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: include/wx/gtk/webviewhistoryitem.h
+// Purpose: wxWebViewHistoryItem header for GTK
+// Author: Steven Lamerton
+// Id: $Id$
+// Copyright: (c) 2011 Steven Lamerton
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_GTK_WEBVIEWHISTORYITEM_H_
+#define _WX_GTK_WEBVIEWHISTORYITEM_H_
+
+#include "wx/setup.h"
+
+#if wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
+
+#include "webkit/webkit.h"
+
+class WXDLLIMPEXP_WEB wxWebViewHistoryItem
+{
+public:
+ wxWebViewHistoryItem(const wxString& url, const wxString& title) :
+ m_url(url), m_title(title) {}
+ wxString GetUrl() { return m_url; }
+ wxString GetTitle() { return m_title; }
+
+ friend class wxWebViewWebKit;
+
+private:
+ wxString m_url, m_title;
+ WebKitWebHistoryItem* m_histItem;
+};
+
+#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
+
+#endif // _WX_GTK_WEBVIEWHISTORYITEM_H_
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: include/wx/msw/webhistoryitem.h
-// Purpose: wxWebHistoryItem header for MSW
-// Author: Steven Lamerton
-// Id: $Id$
-// Copyright: (c) 2011 Steven Lamerton
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef _WX_MSW_WEBHISTORYITEM_H_
-#define _WX_MSW_WEBHISTORYITEM_H_
-
-#include "wx/setup.h"
-
-#if wxUSE_WEBVIEW_IE && defined(__WXMSW__)
-
-class WXDLLIMPEXP_WEB wxWebHistoryItem
-{
-public:
- wxWebHistoryItem(const wxString& url, const wxString& title) :
- m_url(url), m_title(title) {}
- wxString GetUrl() { return m_url; }
- wxString GetTitle() { return m_title; }
-
-private:
- wxString m_url, m_title;
-};
-
-#endif // wxUSE_WEBVIEW_IE && defined(__WXMSW__)
-
-#endif // _WX_MSW_WEBHISTORYITEM_H_
const wxString& name = wxWebViewNameStr);
virtual void LoadUrl(const wxString& url);
- virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item);
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory();
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory();
+ virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item);
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
virtual bool CanGoForward();
virtual bool CanGoBack();
//which are added as documentcomplete events arrive, unless we are loading
//an item from the history. The position is stored as an int, and reflects
//where we are in the history list.
- wxVector<wxSharedPtr<wxWebHistoryItem> > m_historyList;
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > m_historyList;
int m_historyPosition;
bool m_historyLoadingFromList;
bool m_historyEnabled;
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: include/wx/msw/webviewhistoryitem.h
+// Purpose: wxWebViewHistoryItem header for MSW
+// Author: Steven Lamerton
+// Id: $Id$
+// Copyright: (c) 2011 Steven Lamerton
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_MSW_WEBVIEWHISTORYITEM_H_
+#define _WX_MSW_WEBVIEWHISTORYITEM_H_
+
+#include "wx/setup.h"
+
+#if wxUSE_WEBVIEW_IE && defined(__WXMSW__)
+
+class WXDLLIMPEXP_WEB wxWebViewHistoryItem
+{
+public:
+ wxWebViewHistoryItem(const wxString& url, const wxString& title) :
+ m_url(url), m_title(title) {}
+ wxString GetUrl() { return m_url; }
+ wxString GetTitle() { return m_title; }
+
+private:
+ wxString m_url, m_title;
+};
+
+#endif // wxUSE_WEBVIEW_IE && defined(__WXMSW__)
+
+#endif // _WX_MSW_WEBVIEWHISTORYITEM_H_
+++ /dev/null
-/////////////////////////////////////////////////////////////////////////////
-// Name: include/wx/osx/webhistoryitem.h
-// Purpose: wxWebHistoryItem header for OSX
-// Author: Steven Lamerton
-// Id: $Id$
-// Copyright: (c) 2011 Steven Lamerton
-// Licence: wxWindows licence
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef _WX_OSX_WEBHISTORYITEM_H_
-#define _WX_OSX_WEBHISTORYITEM_H_
-
-#include "wx/setup.h"
-
-#if wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \
- || defined(__WXOSX_CARBON__))
-
-class WXDLLIMPEXP_WEB wxWebHistoryItem
-{
-public:
- wxWebHistoryItem(const wxString& url, const wxString& title) :
- m_url(url), m_title(title) {}
- wxString GetUrl() { return m_url; }
- wxString GetTitle() { return m_title; }
-
- friend class wxWebViewWebKit;
-
-private:
- wxString m_url, m_title;
- struct objc_object *m_histItem;
-};
-
-#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX_MAC__)
-
-#endif // _WX_OSX_WEBHISTORYITEM_H_
//History functions
virtual void ClearHistory();
virtual void EnableHistory(bool enable = true);
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory();
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory();
- virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item);
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory();
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory();
+ virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item);
//Undo / redo functionality
virtual bool CanUndo();
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: include/wx/osx/webviewhistoryitem.h
+// Purpose: wxWebViewHistoryItem header for OSX
+// Author: Steven Lamerton
+// Id: $Id$
+// Copyright: (c) 2011 Steven Lamerton
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_OSX_WEBVIEWHISTORYITEM_H_
+#define _WX_OSX_WEBVIEWHISTORYITEM_H_
+
+#include "wx/setup.h"
+
+#if wxUSE_WEBVIEW_WEBKIT && (defined(__WXOSX_COCOA__) \
+ || defined(__WXOSX_CARBON__))
+
+class WXDLLIMPEXP_WEB wxWebViewHistoryItem
+{
+public:
+ wxWebViewHistoryItem(const wxString& url, const wxString& title) :
+ m_url(url), m_title(title) {}
+ wxString GetUrl() { return m_url; }
+ wxString GetTitle() { return m_title; }
+
+ friend class wxWebViewWebKit;
+
+private:
+ wxString m_url, m_title;
+ struct objc_object *m_histItem;
+};
+
+#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXOSX_MAC__)
+
+#endif // _WX_OSX_WEBVIEWHISTORYITEM_H_
#include "wx/sharedptr.h"
#include "wx/vector.h"
-#include "wx/osx/webhistoryitem_webkit.h"
-#include "wx/gtk/webhistoryitem_webkit.h"
-#include "wx/msw/webhistoryitem_ie.h"
+#include "wx/osx/webviewhistoryitem_webkit.h"
+#include "wx/gtk/webviewhistoryitem_webkit.h"
+#include "wx/msw/webviewhistoryitem_ie.h"
class wxFSFile;
class wxFileSystem;
virtual void ClearHistory() = 0;
virtual void EnableHistory(bool enable = true) = 0;
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory() = 0;
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory() = 0;
- virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) = 0;
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory() = 0;
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory() = 0;
+ virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item) = 0;
/**
* Stop the current page loading process, if any.
};
/**
- @class wxWebHistoryItem
+ @class wxWebViewHistoryItem
A simple class that contains the URL and title of an element of the history
of a wxWebView.
@see wxWebView
*/
-class wxWebHistoryItem
+class wxWebViewHistoryItem
{
public:
/**
Construtor.
*/
- wxWebHistoryItem(const wxString& url, const wxString& title);
+ wxWebViewHistoryItem(const wxString& url, const wxString& title);
/**
@return The url of the page.
Returns a list of items in the back history. The first item in the
vector is the first page that was loaded by the control.
*/
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory() = 0;
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory() = 0;
/**
Returns a list of items in the forward history. The first item in the
vector is the next item in the history with respect to the curently
loaded page.
*/
- virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory() = 0;
+ virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory() = 0;
/**
Navigate back in the history of visited pages.
/**
Loads a history item.
*/
- virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) = 0;
+ virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item) = 0;
/**
@name Selection
//We map menu items to their history items
-WX_DECLARE_HASH_MAP(int, wxSharedPtr<wxWebHistoryItem>,
+WX_DECLARE_HASH_MAP(int, wxSharedPtr<wxWebViewHistoryItem>,
wxIntegerHash, wxIntegerEqual, wxMenuHistoryMap);
class WebApp : public wxApp
}
m_histMenuItems.clear();
- wxVector<wxSharedPtr<wxWebHistoryItem> > back = m_browser->GetBackwardHistory();
- wxVector<wxSharedPtr<wxWebHistoryItem> > forward = m_browser->GetForwardHistory();
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > back = m_browser->GetBackwardHistory();
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > forward = m_browser->GetForwardHistory();
wxMenuItem* item;
item->Check();
//No need to connect the current item
- m_histMenuItems[item->GetId()] = wxSharedPtr<wxWebHistoryItem>(new wxWebHistoryItem(m_browser->GetCurrentURL(), m_browser->GetCurrentTitle()));
+ m_histMenuItems[item->GetId()] = wxSharedPtr<wxWebViewHistoryItem>(new wxWebViewHistoryItem(m_browser->GetCurrentURL(), m_browser->GetCurrentTitle()));
for(unsigned int i = 0; i < forward.size(); i++)
{
}
}
-wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewWebKit::GetBackwardHistory()
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetBackwardHistory()
{
- wxVector<wxSharedPtr<wxWebHistoryItem> > backhist;
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > backhist;
WebKitWebBackForwardList* history;
history = webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(web_view));
GList* list = webkit_web_back_forward_list_get_back_list_with_limit(history,
for(int i = g_list_length(list) - 1; i >= 0 ; i--)
{
WebKitWebHistoryItem* gtkitem = (WebKitWebHistoryItem*)g_list_nth_data(list, i);
- wxWebHistoryItem* wxitem = new wxWebHistoryItem(
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(
webkit_web_history_item_get_uri(gtkitem),
webkit_web_history_item_get_title(gtkitem));
wxitem->m_histItem = gtkitem;
- wxSharedPtr<wxWebHistoryItem> item(wxitem);
+ wxSharedPtr<wxWebViewHistoryItem> item(wxitem);
backhist.push_back(item);
}
return backhist;
}
-wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewWebKit::GetForwardHistory()
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetForwardHistory()
{
- wxVector<wxSharedPtr<wxWebHistoryItem> > forwardhist;
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > forwardhist;
WebKitWebBackForwardList* history;
history = webkit_web_view_get_back_forward_list(WEBKIT_WEB_VIEW(web_view));
GList* list = webkit_web_back_forward_list_get_forward_list_with_limit(history,
for(guint i = 0; i < g_list_length(list); i++)
{
WebKitWebHistoryItem* gtkitem = (WebKitWebHistoryItem*)g_list_nth_data(list, i);
- wxWebHistoryItem* wxitem = new wxWebHistoryItem(
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(
webkit_web_history_item_get_uri(gtkitem),
webkit_web_history_item_get_title(gtkitem));
wxitem->m_histItem = gtkitem;
- wxSharedPtr<wxWebHistoryItem> item(wxitem);
+ wxSharedPtr<wxWebViewHistoryItem> item(wxitem);
forwardhist.push_back(item);
}
return forwardhist;
}
-void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item)
+void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item)
{
WebKitWebHistoryItem* gtkitem = item->m_histItem;
if(gtkitem)
return false;
}
-void wxWebViewIE::LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item)
+void wxWebViewIE::LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item)
{
int pos = -1;
for(unsigned int i = 0; i < m_historyList.size(); i++)
m_historyPosition = pos;
}
-wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewIE::GetBackwardHistory()
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewIE::GetBackwardHistory()
{
- wxVector<wxSharedPtr<wxWebHistoryItem> > backhist;
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > backhist;
//As we don't have std::copy or an iterator constructor in the wxwidgets
//native vector we construct it by hand
for(int i = 0; i < m_historyPosition; i++)
return backhist;
}
-wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewIE::GetForwardHistory()
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewIE::GetForwardHistory()
{
- wxVector<wxSharedPtr<wxWebHistoryItem> > forwardhist;
+ wxVector<wxSharedPtr<wxWebViewHistoryItem> > forwardhist;
//As we don't have std::copy or an iterator constructor in the wxwidgets
//native vector we construct it by hand
for(int i = m_historyPosition + 1; i < static_cast<int>(m_historyList.size()); i++)
m_historyList.erase(m_historyList.begin() + m_historyPosition + 1,
m_historyList.end());
}
- wxSharedPtr<wxWebHistoryItem> item(new wxWebHistoryItem(url, GetCurrentTitle()));
+ wxSharedPtr<wxWebViewHistoryItem> item(new wxWebViewHistoryItem(url, GetCurrentTitle()));
m_historyList.push_back(item);
m_historyPosition++;
}
[m_webView setMaintainsBackForwardList:YES];
}
-wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewWebKit::GetBackwardHistory()
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetBackwardHistory()
{
- wxVector<wxSharedPtr<wxWebHistoryItem> > backhist;
+ 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]);
- wxWebHistoryItem* wxitem = new wxWebHistoryItem(url, title);
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(url, title);
wxitem->m_histItem = item;
- wxSharedPtr<wxWebHistoryItem> itemptr(wxitem);
+ wxSharedPtr<wxWebViewHistoryItem> itemptr(wxitem);
backhist.push_back(itemptr);
}
return backhist;
}
-wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewWebKit::GetForwardHistory()
+wxVector<wxSharedPtr<wxWebViewHistoryItem> > wxWebViewWebKit::GetForwardHistory()
{
- wxVector<wxSharedPtr<wxWebHistoryItem> > forwardhist;
+ 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]);
- wxWebHistoryItem* wxitem = new wxWebHistoryItem(url, title);
+ wxWebViewHistoryItem* wxitem = new wxWebViewHistoryItem(url, title);
wxitem->m_histItem = item;
- wxSharedPtr<wxWebHistoryItem> itemptr(wxitem);
+ wxSharedPtr<wxWebViewHistoryItem> itemptr(wxitem);
forwardhist.push_back(itemptr);
}
return forwardhist;
}
-void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item)
+void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item)
{
[m_webView goToBackForwardItem:item->m_histItem];
}