#include "wx/msw/ole/automtn.h"
#include "wx/msw/ole/activex.h"
#include "wx/sharedptr.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; }
-
-private:
- wxString m_url, m_title;
-};
+#include "wx/vector.h"
class WXDLLIMPEXP_WEB wxWebViewIE : public wxWebView
{
virtual void LoadUrl(const wxString& url);
virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item);
+ virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory();
+ virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory();
virtual bool CanGoForward();
virtual bool CanGoBack();
#include <wx/control.h>
#include <wx/event.h>
#include <wx/sstream.h>
+#include "wx/sharedptr.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; }
+
+private:
+ wxString m_url, m_title;
+};
/**
* Zoom level in web view component
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;
/**
* Stop the current page loading process, if any.
Enable or disable the history. This will also clear the history.\r
*/\r
virtual void EnableHistory(bool enable = true) = 0;\r
+\r
+ /**\r
+ Returns a list of items in the back history. The first item in the\r
+ vector is the first page that was loaded by the control.\r
+ */\r
+ virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetBackwardHistory() = 0;\r
+ \r
+ /**\r
+ Returns a list of items in the forward history. The first item in the \r
+ vector is the next item in the history with respect to the curently \r
+ loaded page.\r
+ */\r
+ virtual wxVector<wxSharedPtr<wxWebHistoryItem> > GetForwardHistory() = 0;\r
+ \r
+ /**\r
+ Loads a history item. \r
+ */\r
+ virtual void LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item) = 0;\r
\r
/**\r
Load a HTMl document (web page) from a URL\r
m_historyPosition = pos;
}
+wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewIE::GetBackwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebHistoryItem> > 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++)
+ {
+ backhist.push_back(m_historyList[i]);
+ }
+ return backhist;
+}
+
+wxVector<wxSharedPtr<wxWebHistoryItem> > wxWebViewIE::GetForwardHistory()
+{
+ wxVector<wxSharedPtr<wxWebHistoryItem> > 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 < m_historyList.size(); i++)
+ {
+ forwardhist.push_back(m_historyList[i]);
+ }
+ return forwardhist;
+}
+
void wxWebViewIE::GoBack()
{
LoadHistoryItem(m_historyList[m_historyPosition - 1]);