1999-07-07 22:04:58 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/html/htmlfilt.h
|
1999-07-07 22:04:58 +00:00
|
|
|
// Purpose: filters
|
|
|
|
// Author: Vaclav Slavik
|
|
|
|
// Copyright: (c) 1999 Vaclav Slavik
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-07-07 22:04:58 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-10-02 18:19:46 +00:00
|
|
|
#ifndef _WX_HTMLFILT_H_
|
|
|
|
#define _WX_HTMLFILT_H_
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-07-27 20:23:13 +00:00
|
|
|
|
1999-07-07 22:04:58 +00:00
|
|
|
#if wxUSE_HTML
|
|
|
|
|
1999-07-27 20:23:13 +00:00
|
|
|
#include "wx/filesys.h"
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
// wxHtmlFilter
|
|
|
|
// This class is input filter. It can "translate" files
|
|
|
|
// in non-HTML format to HTML format
|
|
|
|
// interface to access certain
|
|
|
|
// kinds of files (HTPP, FTP, local, tar.gz etc..)
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
2003-07-04 13:04:05 +00:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlFilter : public wxObject
|
1999-07-07 22:04:58 +00:00
|
|
|
{
|
|
|
|
DECLARE_ABSTRACT_CLASS(wxHtmlFilter)
|
|
|
|
|
2001-04-29 17:57:35 +00:00
|
|
|
public:
|
|
|
|
wxHtmlFilter() : wxObject() {}
|
|
|
|
virtual ~wxHtmlFilter() {}
|
1999-07-07 22:04:58 +00:00
|
|
|
|
2004-09-27 19:06:39 +00:00
|
|
|
// returns true if this filter is able to open&read given file
|
2001-04-29 17:57:35 +00:00
|
|
|
virtual bool CanRead(const wxFSFile& file) const = 0;
|
1999-07-07 22:04:58 +00:00
|
|
|
|
2001-04-29 17:57:35 +00:00
|
|
|
// Reads given file and returns HTML document.
|
|
|
|
// Returns empty string if opening failed
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const = 0;
|
1999-07-07 22:04:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
// wxHtmlFilterPlainText
|
|
|
|
// This filter is used as default filter if no other can
|
|
|
|
// be used (= uknown type of file). It is used by
|
|
|
|
// wxHtmlWindow itself.
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2003-07-04 13:04:05 +00:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlFilterPlainText : public wxHtmlFilter
|
1999-07-07 22:04:58 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText)
|
|
|
|
|
2001-04-29 17:57:35 +00:00
|
|
|
public:
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool CanRead(const wxFSFile& file) const wxOVERRIDE;
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const wxOVERRIDE;
|
1999-07-07 22:04:58 +00:00
|
|
|
};
|
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
// wxHtmlFilterHTML
|
|
|
|
// filter for text/html
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxHtmlFilterHTML : public wxHtmlFilter
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML)
|
|
|
|
|
|
|
|
public:
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool CanRead(const wxFSFile& file) const wxOVERRIDE;
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const wxOVERRIDE;
|
2002-12-04 14:11:26 +00:00
|
|
|
};
|
|
|
|
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
|
2001-04-29 17:57:35 +00:00
|
|
|
#endif // wxUSE_HTML
|
|
|
|
|
1999-10-02 18:19:46 +00:00
|
|
|
#endif // _WX_HTMLFILT_H_
|
1999-07-07 22:04:58 +00:00
|
|
|
|