1999-07-07 18:04:58 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-10-02 14:19:46 -04:00
|
|
|
// Name: htmlfilt.h
|
1999-07-07 18:04:58 -04:00
|
|
|
// Purpose: filters
|
|
|
|
// Author: Vaclav Slavik
|
1999-10-02 14:19:46 -04:00
|
|
|
// RCS-ID: $Id$
|
1999-07-07 18:04:58 -04:00
|
|
|
// Copyright: (c) 1999 Vaclav Slavik
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-07 18:04:58 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-10-02 14:19:46 -04:00
|
|
|
#ifndef _WX_HTMLFILT_H_
|
|
|
|
#define _WX_HTMLFILT_H_
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-07-27 16:23:13 -04:00
|
|
|
|
1999-07-07 18:04:58 -04:00
|
|
|
#if wxUSE_HTML
|
|
|
|
|
1999-07-27 16:23:13 -04:00
|
|
|
#include "wx/filesys.h"
|
1999-07-07 18:04:58 -04: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 09:04:05 -04:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlFilter : public wxObject
|
1999-07-07 18:04:58 -04:00
|
|
|
{
|
|
|
|
DECLARE_ABSTRACT_CLASS(wxHtmlFilter)
|
|
|
|
|
2001-04-29 13:57:35 -04:00
|
|
|
public:
|
|
|
|
wxHtmlFilter() : wxObject() {}
|
|
|
|
virtual ~wxHtmlFilter() {}
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2004-09-27 15:06:39 -04:00
|
|
|
// returns true if this filter is able to open&read given file
|
2001-04-29 13:57:35 -04:00
|
|
|
virtual bool CanRead(const wxFSFile& file) const = 0;
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2001-04-29 13:57:35 -04: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 18:04:58 -04: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 09:04:05 -04:00
|
|
|
class WXDLLIMPEXP_HTML wxHtmlFilterPlainText : public wxHtmlFilter
|
1999-07-07 18:04:58 -04:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText)
|
|
|
|
|
2001-04-29 13:57:35 -04:00
|
|
|
public:
|
|
|
|
virtual bool CanRead(const wxFSFile& file) const;
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const;
|
1999-07-07 18:04:58 -04:00
|
|
|
};
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
// wxHtmlFilterHTML
|
|
|
|
// filter for text/html
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxHtmlFilterHTML : public wxHtmlFilter
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlFilterHTML)
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool CanRead(const wxFSFile& file) const;
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const;
|
|
|
|
};
|
|
|
|
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
|
2001-04-29 13:57:35 -04:00
|
|
|
#endif // wxUSE_HTML
|
|
|
|
|
1999-10-02 14:19:46 -04:00
|
|
|
#endif // _WX_HTMLFILT_H_
|
1999-07-07 18:04:58 -04:00
|
|
|
|