Move the wxWebFileProtocolHandler from the IE backend to the common source, add the RegisterProtocol method to all classes (as a stub in GTK and OSX). Register the file protocol handler in the sample for testing purposes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-07-28 16:49:48 +00:00
parent 293656292f
commit eff8f7952e
7 changed files with 125 additions and 110 deletions

View File

@@ -21,6 +21,7 @@
#include "wx/vector.h"
class wxFSFile;
class wxFileSystem;
class WXDLLIMPEXP_WEB wxWebHistoryItem
{
@@ -106,6 +107,7 @@ enum wxWebViewBackend
wxWEB_VIEW_BACKEND_IE
};
//Base class for custom protocol handlers
class WXDLLIMPEXP_WEB wxWebProtocolHandler
{
public:
@@ -114,6 +116,20 @@ public:
virtual wxString CombineURIs(const wxString &baseuri, const wxString &newuri) = 0;
};
//Loads from uris such as file:///C:/example/example.html or archives such as
//file:///C:/example/example.zip?protocol=zip;path=example.html
class WXDLLIMPEXP_WEB wxWebFileProtocolHandler : public wxWebProtocolHandler
{
public:
wxWebFileProtocolHandler();
virtual wxString GetProtocol() { return m_protocol; }
virtual wxFSFile* GetFile(const wxString &uri);
virtual wxString CombineURIs(const wxString &baseuri, const wxString &newuri);
private:
wxString m_protocol;
wxFileSystem* m_fileSystem;
};
extern WXDLLIMPEXP_DATA_WEB(const char) wxWebViewNameStr[];
extern WXDLLIMPEXP_DATA_WEB(const char) wxWebViewDefaultURLStr[];
@@ -343,6 +359,9 @@ public:
virtual bool CanRedo() = 0;
virtual void Undo() = 0;
virtual void Redo() = 0;
//Virtual Filesystem Support
virtual void RegisterProtocol(wxWebProtocolHandler* handler) = 0;
};
class WXDLLIMPEXP_WEB wxWebNavigationEvent : public wxCommandEvent