1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _html.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13enum wxHtmlURLType
14{
15    wxHTML_URL_PAGE,
16    wxHTML_URL_IMAGE,
17    wxHTML_URL_OTHER
18};
19
20class wxHtmlTagHandler : wxObject
21{
22    %Docstring
23        HtmlTagHandler()
24    %End
25    %TypeHeaderCode
26        #include <wx/html/htmlpars.h>
27    %End
28
29public:
30    wxHtmlTagHandler();
31
32    virtual
33    wxString GetSupportedTags() = 0;
34    %Docstring
35        GetSupportedTags() -> String
36
37        Returns list of supported tags.
38    %End
39
40    virtual
41    bool HandleTag(
42        const wxHtmlTag & tag
43    ) = 0;
44    %Docstring
45        HandleTag(tag) -> bool
46
47        This is the core method of each handler.
48    %End
49
50    virtual
51    void SetParser(
52        wxHtmlParser * parser
53    );
54    %Docstring
55        SetParser(parser)
56
57        Assigns parser to this handler.
58    %End
59
60    wxHtmlParser * GetParser() const;
61    %Docstring
62        GetParser() -> HtmlParser
63
64        Returns the parser associated with this tag handler.
65    %End
66
67    private:
68        wxHtmlTagHandler(const wxHtmlTagHandler&);
69
70
71    public:
72
73
74    %Property(name=Parser, get=GetParser, set=SetParser)
75    %Property(name=SupportedTags, get=GetSupportedTags)
76
77protected:
78    void ParseInner(
79        const wxHtmlTag & tag
80    );
81    %Docstring
82        ParseInner(tag)
83
84        This method calls parser's wxHtmlParser::DoParsing method for the
85        string between this tag and the paired ending tag:
86    %End
87
88    void ParseInnerSource(
89        const wxString & source
90    );
91    %Docstring
92        ParseInnerSource(source)
93
94        Parses given source as if it was tag's inner code (see
95        wxHtmlParser::GetInnerSource).
96    %End
97
98};  // end of class wxHtmlTagHandler
99
100
101class wxHtmlParser   /Abstract/
102{
103    %Docstring
104        HtmlParser()
105
106        Classes derived from this handle the generic parsing of HTML
107        documents: it scans the document and divide it into blocks of tags
108        (where one block consists of beginning and ending tag and of text
109        between these two tags).
110    %End
111    %TypeHeaderCode
112        #include <wx/html/htmlpars.h>
113    %End
114
115public:
116    wxHtmlParser();
117
118    virtual
119    void AddTagHandler(
120        wxHtmlTagHandler * handler
121    );
122    %Docstring
123        AddTagHandler(handler)
124
125        Adds handler to the internal list ( hash table) of handlers.
126    %End
127
128    void DoParsing();
129    %Docstring
130        DoParsing()
131
132        Parses the whole m_Source.
133    %End
134
135    virtual
136    void DoneParser();
137    %Docstring
138        DoneParser()
139
140        This must be called after DoParsing().
141    %End
142
143    wxFileSystem * GetFS() const;
144    %Docstring
145        GetFS() -> wx.FileSystem
146
147        Returns pointer to the file system.
148    %End
149
150    virtual
151    wxObject * GetProduct() = 0;
152    %Docstring
153        GetProduct() -> wx.Object
154
155        Returns product of parsing.
156    %End
157
158    const wxString * GetSource();
159    %Docstring
160        GetSource() -> String
161
162        Returns pointer to the source being parsed.
163    %End
164
165    virtual
166    void InitParser(
167        const wxString & source
168    );
169    %Docstring
170        InitParser(source)
171
172        Setups the parser for parsing the source string.
173    %End
174
175    virtual
176    wxFSFile * OpenURL(
177        wxHtmlURLType type,
178        const wxString & url
179    ) const;
180    %Docstring
181        OpenURL(type, url) -> wx.FSFile
182
183        Opens given URL and returns wxFSFile object that can be used to read
184        data from it.
185    %End
186
187    wxObject * Parse(
188        const wxString & source
189    );
190    %Docstring
191        Parse(source) -> wx.Object
192
193        Proceeds parsing of the document.
194    %End
195
196    void PopTagHandler();
197    %Docstring
198        PopTagHandler()
199
200        Restores parser's state before last call to PushTagHandler().
201    %End
202
203    void PushTagHandler(
204        wxHtmlTagHandler * handler,
205        const wxString & tags
206    );
207    %Docstring
208        PushTagHandler(handler, tags)
209
210        Forces the handler to handle additional tags (not returned by
211        wxHtmlTagHandler::GetSupportedTags).
212    %End
213
214    void SetFS(
215        wxFileSystem * fs
216    );
217    %Docstring
218        SetFS(fs)
219
220        Sets the virtual file system that will be used to request additional
221        files.
222    %End
223
224    virtual
225    void StopParsing();
226    %Docstring
227        StopParsing()
228
229        Call this function to interrupt parsing from a tag handler.
230    %End
231
232    private:
233        wxHtmlParser(const wxHtmlParser&);
234
235
236    public:
237
238
239    %Property(name=FS, get=GetFS, set=SetFS)
240    %Property(name=Product, get=GetProduct)
241    %Property(name=Source, get=GetSource)
242
243protected:
244    virtual
245    void AddTag(
246        const wxHtmlTag & tag
247    );
248    %Docstring
249        AddTag(tag)
250
251        This may (and may not) be overwritten in derived class.
252    %End
253
254};  // end of class wxHtmlParser
255
256
257
258//---------------------------------------------------------------------------
259
260