.. 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.richtext.RichTextXMLHandler:

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextXMLHandler**
==========================================================================================================================================

A handler for loading and saving content in an ``XML`` format specific to :ref:`wx.richtext.RichTextBuffer`.          

You can either add the handler to the buffer and load and save through the buffer or control API, or you can create an instance of the handler on the stack and call its functions directly. 



|phoenix_title| Handler flags
=============================

The following flags can be used with this handler, via the handler's :meth:`~wx.richtext.RichTextXMLHandler.SetFlags`  function or the buffer or control's SetHandlerFlags() function: 

- ``wx.richtext.RICHTEXT_HANDLER_INCLUDE_STYLESHEET`` Include the style sheet in loading and saving operations. 






|

|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>RichTextXMLHandler</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.richtext.RichTextXMLHandler_inheritance.png" alt="Inheritance diagram of RichTextXMLHandler" 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.richtext.RichTextXMLHandler.html" title="wx.richtext.RichTextXMLHandler" alt="" coords="5,160,237,189"/> <area shape="rect" id="node2" href="wx.richtext.RichTextFileHandler.html" title="wx.richtext.RichTextFileHandler" alt="" coords="8,83,235,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="78,5,165,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextXMLHandler.__init__`                                 Constructor.
:meth:`~wx.richtext.RichTextXMLHandler.CanLoad`                                  Returns ``True``.
:meth:`~wx.richtext.RichTextXMLHandler.CanSave`                                  Returns ``True``.
:meth:`~wx.richtext.RichTextXMLHandler.ClearNodeToClassMap`                      Cleans up the mapping between node name and C++ class.
:meth:`~wx.richtext.RichTextXMLHandler.ExportXML`                                Recursively exports an object to the stream.
:meth:`~wx.richtext.RichTextXMLHandler.ImportXML`                                Recursively imports an object.
:meth:`~wx.richtext.RichTextXMLHandler.RegisterNodeName`                         Call with ``XML`` node name, C++ class name so that ``RTC`` can read in the node.
================================================================================ ================================================================================


|


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


.. class:: wx.richtext.RichTextXMLHandler(RichTextFileHandler)

   **Possible constructors**::

       RichTextXMLHandler(name="XML", ext="xml", type=RICHTEXT_TYPE_XML)
       
   
   A handler for loading and saving content in an ``XML`` format specific to
   RichTextBuffer.



   .. method:: __init__(self, name="XML", ext="xml", type=RICHTEXT_TYPE_XML)

      Constructor.                  


      :param `name`: 
      :type `name`: string
      :param `ext`: 
      :type `ext`: string
      :param `type`: 
      :type `type`: int







   .. method:: CanLoad(self)

      Returns ``True``.                  

      :rtype: `bool`








   .. method:: CanSave(self)

      Returns ``True``.                  

      :rtype: `bool`








   .. staticmethod:: ClearNodeToClassMap()

      Cleans up the mapping between node name and C++ class.                   





   .. method:: ExportXML(self, stream, obj, level)

      Recursively exports an object to the stream.                  


      :param `stream`: 
      :type `stream`: wx.OutputStream
      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject
      :param `level`: 
      :type `level`: int




      :rtype: `bool`








   .. method:: ImportXML(self, buffer, obj, node)

      Recursively imports an object.                  


      :param `buffer`: 
      :type `buffer`: wx.richtext.RichTextBuffer
      :param `obj`: 
      :type `obj`: wx.richtext.RichTextObject
      :param `node`: 
      :type `node`: wx.xml.XmlNode




      :rtype: `bool`








   .. staticmethod:: RegisterNodeName(nodeName, className)

      Call with ``XML`` node name, C++ class name so that ``RTC`` can read in the node.                  

      If you add a custom object, call this.                  


      :param `nodeName`: 
      :type `nodeName`: string
      :param `className`: 
      :type `className`: string






