wx.richtext.RichTextFileHandler

Inheritance diagram for 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

Known Subclasses

wx.richtext.RichTextHTMLHandler, wx.richtext.RichTextPlainTextHandler, wx.richtext.RichTextXMLHandler

Properties Summary

Class API

Methods

__init__()
No docstrings available for this 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


CanLoad()

Override and return True if this handler can load content.


Returns:

bool


CanSave()

Override and return True if this handler can save content.


Returns:

bool


GetEncoding()

Returns the encoding associated with the handler (if any).


Returns:

string


GetExtension()

Returns the extension associated with the handler.


Returns:

string


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


GetName()

Returns the name of the handler.


Returns:

string


GetType()

Returns the type of the handler.


Returns:

int


IsVisible()

Returns True if this handler should be visible to the user.


Returns:

bool


LoadFile(buffer, filename)

Loads content from a file.

Not all handlers will implement file loading.

Parameters:


Returns:

bool


LoadStream(buffer, stream)

Loads content from a stream.

Not all handlers will implement file loading.

Parameters:


Returns:

bool


SaveFile(buffer, filename)

Saves content to a file.

Not all handlers will implement file saving.

Parameters:


Returns:

bool


SaveStream(buffer, stream)

Saves content to a stream.

Not all handlers will implement file saving.

Parameters:


Returns:

bool


SetEncoding(encoding)

Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen.

Parameters:

  • encoding (string)

SetExtension(ext)

Sets the default extension to recognise.

Parameters:

  • ext (string)

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)

SetName(name)

Sets the name of the handler.

Parameters:

  • name (string)

SetType(type)

Sets the handler type.

Parameters:

  • type (int)

SetVisible(visible)

Sets whether the handler should be visible to the user (via the application’s load and save dialogs).

Parameters:

  • visible (bool)

Properties

Encoding
See GetEncoding and SetEncoding
Extension
See GetExtension and SetExtension
Flags
See GetFlags and SetFlags
Name
See GetName and SetName
Type
See GetType and SetType