]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/richtext/richtextxml.h
fix typo (missing P2 argument in template)
[wxWidgets.git] / interface / wx / richtext / richtextxml.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: richtext/richtextxml.h
21b447dc 3// Purpose: interface of wxRichTextXMLHandler
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxRichTextXMLHandler
7c913512 11
23324ae1
FM
12 A handler for loading and saving content in an XML format specific
13 to wxRichTextBuffer. You can either add the handler to the buffer
14 and load and save through the buffer or control API, or you can
15 create an instance of the handler on the stack and call its
16 functions directly.
7c913512 17
23324ae1 18 @library{wxrichtext}
21b447dc 19 @category{richtext}
23324ae1
FM
20*/
21class wxRichTextXMLHandler : public wxRichTextFileHandler
22{
23public:
24 /**
328f5751 25 , wxString&@e ext = wxT("xml"), @b int@e type = wxRICHTEXT_TYPE_XML)
23324ae1
FM
26 Constructor.
27 */
328f5751 28 wxRichTextXMLHandler() const;
23324ae1
FM
29
30 /**
31 Returns @true.
32 */
adaaa686 33 virtual bool CanLoad() const;
23324ae1
FM
34
35 /**
36 Returns @true.
37 */
adaaa686 38 virtual bool CanSave() const;
23324ae1
FM
39
40 /**
41 Creates XML code for a given character or paragraph style.
42 */
4cc4bfaf 43 wxString CreateStyle(const wxTextAttr& attr, bool isPara = false);
23324ae1
FM
44
45 /**
46 Loads buffer context from the given stream.
47 */
48 bool DoLoadFile(wxRichTextBuffer* buffer, wxInputStream& stream);
49
50 /**
51 Saves buffer context to the given stream.
52 */
53 bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream);
54
55 /**
56 Recursively exports an object to the stream.
57 */
58 bool ExportXML(wxOutputStream& stream, wxMBConv* convMem,
59 wxMBConv* convFile,
60 wxRichTextObject& obj,
61 int level);
62
63 /**
64 Helper function: gets node context.
65 */
66 wxString GetNodeContent(wxXmlNode* node);
67
68 /**
69 Helper function: gets a named parameter from the XML node.
70 */
71 wxXmlNode* GetParamNode(wxXmlNode* node, const wxString& param);
72
73 /**
74 Helper function: gets a named parameter from the XML node.
75 */
76 wxString GetParamValue(wxXmlNode* node, const wxString& param);
77
78 /**
79 Helper function: gets style parameters from the given XML node.
80 */
81 bool GetStyle(wxTextAttr& attr, wxXmlNode* node,
4cc4bfaf 82 bool isPara = false);
23324ae1
FM
83
84 /**
85 Helper function: gets text from the node.
86 */
87 wxString GetText(wxXmlNode* node,
88 const wxString& param = wxEmptyString,
4cc4bfaf 89 bool translate = false);
23324ae1
FM
90
91 /**
92 Helper function: returns @true if the node has the given parameter.
93 */
94 bool HasParam(wxXmlNode* node, const wxString& param);
95
96 /**
97 Recursively imports an object.
98 */
99 bool ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node);
100};
e54c96f1 101