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

==========================================================================================================================================
|phoenix_title|  **wx.richtext.RichTextBufferDataObject**
==========================================================================================================================================

Implements a rich text data object for clipboard transfer.          







         



.. seealso:: :ref:`wx.DataObjectSimple`, :ref:`wx.richtext.RichTextBuffer`, :ref:`wx.richtext.RichTextCtrl`    







|

|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>RichTextBufferDataObject</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.RichTextBufferDataObject_inheritance.png" alt="Inheritance diagram of RichTextBufferDataObject" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.DataObjectSimple.html" title="wx.DataObjectSimple" alt="" coords="53,83,211,112"/> <area shape="rect" id="node3" href="wx.richtext.RichTextBufferDataObject.html" title="wx.richtext.RichTextBufferDataObject" alt="" coords="5,160,259,189"/> <area shape="rect" id="node2" href="wx.DataObject.html" title="wx.DataObject" alt="" coords="75,5,189,35"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextBufferDataObject.__init__`                           The constructor doesn't copy the pointer, so it shouldn't go away while this object is alive.
:meth:`~wx.richtext.RichTextBufferDataObject.GetDataHere`                        Copy the data to the buffer, return ``True`` on success.
:meth:`~wx.richtext.RichTextBufferDataObject.GetDataSize`                        Gets the size of our data.
:meth:`~wx.richtext.RichTextBufferDataObject.GetPreferredFormat`                 Returns the preferred format for either rendering the data (if `dir`  is  ``Get`` , its default value) or for setting it.
:meth:`~wx.richtext.RichTextBufferDataObject.GetRichTextBuffer`                  After a call to this function, the buffer is owned by the caller and it is responsible for deleting it.
:meth:`~wx.richtext.RichTextBufferDataObject.GetRichTextBufferFormatId`          Returns the id for the new data format.
:meth:`~wx.richtext.RichTextBufferDataObject.SetData`                            Copy the data from the buffer, return ``True`` on success.
================================================================================ ================================================================================


|


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

================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextBufferDataObject.DataSize`                           See :meth:`~wx.richtext.RichTextBufferDataObject.GetDataSize`
:attr:`~wx.richtext.RichTextBufferDataObject.RichTextBuffer`                     See :meth:`~wx.richtext.RichTextBufferDataObject.GetRichTextBuffer`
================================================================================ ================================================================================


|


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


.. class:: wx.richtext.RichTextBufferDataObject(DataObjectSimple)

   **Possible constructors**::

       RichTextBufferDataObject(richTextBuffer=None)
       
   
   Implements a rich text data object for clipboard transfer.



   .. method:: __init__(self, richTextBuffer=None)

      The constructor doesn't copy the pointer, so it shouldn't go away while this object is alive.                  


      :param `richTextBuffer`: 
      :type `richTextBuffer`: wx.richtext.RichTextBuffer







   .. method:: GetDataHere(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **GetDataHere** `(self, buf)`
      
      Copy the data to the buffer, return ``True`` on success.                  
      
      Must be implemented in the derived class if the object supports rendering its data.                  
      
      
      :param `buf`: 
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**

      
      **GetDataHere** `(self, format, buf)`
      
      The method will write the data of the format `format`  to the buffer `buf`.                  
      
      In other words, copy the data from this object in the given format to the supplied buffer. Returns ``True`` on success, ``False`` on failure.                  
      
      
      :param `format`: 
      :type `format`: wx.DataFormat
      :param `buf`: 
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**






   .. method:: GetDataSize(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **GetDataSize** `(self)`
      
      Gets the size of our data.                  
      
      Must be implemented in the derived class if the object supports rendering its data.                  
      
      :rtype: `int`
      
      
      
      
      
      
      
      **~~~**

      
      **GetDataSize** `(self, format)`
      
      Returns the data size of the given format `format`.                  
      
      
      :param `format`: 
      :type `format`: wx.DataFormat
      
      
      
      
      :rtype: `int`
      
      
      
      
      
      
      
      **~~~**






   .. method:: GetPreferredFormat(self, dir)

      Returns the preferred format for either rendering the data (if `dir`  is  ``Get`` , its default value) or for setting it.                   

      Usually this will be the native format of the :ref:`wx.DataObject`.                  


      :param `dir`: 
      :type `dir`: wx.DataObject.Direction




      :rtype: :ref:`DataFormat`








   .. method:: GetRichTextBuffer(self)

      After a call to this function, the buffer is owned by the caller and it is responsible for deleting it.                  

      :rtype: :ref:`wx.richtext.RichTextBuffer`








   .. staticmethod:: GetRichTextBufferFormatId()

      Returns the id for the new data format.                  

      :rtype: :ref:`wx.Char`








   .. method:: SetData(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **SetData** `(self, len, buf)`
      
      Copy the data from the buffer, return ``True`` on success.                  
      
      Must be implemented in the derived class if the object supports setting its data.                  
      
      
      :param `len`: 
      :type `len`: int
      :param `buf`: 
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**

      
      **SetData** `(self, format, len, buf)`
      
      Set the data in the format `format`  of the length `len`  provided in the buffer `buf`.                  
      
      In other words, copy length bytes of data from the buffer to this data object. 
      
      
      
      
      :param `format`: The format for which to set the data.   
      :type `format`: wx.DataFormat
      :param `len`: The size of data in bytes.   
      :type `len`: int
      :param `buf`: Non-NULL pointer to the data.   
      
      
      
      
      
      
      
      
      
      
      :rtype: `bool`
      
      
      
                        
      
      
      
      :returns: 
      
         ``True`` on success, ``False`` on failure.   
      
      
      
      
      
      
      
      **~~~**






   .. attribute:: DataSize

      See :meth:`~wx.richtext.RichTextBufferDataObject.GetDataSize`


   .. attribute:: RichTextBuffer

      See :meth:`~wx.richtext.RichTextBufferDataObject.GetRichTextBuffer`

