HTMLELEM.HXX
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:2k
源码类别:

Windows编程

开发平台:

Visual C++

  1. //+-------------------------------------------------------------------------
  2. //
  3. //  Copyright 1992 - 1997 Microsoft Corporation
  4. //
  5. //  File:       htmlelem.hxx
  6. //
  7. //  Contents:   Html Element classes
  8. //
  9. //--------------------------------------------------------------------------
  10. #if !defined( __HTMLELEM_HXX__ )
  11. #define __HTMLELEM_HXX__
  12. #include <htmlfilt.hxx>
  13. #include <serstrm.hxx>
  14. const TEMP_BUFFER_SIZE = 50;               // Size of temporary GetText buffer
  15. const MAX_PROPSPEC_STRING_LENGTH = 128;    // Size of propspec string for meta and script tags
  16. //+-------------------------------------------------------------------------
  17. //
  18. //  Class:      CHtmlElement
  19. //
  20. //  Purpose:    Abstracts the parsing algorithms for different Html tags
  21. //
  22. //--------------------------------------------------------------------------
  23. class CHtmlElement
  24. {
  25. public:
  26.     CHtmlElement( CHtmlIFilter& htmlIFilter, CSerialStream& serialStream );
  27.     virtual          ~CHtmlElement()            {}
  28.     virtual SCODE    GetChunk( STAT_CHUNK *pStat ) = 0;
  29.     virtual SCODE    GetText( ULONG *pcwcOutput, WCHAR *awcBuffer ) = 0;
  30.     virtual SCODE    GetValue( VARIANT ** ppPropValue );
  31.     virtual void     InitStatChunk( STAT_CHUNK *pStat ) = 0;
  32.     virtual void     InitFilterRegion( ULONG& idChunkSource,
  33.                                        ULONG& cwcStartSource,
  34.                                        ULONG& cwcLenSource );
  35. protected:
  36.     SCODE            SwitchToNextHtmlElement( STAT_CHUNK *pStat );
  37.     SCODE            SkipRemainingTextAndGotoNextChunk( STAT_CHUNK *pStat );
  38.     CHtmlIFilter &        _htmlIFilter;         // Reference to Html IFilter
  39.     CSerialStream &       _serialStream;        // Reference to input stream
  40.     CHtmlScanner          _scanner;             // Scanner
  41.     WCHAR                 _aTempBuffer[TEMP_BUFFER_SIZE];  // Temporary GetText buffer
  42. };
  43. #endif // __HTMLELEM_HXX__