1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Vaclav Slavik
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows Licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_HTMLFILT_H_
12 #define _WX_HTMLFILT_H_
14 #if defined(__GNUG__) && !defined(__APPLE__)
15 #pragma interface "htmlfilt.h"
22 #include "wx/filesys.h"
25 //--------------------------------------------------------------------------------
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 //--------------------------------------------------------------------------------
33 class WXDLLIMPEXP_HTML wxHtmlFilter
: public wxObject
35 DECLARE_ABSTRACT_CLASS(wxHtmlFilter
)
38 wxHtmlFilter() : wxObject() {}
39 virtual ~wxHtmlFilter() {}
41 // returns TRUE if this filter is able to open&read given file
42 virtual bool CanRead(const wxFSFile
& file
) const = 0;
44 // Reads given file and returns HTML document.
45 // Returns empty string if opening failed
46 virtual wxString
ReadFile(const wxFSFile
& file
) const = 0;
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 //--------------------------------------------------------------------------------
59 class WXDLLIMPEXP_HTML wxHtmlFilterPlainText
: public wxHtmlFilter
61 DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText
)
64 virtual bool CanRead(const wxFSFile
& file
) const;
65 virtual wxString
ReadFile(const wxFSFile
& file
) const;
68 //--------------------------------------------------------------------------------
70 // filter for text/html
71 //--------------------------------------------------------------------------------
73 class wxHtmlFilterHTML
: public wxHtmlFilter
75 DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML
)
78 virtual bool CanRead(const wxFSFile
& file
) const;
79 virtual wxString
ReadFile(const wxFSFile
& file
) const;
86 #endif // _WX_HTMLFILT_H_