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
|
|
|
|
// Licence: wxWindows Licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
1999-10-02 14:19:46 -04:00
|
|
|
#ifndef _WX_HTMLFILT_H_
|
|
|
|
#define _WX_HTMLFILT_H_
|
1999-07-07 18:04:58 -04:00
|
|
|
|
2003-08-09 08:38:21 -04:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2001-04-29 13:57:35 -04:00
|
|
|
#pragma interface "htmlfilt.h"
|
1999-07-07 18:04:58 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#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
|
|
|
|
2001-04-29 13:57:35 -04:00
|
|
|
// returns TRUE if this filter is able to open&read given file
|
|
|
|
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
|
|
|
|