1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Vaclav Slavik
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_HTMLFILT_H_
11 #define _WX_HTMLFILT_H_
17 #include "wx/filesys.h"
20 //--------------------------------------------------------------------------------
22 // This class is input filter. It can "translate" files
23 // in non-HTML format to HTML format
24 // interface to access certain
25 // kinds of files (HTPP, FTP, local, tar.gz etc..)
26 //--------------------------------------------------------------------------------
28 class WXDLLIMPEXP_HTML wxHtmlFilter
: public wxObject
30 DECLARE_ABSTRACT_CLASS(wxHtmlFilter
)
33 wxHtmlFilter() : wxObject() {}
34 virtual ~wxHtmlFilter() {}
36 // returns true if this filter is able to open&read given file
37 virtual bool CanRead(const wxFSFile
& file
) const = 0;
39 // Reads given file and returns HTML document.
40 // Returns empty string if opening failed
41 virtual wxString
ReadFile(const wxFSFile
& file
) const = 0;
46 //--------------------------------------------------------------------------------
47 // wxHtmlFilterPlainText
48 // This filter is used as default filter if no other can
49 // be used (= uknown type of file). It is used by
50 // wxHtmlWindow itself.
51 //--------------------------------------------------------------------------------
54 class WXDLLIMPEXP_HTML wxHtmlFilterPlainText
: public wxHtmlFilter
56 DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText
)
59 virtual bool CanRead(const wxFSFile
& file
) const;
60 virtual wxString
ReadFile(const wxFSFile
& file
) const;
63 //--------------------------------------------------------------------------------
65 // filter for text/html
66 //--------------------------------------------------------------------------------
68 class wxHtmlFilterHTML
: public wxHtmlFilter
70 DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML
)
73 virtual bool CanRead(const wxFSFile
& file
) const;
74 virtual wxString
ReadFile(const wxFSFile
& file
) const;
81 #endif // _WX_HTMLFILT_H_