1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/html/htmlfilt.h
4 // Author: Vaclav Slavik
5 // Copyright: (c) 1999 Vaclav Slavik
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef _WX_HTMLFILT_H_
10 #define _WX_HTMLFILT_H_
16 #include "wx/filesys.h"
19 //--------------------------------------------------------------------------------
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 //--------------------------------------------------------------------------------
27 class WXDLLIMPEXP_HTML wxHtmlFilter
: public wxObject
29 DECLARE_ABSTRACT_CLASS(wxHtmlFilter
)
32 wxHtmlFilter() : wxObject() {}
33 virtual ~wxHtmlFilter() {}
35 // returns true if this filter is able to open&read given file
36 virtual bool CanRead(const wxFSFile
& file
) const = 0;
38 // Reads given file and returns HTML document.
39 // Returns empty string if opening failed
40 virtual wxString
ReadFile(const wxFSFile
& file
) const = 0;
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 //--------------------------------------------------------------------------------
53 class WXDLLIMPEXP_HTML wxHtmlFilterPlainText
: public wxHtmlFilter
55 DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText
)
58 virtual bool CanRead(const wxFSFile
& file
) const;
59 virtual wxString
ReadFile(const wxFSFile
& file
) const;
62 //--------------------------------------------------------------------------------
64 // filter for text/html
65 //--------------------------------------------------------------------------------
67 class wxHtmlFilterHTML
: public wxHtmlFilter
69 DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML
)
72 virtual bool CanRead(const wxFSFile
& file
) const;
73 virtual wxString
ReadFile(const wxFSFile
& file
) const;
80 #endif // _WX_HTMLFILT_H_