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