Rename wxWebFileHandler to wxWebViewArchiveHandler, wxWebHandler to wxWebViewHandler. Update the documentation and the sample. Add a constructor taking a wxString to specify the scheme in wxWebViewHandler.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton
2011-08-14 12:15:34 +00:00
parent 3beb50e570
commit 7d8d6163ad
12 changed files with 62 additions and 56 deletions

View File

@@ -117,7 +117,7 @@ public:
};
/**
@class wxWebHandler
@class wxWebViewHandler
The base class for handling custom schemes in wxWebView, for example to
allow virtual file system support.
@@ -127,16 +127,22 @@ public:
@see wxWebView
*/
class wxWebHandler
class wxWebViewHandler
{
public:
/**
Constructor. Takes the name of the scheme that will be handled by this
class for example @c file or @c zip.
*/
wxWebViewHandler(const wxString& scheme);
/**
@return A pointer to the file represented by @c uri.
*/
virtual wxFSFile* GetFile(const wxString &uri) = 0;
/**
@return The name of the scheme, for example @c file or @c http.
@return The name of the scheme, as passed to the constructor.
*/
virtual wxString GetName() const = 0;
};
@@ -196,8 +202,7 @@ public:
wxWebView supports the registering of custom scheme handlers, for example
@c file or @c http. To do this create a new class which inherits from
wxWebHandler, where the wxWebHandler::GetName() method returns the scheme
you wish to handle and wxWebHandler::GetFile() returns a pointer to a
wxWebViewHandler, where wxWebHandler::GetFile() returns a pointer to a
wxFSFile which represents the given url. You can then register your handler
with RegisterHandler() it will be called for all pages and resources.
@@ -338,7 +343,7 @@ public:
Registers a custom scheme handler.
@param handler A shared pointer to a wxWebHandler.
*/
virtual void RegisterHandler(wxSharedPtr<wxWebHandler> handler) = 0;
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) = 0;
/**
Reload the currently displayed URL.

View File

@@ -1,31 +1,31 @@
/////////////////////////////////////////////////////////////////////////////
// Name: webfilehandler.h
// Purpose: interface of wxWebFileHandler
// Purpose: interface of wxWebViewArchiveHandler
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@class wxWebFileHandler
@class wxWebViewArchiveHandler
A custom handler for the file scheme which also supports loading from
archives. The syntax for wxWebFileHandler differs from virtual file
archives. The syntax for wxWebViewArchiveHandler differs from virtual file
systems in the rest of wxWidgets by using a syntax such as
@c file:///C:/exmaple/docs.zip;protocol=zip/main.htm Currently the only
supported protocol is @c zip.
<code> scheme:///C:/exmaple/docs.zip;protocol=zip/main.htm </code>
Currently the only supported protocol is @c zip.
@library{wxweb}
@category{web}
@see wxWebView, wxWebHandler
@see wxWebView, wxWebViewHandler
*/
class wxWebFileHandler : public wxWebHandler
class wxWebViewArchiveHandler : public wxWebViewHandler
{
public:
/**
@return The string @c "file"
Constructor.
*/
virtual wxString GetName() const;
wxWebViewArchiveHandler(const wxString& scheme);
virtual wxFSFile* GetFile(const wxString &uri);
};