1999-07-07 22:04:58 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-10-02 18:19:46 +00:00
|
|
|
// Name: htmlfilt.h
|
1999-07-07 22:04:58 +00:00
|
|
|
// Purpose: filters
|
|
|
|
// Author: Vaclav Slavik
|
1999-10-02 18:19:46 +00:00
|
|
|
// RCS-ID: $Id$
|
1999-07-07 22:04:58 +00:00
|
|
|
// 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
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2001-04-29 17:57:35 +00:00
|
|
|
#pragma interface "htmlfilt.h"
|
1999-07-07 22:04:58 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#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
|
|
|
|
2001-04-29 17:57:35 +00:00
|
|
|
// returns TRUE if this filter is able to open&read given file
|
|
|
|
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:
|
|
|
|
virtual bool CanRead(const wxFSFile& file) const;
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const;
|
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:
|
|
|
|
virtual bool CanRead(const wxFSFile& file) const;
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
|