.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.html2.WebViewHandler:

==========================================================================================================================================
|phoenix_title|  **wx.html2.WebViewHandler**
==========================================================================================================================================

The base class for handling custom schemes in :ref:`wx.html2.WebView`, for example to allow virtual file system support. 
         

A new handler should either implement :meth:`~wx.html2.WebViewHandler.GetFile`  or if a more detailed request handling is required (access to headers, post data) :meth:`~wx.html2.WebViewHandler.StartRequest`  has to be implemented. 

:ref:`wx.html2.WebView` 




         



.. versionadded:: 2.9.3 
     







.. seealso:: :ref:`wx.html2.WebView`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>WebViewHandler</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.html2.WebViewHandler_inheritance.svg" alt="Inheritance diagram of WebViewHandler" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.html2.WebViewHandler.html" title="The base class for handling custom schemes in wx.html2.WebView, for example to allow virtual file system support." alt="" coords="5,5,226,34"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.html2.WebViewArchiveHandler`, :ref:`wx.html2.WebViewFSHandler`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.html2.WebViewHandler.__init__`                                        Constructor.
:meth:`~wx.html2.WebViewHandler.GetFile`                                         
:meth:`~wx.html2.WebViewHandler.GetName`                                         
:meth:`~wx.html2.WebViewHandler.GetSecurityURL`                                  
:meth:`~wx.html2.WebViewHandler.GetVirtualHost`                                  
:meth:`~wx.html2.WebViewHandler.SetSecurityURL`                                  Sets a custom security URL.
:meth:`~wx.html2.WebViewHandler.SetVirtualHost`                                  When using the edge backend handler urls are https urls with a virtual host.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.html2.WebViewHandler.Name`                                            See :meth:`~wx.html2.WebViewHandler.GetName`
:attr:`~wx.html2.WebViewHandler.SecurityURL`                                     See :meth:`~wx.html2.WebViewHandler.GetSecurityURL` and :meth:`~wx.html2.WebViewHandler.SetSecurityURL`
:attr:`~wx.html2.WebViewHandler.VirtualHost`                                     See :meth:`~wx.html2.WebViewHandler.GetVirtualHost` and :meth:`~wx.html2.WebViewHandler.SetVirtualHost`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.html2.WebViewHandler(object)

   **Possible constructors**::

       WebViewHandler(scheme) -> None
       
   
   The base class for handling custom schemes in WebView, for example
   to allow virtual file system support.



   .. method:: __init__(self, scheme)

      Constructor. 
                 

      Takes the name of the scheme that will be handled by this class for example  ``file``   or   ``zip`` .  
                 


      :param `scheme`: 
      :type `scheme`: string




      :rtype: `None`     








   .. method:: GetFile(self, uri)




                


      :param `uri`: 
      :type `uri`: string




      :rtype: `FSFile`     







      :returns: 

         A pointer to the file represented by  ``uri`` .    








   .. method:: GetName(self)




                

      :rtype: `str`







      :returns: 

         The name of the scheme, as passed to the constructor.   








   .. method:: GetSecurityURL(self)




                

      :rtype: `str`







      :returns: 

         The custom security URL. Only used by `WebViewIE`     .  







      .. versionadded:: 4.1/wxWidgets-3.1.5  
     








   .. method:: GetVirtualHost(self)




                

      :rtype: `str`







      :returns: 

         The virtual host of this handler  







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     







      .. seealso:: :meth:`SetVirtualHost`     








   .. method:: SetSecurityURL(self, url)

      Sets a custom security URL. 
                 

      Only used by `WebViewIE`     . 


                


      :param `url`: 
      :type `url`: string




      :rtype: `None`     







      .. versionadded:: 4.1/wxWidgets-3.1.5  
     








   .. method:: SetVirtualHost(self, host)

      When using the edge backend handler urls are https urls with a virtual host. 
                 

      As default  ``name.wxsite``   is used as the virtual hostname. If you customize this host, use a non existing site (ideally a reserved subdomain of a domain you control). If   ``localassests.domain.example``   is used the handlers content will be available under https://localassets.domain.example/ 

      This has to be set **before**  registering the handler via :meth:`wx.html2.WebView.RegisterHandler` . 


                


      :param `host`: 
      :type `host`: string




      :rtype: `None`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. attribute:: Name

      See :meth:`~wx.html2.WebViewHandler.GetName`


   .. attribute:: SecurityURL

      See :meth:`~wx.html2.WebViewHandler.GetSecurityURL` and :meth:`~wx.html2.WebViewHandler.SetSecurityURL`


   .. attribute:: VirtualHost

      See :meth:`~wx.html2.WebViewHandler.GetVirtualHost` and :meth:`~wx.html2.WebViewHandler.SetVirtualHost`

