Initial implementation of wxWebProtocolHandler and wxWebFileProtocolHandler for the IE backend. This allows browsing of local files and files in zip archives when using a query string which specifies the protocol and path.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,6 +26,20 @@ struct IHTMLDocument2;
|
||||
class wxFSFile;
|
||||
class wxFileSystem;
|
||||
|
||||
//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;
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_WEB wxWebViewIE : public wxWebView
|
||||
{
|
||||
public:
|
||||
@@ -111,6 +125,9 @@ public:
|
||||
|
||||
virtual void RunScript(const wxString& javascript);
|
||||
|
||||
//Virtual Filesystem Support
|
||||
virtual void RegisterProtocol(wxWebProtocolHandler* hanlder);
|
||||
|
||||
// ---- IE-specific methods
|
||||
|
||||
// FIXME: I seem to be able to access remote webpages even in offline mode...
|
||||
@@ -167,10 +184,10 @@ protected:
|
||||
VOID * fileP;
|
||||
|
||||
wxFSFile* m_file;
|
||||
wxFileSystem* m_fileSys;
|
||||
wxWebProtocolHandler* m_handler;
|
||||
|
||||
public:
|
||||
VirtualProtocol();
|
||||
VirtualProtocol(wxWebProtocolHandler *handler);
|
||||
~VirtualProtocol();
|
||||
|
||||
//IUnknown
|
||||
@@ -228,6 +245,7 @@ class ClassFactory : public IClassFactory
|
||||
private:
|
||||
ULONG m_refCount;
|
||||
public:
|
||||
ClassFactory(wxWebProtocolHandler* handler) : m_handler(handler) {}
|
||||
//IUnknown
|
||||
ULONG STDMETHODCALLTYPE AddRef();
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);
|
||||
@@ -237,6 +255,8 @@ public:
|
||||
HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown* pUnkOuter,
|
||||
REFIID riid, void** ppvObject);
|
||||
HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock);
|
||||
private:
|
||||
wxWebProtocolHandler* m_handler;
|
||||
};
|
||||
|
||||
#endif // wxUSE_WEBVIEW_IE
|
||||
|
Reference in New Issue
Block a user