.. wxPython Phoenix documentation

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

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

.. include:: headings.inc



.. _wx.html.HtmlFilter:

==========================================================================================================================================
|phoenix_title|  **wx.html.HtmlFilter**
==========================================================================================================================================

This class is the parent class of input filters for :ref:`wx.html.HtmlWindow`.          

It allows you to read and display files of different file formats. 







         



.. seealso:: :ref:`Input Filters <input filters>`    







|

|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>HtmlFilter</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.html.HtmlFilter_inheritance.png" alt="Inheritance diagram of HtmlFilter" 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.html.HtmlFilter.html" title="This class is the parent class of input filters for wx.html.HtmlWindow." alt="" coords="5,83,151,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="34,5,122,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.html.HtmlFilter.__init__`                                             Constructor.
:meth:`~wx.html.HtmlFilter.CanRead`                                              Returns ``True`` if this filter is capable of reading file `file`.
:meth:`~wx.html.HtmlFilter.ReadFile`                                             Reads the file and returns string with HTML document.
================================================================================ ================================================================================


|


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


.. class:: wx.html.HtmlFilter(Object)

   **Possible constructors**::

       HtmlFilter()
       
   
   This class is the parent class of input filters for HtmlWindow.



   .. method:: __init__(self)

      Constructor.                   





   .. method:: CanRead(self, file)

      Returns ``True`` if this filter is capable of reading file `file`.                  

      Example: ::

          def CanRead(file):

              # file is a wx.FSFile in this case...
              return (file.GetMimeType() == "application/x-ugh")

                 


      :param `file`: 
      :type `file`: wx.FSFile




      :rtype: `bool`








   .. method:: ReadFile(self, file)

      Reads the file and returns string with HTML document.                  

      Example: ::

          def ReadFile(file):

              # file is a wx.FSFile in this case...
              return "<html><body><img src=\"" + file.GetLocation() + \
                     "\"></body></html>"

                 


      :param `file`: 
      :type `file`: wx.FSFile




      :rtype: `string`