Contents Up Previous Next

wxRichTextXMLHandler

A handler for loading and saving content in an XML format specific to wxRichTextBuffer. You can either add the handler to the buffer and load and save through the buffer or control API, or you can create an instance of the handler on the stack and call its functions directly.

Handler flags

The following flags can be used with this handler, via the handler's SetFlags function or the buffer or control's SetHandlerFlags function:

wxRICHTEXT_HANDLER_INCLUDE_STYLESHEET Include the style sheet in loading and saving operations.

Derived from

wxRichTextFileHandler

Include files

<wx/richtext/richtextxml.h>

Data structures

Members

wxRichTextXMLHandler::wxRichTextXMLHandler
wxRichTextXMLHandler::CanLoad
wxRichTextXMLHandler::CanSave
wxRichTextXMLHandler::CreateStyle
wxRichTextXMLHandler::DoLoadFile
wxRichTextXMLHandler::DoSaveFile
wxRichTextXMLHandler::ExportXML
wxRichTextXMLHandler::GetNodeContent
wxRichTextXMLHandler::GetParamNode
wxRichTextXMLHandler::GetParamValue
wxRichTextXMLHandler::GetStyle
wxRichTextXMLHandler::GetText
wxRichTextXMLHandler::HasParam
wxRichTextXMLHandler::ImportXML


wxRichTextXMLHandler::wxRichTextXMLHandler

wxRichTextXMLHandler(const wxString& name = wxT("XML"), const wxString& ext = wxT("xml"), int type = wxRICHTEXT_TYPE_XML)

Constructor.


wxRichTextXMLHandler::CanLoad

bool CanLoad() const

Returns true.


wxRichTextXMLHandler::CanSave

bool CanSave() const

Returns true.


wxRichTextXMLHandler::CreateStyle

wxString CreateStyle(const wxTextAttrEx& attr, bool isPara = false)

Creates XML code for a given character or paragraph style.


wxRichTextXMLHandler::DoLoadFile

bool DoLoadFile(wxRichTextBuffer* buffer, wxInputStream& stream)

Loads buffer context from the given stream.


wxRichTextXMLHandler::DoSaveFile

bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream)

Saves buffer context to the given stream.


wxRichTextXMLHandler::ExportXML

bool ExportXML(wxOutputStream& stream, wxMBConv* convMem, wxMBConv* convFile, wxRichTextObject& obj, int level)

Recursively exports an object to the stream.


wxRichTextXMLHandler::GetNodeContent

wxString GetNodeContent(wxXmlNode* node)

Helper function: gets node context.


wxRichTextXMLHandler::GetParamNode

wxXmlNode* GetParamNode(wxXmlNode* node, const wxString& param)

Helper function: gets a named parameter from the XML node.


wxRichTextXMLHandler::GetParamValue

wxString GetParamValue(wxXmlNode* node, const wxString& param)

Helper function: gets a named parameter from the XML node.


wxRichTextXMLHandler::GetStyle

bool GetStyle(wxTextAttrEx& attr, wxXmlNode* node, bool isPara = false)

Helper function: gets style parameters from the given XML node.


wxRichTextXMLHandler::GetText

wxString GetText(wxXmlNode* node, const wxString& param = wxEmptyString, bool translate = false)

Helper function: gets text from the node.


wxRichTextXMLHandler::HasParam

bool HasParam(wxXmlNode* node, const wxString& param)

Helper function: returns true if the node has the given parameter.


wxRichTextXMLHandler::ImportXML

bool ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node)

Recursively imports an object.