]>
git.saurik.com Git - wxWidgets.git/blob - interface/richtext/richtextxml.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: richtext/richtextxml.h
3 // Purpose: interface of wxRichTextXMLHandler
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxRichTextXMLHandler
11 @headerfile richtextxml.h wx/richtext/richtextxml.h
13 A handler for loading and saving content in an XML format specific
14 to wxRichTextBuffer. You can either add the handler to the buffer
15 and load and save through the buffer or control API, or you can
16 create an instance of the handler on the stack and call its
22 class wxRichTextXMLHandler
: public wxRichTextFileHandler
26 , wxString&@e ext = wxT("xml"), @b int@e type = wxRICHTEXT_TYPE_XML)
29 wxRichTextXMLHandler() const;
42 Creates XML code for a given character or paragraph style.
44 wxString
CreateStyle(const wxTextAttr
& attr
, bool isPara
= false);
47 Loads buffer context from the given stream.
49 bool DoLoadFile(wxRichTextBuffer
* buffer
, wxInputStream
& stream
);
52 Saves buffer context to the given stream.
54 bool DoSaveFile(wxRichTextBuffer
* buffer
, wxOutputStream
& stream
);
57 Recursively exports an object to the stream.
59 bool ExportXML(wxOutputStream
& stream
, wxMBConv
* convMem
,
61 wxRichTextObject
& obj
,
65 Helper function: gets node context.
67 wxString
GetNodeContent(wxXmlNode
* node
);
70 Helper function: gets a named parameter from the XML node.
72 wxXmlNode
* GetParamNode(wxXmlNode
* node
, const wxString
& param
);
75 Helper function: gets a named parameter from the XML node.
77 wxString
GetParamValue(wxXmlNode
* node
, const wxString
& param
);
80 Helper function: gets style parameters from the given XML node.
82 bool GetStyle(wxTextAttr
& attr
, wxXmlNode
* node
,
86 Helper function: gets text from the node.
88 wxString
GetText(wxXmlNode
* node
,
89 const wxString
& param
= wxEmptyString
,
90 bool translate
= false);
93 Helper function: returns @true if the node has the given parameter.
95 bool HasParam(wxXmlNode
* node
, const wxString
& param
);
98 Recursively imports an object.
100 bool ImportXML(wxRichTextBuffer
* buffer
, wxXmlNode
* node
);