Version: 2.9.4
Public Member Functions | Static Public Member Functions | Protected Member Functions
wxRichTextXMLHandler Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/richtext/richtextxml.h>

Inheritance diagram for wxRichTextXMLHandler:

Detailed Description

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:

Library:  wxRichText
Category:  Rich Text

Public Member Functions

 wxRichTextXMLHandler (const wxString &name="XML", const wxString &ext="xml", int type=wxRICHTEXT_TYPE_XML)
 Constructor.
virtual bool CanLoad () const
 Returns true.
virtual bool CanSave () const
 Returns true.
bool ExportXML (wxOutputStream &stream, wxRichTextObject &obj, int level)
 Recursively exports an object to the stream.
wxString GetNodeContent (wxXmlNode *node)
 Helper function: gets node context.
wxXmlNodeGetParamNode (wxXmlNode *node, const wxString &param)
 Helper function: gets a named parameter from the XML node.
wxString GetParamValue (wxXmlNode *node, const wxString &param)
 Helper function: gets a named parameter from the XML node.
wxString GetText (wxXmlNode *node, const wxString &param=wxEmptyString, bool translate=false)
 Helper function: gets text from the node.
bool HasParam (wxXmlNode *node, const wxString &param)
 Helper function: returns true if the node has the given parameter.
bool ImportXML (wxRichTextBuffer *buffer, wxRichTextObject *obj, wxXmlNode *node)
 Recursively imports an object.

Static Public Member Functions

static void RegisterNodeName (const wxString &nodeName, const wxString &className)
 Call with XML node name, C++ class name so that wxRTC can read in the node.
static void ClearNodeToClassMap ()
 Cleans up the mapping between node name and C++ class.

Protected Member Functions

virtual bool DoLoadFile (wxRichTextBuffer *buffer, wxInputStream &stream)
 Loads buffer context from the given stream.
virtual bool DoSaveFile (wxRichTextBuffer *buffer, wxOutputStream &stream)
 Saves buffer context to the given stream.

List of all members.


Constructor & Destructor Documentation

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

Constructor.


Member Function Documentation

virtual bool wxRichTextXMLHandler::CanLoad ( ) const [virtual]

Returns true.

Reimplemented from wxRichTextFileHandler.

virtual bool wxRichTextXMLHandler::CanSave ( ) const [virtual]

Returns true.

Reimplemented from wxRichTextFileHandler.

static void wxRichTextXMLHandler::ClearNodeToClassMap ( ) [inline, static]

Cleans up the mapping between node name and C++ class.

virtual bool wxRichTextXMLHandler::DoLoadFile ( wxRichTextBuffer buffer,
wxInputStream stream 
) [protected, virtual]

Loads buffer context from the given stream.

virtual bool wxRichTextXMLHandler::DoSaveFile ( wxRichTextBuffer buffer,
wxOutputStream stream 
) [protected, virtual]

Saves buffer context to the given stream.

bool wxRichTextXMLHandler::ExportXML ( wxOutputStream stream,
wxRichTextObject obj,
int  level 
)

Recursively exports an object to the stream.

wxString wxRichTextXMLHandler::GetNodeContent ( wxXmlNode node)

Helper function: gets node context.

wxXmlNode* wxRichTextXMLHandler::GetParamNode ( wxXmlNode node,
const wxString param 
)

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

wxString wxRichTextXMLHandler::GetParamValue ( wxXmlNode node,
const wxString param 
)

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

wxString wxRichTextXMLHandler::GetText ( wxXmlNode node,
const wxString param = wxEmptyString,
bool  translate = false 
)

Helper function: gets text from the node.

bool wxRichTextXMLHandler::HasParam ( wxXmlNode node,
const wxString param 
)

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

bool wxRichTextXMLHandler::ImportXML ( wxRichTextBuffer buffer,
wxRichTextObject obj,
wxXmlNode node 
)

Recursively imports an object.

static void wxRichTextXMLHandler::RegisterNodeName ( const wxString nodeName,
const wxString className 
) [inline, static]

Call with XML node name, C++ class name so that wxRTC can read in the node.

If you add a custom object, call this.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines