htmlfilt.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: html/htmlfilt.h
  3. // Purpose: interface of wxHtmlFilter
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @class wxHtmlFilter
  9. This class is the parent class of input filters for wxHtmlWindow.
  10. It allows you to read and display files of different file formats.
  11. @library{wxhtml}
  12. @category{html}
  13. @see @ref overview_html_filters
  14. */
  15. class wxHtmlFilter : public wxObject
  16. {
  17. public:
  18. /**
  19. Constructor.
  20. */
  21. wxHtmlFilter();
  22. /**
  23. Returns @true if this filter is capable of reading file @e file.
  24. Example:
  25. @code
  26. bool MyFilter::CanRead(const wxFSFile& file)
  27. {
  28. return (file.GetMimeType() == "application/x-ugh");
  29. }
  30. @endcode
  31. */
  32. virtual bool CanRead(const wxFSFile& file) const = 0;
  33. /**
  34. Reads the file and returns string with HTML document.
  35. Example:
  36. @code
  37. wxString MyImgFilter::ReadFile(const wxFSFile& file)
  38. {
  39. return "<html><body><img src=\"" + file.GetLocation() +
  40. "\"></body></html>";
  41. }
  42. @endcode
  43. */
  44. virtual wxString ReadFile(const wxFSFile& file) const = 0;
  45. };