This is the base class for file handlers, for loading and/or saving content associated with a wxRichTextBuffer.
Derived from
Include files
<wx/richtext/richtextbuffer.h>
Data structures
Members
wxRichTextFileHandler::wxRichTextFileHandler
wxRichTextFileHandler::CanHandle
wxRichTextFileHandler::CanLoad
wxRichTextFileHandler::CanSave
wxRichTextFileHandler::DoLoadFile
wxRichTextFileHandler::DoSaveFile
wxRichTextFileHandler::GetEncoding
wxRichTextFileHandler::GetExtension
wxRichTextFileHandler::GetFlags
wxRichTextFileHandler::GetName
wxRichTextFileHandler::GetType
wxRichTextFileHandler::IsVisible
wxRichTextFileHandler::LoadFile
wxRichTextFileHandler::SaveFile
wxRichTextFileHandler::SetEncoding
wxRichTextFileHandler::SetExtension
wxRichTextFileHandler::SetFlags
wxRichTextFileHandler::SetName
wxRichTextFileHandler::SetType
wxRichTextFileHandler::SetVisible
wxRichTextFileHandler(const wxString& name = wxEmptyString, const wxString& ext = wxEmptyString, int type = 0)
Constructor.
bool CanHandle(const wxString& filename) const
Override this function and return true if this handler can we handle filename. By default, this function checks the extension.
bool CanLoad() const
Override and return true if this handler can load content.
bool CanSave() const
Override and return true if this handler can save content.
bool DoLoadFile(wxRichTextBuffer* buffer, wxInputStream& stream)
Override to load content from stream into buffer.
bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream)
Override to save content to stream from buffer.
const wxString& GetEncoding() const
Returns the encoding associated with the handler (if any).
wxString GetExtension() const
Returns the extension associated with the handler.
int GetFlags() const
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.
wxString GetName() const
Returns the name of the handler.
int GetType() const
Returns the type of the handler.
bool IsVisible() const
Returns true if this handler should be visible to the user.
bool LoadFile(wxRichTextBuffer* buffer, wxInputStream& stream)
bool LoadFile(wxRichTextBuffer* buffer, const wxString& filename)
Loads content from a stream or file. Not all handlers will implement file loading.
bool SaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream)
bool SaveFile(wxRichTextBuffer* buffer, const wxString& filename)
Saves content to a stream or file. Not all handlers will implement file saving.
void SetEncoding(const wxString& encoding)
Sets the encoding to use when saving a file. If empty, a suitable encoding is chosen.
void SetExtension(const wxString& ext)
Sets the default extension to recognise.
void SetFlags(int 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.
void SetName(const wxString& name)
Sets the name of the handler.
void SetType(int type)
Sets the handler type.
void SetVisible(bool visible)
Sets whether the handler should be visible to the user (via the application's load and save dialogs).