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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
1999-10-02 14:19:46 -04:00
|
|
|
#pragma interface
|
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..)
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxHtmlFilter : public wxObject
|
|
|
|
{
|
|
|
|
DECLARE_ABSTRACT_CLASS(wxHtmlFilter)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxHtmlFilter() : wxObject() {}
|
|
|
|
|
1999-07-25 08:20:58 -04:00
|
|
|
virtual bool CanRead(const wxFSFile& file) const = 0;
|
1999-07-07 18:04:58 -04:00
|
|
|
// returns TRUE if this filter is able to open&read given file
|
|
|
|
|
1999-07-25 08:20:58 -04:00
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const = 0;
|
1999-07-07 18:04:58 -04:00
|
|
|
// reads given file and returns HTML document.
|
|
|
|
// Returns empty string if opening failed
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
// wxHtmlFilterPlainText
|
|
|
|
// This filter is used as default filter if no other can
|
|
|
|
// be used (= uknown type of file). It is used by
|
|
|
|
// wxHtmlWindow itself.
|
|
|
|
//--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxHtmlFilterPlainText : public wxHtmlFilter
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxHtmlFilterPlainText)
|
|
|
|
|
|
|
|
public:
|
1999-07-25 08:20:58 -04:00
|
|
|
virtual bool CanRead(const wxFSFile& file) const;
|
|
|
|
virtual wxString ReadFile(const wxFSFile& file) const;
|
1999-07-07 18:04:58 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-10-02 14:19:46 -04:00
|
|
|
#endif
|
|
|
|
#endif // _WX_HTMLFILT_H_
|
1999-07-07 18:04:58 -04:00
|
|
|
|