]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: htmlfilt.h | |
3 | // Purpose: filters | |
4 | // Author: Vaclav Slavik | |
5 | // RCS-ID: $Id$ | |
6 | // Copyright: (c) 1999 Vaclav Slavik | |
7 | // Licence: wxWindows Licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | ||
11 | #ifndef _WX_HTMLFILT_H_ | |
12 | #define _WX_HTMLFILT_H_ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | ||
20 | #if wxUSE_HTML | |
21 | ||
22 | #include "wx/filesys.h" | |
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 | ||
33 | class WXDLLEXPORT wxHtmlFilter : public wxObject | |
34 | { | |
35 | DECLARE_ABSTRACT_CLASS(wxHtmlFilter) | |
36 | ||
37 | public: | |
38 | wxHtmlFilter() : wxObject() {} | |
39 | ||
40 | virtual bool CanRead(const wxFSFile& file) const = 0; | |
41 | // returns TRUE if this filter is able to open&read given file | |
42 | ||
43 | virtual wxString ReadFile(const wxFSFile& file) const = 0; | |
44 | // reads given file and returns HTML document. | |
45 | // Returns empty string if opening failed | |
46 | }; | |
47 | ||
48 | ||
49 | ||
50 | //-------------------------------------------------------------------------------- | |
51 | // wxHtmlFilterPlainText | |
52 | // This filter is used as default filter if no other can | |
53 | // be used (= uknown type of file). It is used by | |
54 | // wxHtmlWindow itself. | |
55 | //-------------------------------------------------------------------------------- | |
56 | ||
57 | ||
58 | class WXDLLEXPORT wxHtmlFilterPlainText : public wxHtmlFilter | |
59 | { | |
60 | DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText) | |
61 | ||
62 | public: | |
63 | virtual bool CanRead(const wxFSFile& file) const; | |
64 | virtual wxString ReadFile(const wxFSFile& file) const; | |
65 | }; | |
66 | ||
67 | ||
68 | ||
69 | #endif | |
70 | #endif // _WX_HTMLFILT_H_ | |
71 |