]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/html/htmlfilt.h | |
3 | // Purpose: filters | |
4 | // Author: Vaclav Slavik | |
5 | // Copyright: (c) 1999 Vaclav Slavik | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #ifndef _WX_HTMLFILT_H_ | |
10 | #define _WX_HTMLFILT_H_ | |
11 | ||
12 | #include "wx/defs.h" | |
13 | ||
14 | #if wxUSE_HTML | |
15 | ||
16 | #include "wx/filesys.h" | |
17 | ||
18 | ||
19 | //-------------------------------------------------------------------------------- | |
20 | // wxHtmlFilter | |
21 | // This class is input filter. It can "translate" files | |
22 | // in non-HTML format to HTML format | |
23 | // interface to access certain | |
24 | // kinds of files (HTPP, FTP, local, tar.gz etc..) | |
25 | //-------------------------------------------------------------------------------- | |
26 | ||
27 | class WXDLLIMPEXP_HTML wxHtmlFilter : public wxObject | |
28 | { | |
29 | DECLARE_ABSTRACT_CLASS(wxHtmlFilter) | |
30 | ||
31 | public: | |
32 | wxHtmlFilter() : wxObject() {} | |
33 | virtual ~wxHtmlFilter() {} | |
34 | ||
35 | // returns true if this filter is able to open&read given file | |
36 | virtual bool CanRead(const wxFSFile& file) const = 0; | |
37 | ||
38 | // Reads given file and returns HTML document. | |
39 | // Returns empty string if opening failed | |
40 | virtual wxString ReadFile(const wxFSFile& file) const = 0; | |
41 | }; | |
42 | ||
43 | ||
44 | ||
45 | //-------------------------------------------------------------------------------- | |
46 | // wxHtmlFilterPlainText | |
47 | // This filter is used as default filter if no other can | |
48 | // be used (= uknown type of file). It is used by | |
49 | // wxHtmlWindow itself. | |
50 | //-------------------------------------------------------------------------------- | |
51 | ||
52 | ||
53 | class WXDLLIMPEXP_HTML wxHtmlFilterPlainText : public wxHtmlFilter | |
54 | { | |
55 | DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText) | |
56 | ||
57 | public: | |
58 | virtual bool CanRead(const wxFSFile& file) const; | |
59 | virtual wxString ReadFile(const wxFSFile& file) const; | |
60 | }; | |
61 | ||
62 | //-------------------------------------------------------------------------------- | |
63 | // wxHtmlFilterHTML | |
64 | // filter for text/html | |
65 | //-------------------------------------------------------------------------------- | |
66 | ||
67 | class wxHtmlFilterHTML : public wxHtmlFilter | |
68 | { | |
69 | DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML) | |
70 | ||
71 | public: | |
72 | virtual bool CanRead(const wxFSFile& file) const; | |
73 | virtual wxString ReadFile(const wxFSFile& file) const; | |
74 | }; | |
75 | ||
76 | ||
77 | ||
78 | #endif // wxUSE_HTML | |
79 | ||
80 | #endif // _WX_HTMLFILT_H_ | |
81 |