******************************* wx.richtext.RichTextFileHandler ******************************* Inheritance diagram for `wx.richtext.RichTextFileHandler`: | .. inheritance-diagram:: wx.richtext.RichTextFileHandler | Description =========== This is the base class for file handlers, for loading and/or saving content associated with a `wx.richtext.RichTextBuffer `_. Derived From ^^^^^^^^^^^^^ * `wx.Object <../Widgets/wx.Object.html>`_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.richtext.RichTextHTMLHandler `_, `wx.richtext.RichTextPlainTextHandler`, `wx.richtext.RichTextXMLHandler `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `CanHandle <#CanHandle>`_ * `CanLoad <#CanLoad>`_ * `CanSave <#CanSave>`_ * `GetEncoding <#GetEncoding>`_ * `GetExtension <#GetExtension>`_ * `GetFlags <#GetFlags>`_ * `GetName <#GetName>`_ * `GetType <#GetType>`_ * `IsVisible <#IsVisible>`_ * `LoadFile <#LoadFile>`_ * `LoadStream <#LoadStream>`_ * `SaveFile <#SaveFile>`_ * `SaveStream <#SaveStream>`_ * `SetEncoding <#SetEncoding>`_ * `SetExtension <#SetExtension>`_ * `SetFlags <#SetFlags>`_ * `SetName <#SetName>`_ * `SetType <#SetType>`_ * `SetVisible <#SetVisible>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Encoding <#Encoding>`_ * `Extension <#Extension>`_ * `Flags <#Flags>`_ * `Name <#Name>`_ * `Type <#Type>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() `No docstrings available for this method.` -------- .. method:: CanHandle(filename) Override this function and return ``True`` if this handler can we handle `filename`. By default, this function checks the extension. **Parameters:** * `filename` (string) | **Returns:** `bool` -------- .. method:: CanLoad() Override and return ``True`` if this handler can load content. | **Returns:** `bool` -------- .. method:: CanSave() Override and return ``True`` if this handler can save content. | **Returns:** `bool` -------- .. method:: GetEncoding() Returns the encoding associated with the handler (if any). | **Returns:** `string` -------- .. method:: GetExtension() Returns the extension associated with the handler. | **Returns:** `string` -------- .. method:: GetFlags() Returns flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler. | **Returns:** `int` -------- .. method:: GetName() Returns the name of the handler. | **Returns:** `string` -------- .. method:: GetType() Returns the type of the handler. | **Returns:** `int` -------- .. method:: IsVisible() Returns ``True`` if this handler should be visible to the user. | **Returns:** `bool` -------- .. method:: LoadFile(buffer, filename) Loads content from a file. Not all handlers will implement file loading. **Parameters:** * `buffer` (`wx.richtext.RichTextBuffer `_) * `filename` (string) | **Returns:** `bool` -------- .. method:: LoadStream(buffer, stream) Loads content from a stream. Not all handlers will implement file loading. **Parameters:** * `buffer` (`wx.richtext.RichTextBuffer `_) * `stream` (`wx.InputStream <../Widgets/wx.InputStream.html>`_) | **Returns:** `bool` -------- .. method:: SaveFile(buffer, filename) Saves content to a file. Not all handlers will implement file saving. **Parameters:** * `buffer` (`wx.richtext.RichTextBuffer `_) * `filename` (string) | **Returns:** `bool` -------- .. method:: SaveStream(buffer, stream) Saves content to a stream. Not all handlers will implement file saving. **Parameters:** * `buffer` (`wx.richtext.RichTextBuffer `_) * `stream` (`wx.OutputStream <../Widgets/wx.OutputStream.html>`_) | **Returns:** `bool` -------- .. method:: SetEncoding(encoding) Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen. **Parameters:** * `encoding` (string) -------- .. method:: SetExtension(ext) Sets the default extension to recognise. **Parameters:** * `ext` (string) -------- .. method:: SetFlags(flags) Sets flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler. You call this function directly if you are using a file handler explicitly (without going through the text control or buffer `LoadFile`/`SaveFile` API). Or, you can call the control or buffer's `SetHandlerFlags` function to set the flags that will be used for subsequent load and save operations. **Parameters:** * `flags` (int) -------- .. method:: SetName(name) Sets the name of the handler. **Parameters:** * `name` (string) -------- .. method:: SetType(type) Sets the handler type. **Parameters:** * `type` (int) -------- .. method:: SetVisible(visible) Sets whether the handler should be visible to the user (via the application's load and save dialogs). **Parameters:** * `visible` (bool) -------- Properties ^^^^^^^^^^ .. attribute:: Encoding See `GetEncoding`_ and `SetEncoding`_ .. attribute:: Extension See `GetExtension`_ and `SetExtension`_ .. attribute:: Flags See `GetFlags`_ and `SetFlags`_ .. attribute:: Name See `GetName`_ and `SetName`_ .. attribute:: Type See `GetType`_ and `SetType`_