The base class for file handlers.
wx.richtext.RichTextHTMLHandler, wx.richtext.RichTextPlainTextHandler, wx.richtext.RichTextXMLHandler
Creates a file handler object. |
|
Returns |
|
Returns |
|
Returns |
|
Override to load content from stream into buffer. |
|
Override to save content to stream from buffer. |
|
Returns the encoding to use when saving a file. |
|
Returns the default extension to recognise. |
|
Returns flags controlling how loading and saving is done. |
|
Returns the name of the handler. |
|
Returns the handler type. |
|
Returns |
|
Loads the buffer from a stream. |
|
Saves the buffer to a stream. |
|
Sets the encoding to use when saving a file. |
|
Sets the default extension to recognise. |
|
Sets flags that change the behaviour of loading or saving. |
|
Sets the name of the handler. |
|
Sets the handler type. |
|
Sets whether the handler should be visible to the user (via the application’s load and save dialogs). |
See |
|
See |
|
Possible constructors:
RichTextFileHandler(name: str='', ext: str='', type: int=0) -> None
The base class for file handlers.
Creates a file handler object.
name (string)
ext (string)
type (int)
None
Returns True
if we handle this filename (if using files).
By default, checks the extension.
filename (string)
bool
Returns True
if we can load using this handler.
bool
Returns True
if we can save using this handler.
bool
Override to load content from stream into buffer.
buffer (wx.richtext.RichTextBuffer)
stream (wx.InputStream)
bool
Override to save content to stream from buffer.
buffer (wx.richtext.RichTextBuffer)
stream (wx.OutputStream)
bool
Returns the encoding to use when saving a file.
If empty, a suitable encoding is chosen.
str
Returns the default extension to recognise.
str
Returns flags controlling how loading and saving is done.
int
Returns the name of the handler.
str
Returns the handler type.
int
Returns True
if this handler should be visible to the user.
bool
LoadFile (self, buffer : RichTextBuffer, stream : InputStream)
Loads the buffer from a stream.
Not all handlers will implement file loading.
buffer (wx.richtext.RichTextBuffer)
stream (wx.InputStream)
bool
LoadFile (self, buffer : RichTextBuffer, filename : str)
Loads the buffer from a file.
buffer (wx.richtext.RichTextBuffer)
filename (string)
bool
SaveFile (self, buffer : RichTextBuffer, stream : OutputStream)
Saves the buffer to a stream.
Not all handlers will implement file saving.
buffer (wx.richtext.RichTextBuffer)
stream (wx.OutputStream)
bool
SaveFile (self, buffer : RichTextBuffer, filename : str)
Saves the buffer to a file.
buffer (wx.richtext.RichTextBuffer)
filename (string)
bool
Sets the encoding to use when saving a file.
If empty, a suitable encoding is chosen.
encoding (string)
None
Sets the default extension to recognise.
ext (string)
None
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.
flags (int)
None
Sets the name of the handler.
name (string)
None
Sets the handler type.
type (int)
None
Sets whether the handler should be visible to the user (via the application’s load and save dialogs).
visible (bool)
None
See GetEncoding
and SetEncoding
See GetExtension
and SetExtension