' ########################################################################################
' Microsoft Windows
' File: Filter.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_Filter_PBI)
#DEFINE PBX_Filter_PBI
%EQUATE `FILTER_INC = 1
' /* header files for imported files */
#INCLUDE ONCE "Legacy/COM/Unknwn.inc"
#INCLUDE ONCE "Legacy/COM/ObjIdl.inc"
#INCLUDE ONCE "Legacy/System/PropIdl.inc"
'//+-------------------------------------------------------------------------
'//
'// Microsoft Windows
'// Copyright (C) Microsoft Corporation, 1993-1998.
'//
'//--------------------------------------------------------------------------
#IF NOT %DEF(%TAGFULLPROPSPEC_DEFINED)
%EQUATE `TAGFULLPROPSPEC_DEFINED = 1
' // Size = 24 bytes
TYPE FULLPROPSPEC DWORD
 guidPropSet AS GUID ' GUID
 psProperty AS PROPSPEC
END TYPE
#ENDIF ' TAGFULLPROPSPEC_DEFINED
' ########################################################################################
' IFilter interface
' IID = 89BCB740-6119-101A-BCB7-00DD010655AF
' Inherited interface = IUnknown
' ########################################################################################
#IF NOT %DEF(%IFilter_INTERFACE_DEFINED)
 %IFilter_INTERFACE_DEFINED = 1
#IF NOT %DEF(%IFILTER_INIT_DEFINED)
%EQUATE `IFILTER_INIT_DEFINED = 1
' enum IFILTER_INIT
%EQUATE `IFILTER_INIT_CANON_PARAGRAPHS = 1
%EQUATE `IFILTER_INIT_HARD_LINE_BREAKS = 2
%EQUATE `IFILTER_INIT_CANON_HYPHENS = 4
%EQUATE `IFILTER_INIT_CANON_SPACES = 8
%EQUATE `IFILTER_INIT_APPLY_INDEX_ATTRIBUTES = 16
%EQUATE `IFILTER_INIT_APPLY_OTHER_ATTRIBUTES = 32
%EQUATE `IFILTER_INIT_APPLY_CRAWL_ATTRIBUTES = 256
%EQUATE `IFILTER_INIT_INDEXING_ONLY = 64
%EQUATE `IFILTER_INIT_SEARCH_LINKS = 128
%EQUATE `IFILTER_INIT_FILTER_OWNED_VALUE_OK = 512
%EQUATE `IFILTER_INIT_FILTER_AGGRESSIVE_BREAK = 1024
%EQUATE `IFILTER_INIT_DISABLE_EMBEDDED = 2048
%EQUATE `IFILTER_INIT_EMIT_FORMATTING = 4096
#ENDIF
#IF NOT %DEF(%IFILTER_FLAGS_DEFINED)
%EQUATE `IFILTER_FLAGS_DEFINED = 1
' enum IFILTER_FLAGS
%EQUATE `IFILTER_FLAGS_OLE_PROPERTIES = 1
#ENDIF
#IF NOT %DEF(%CHUNKSTATE_DEFINED)
%EQUATE `CHUNKSTATE_DEFINED = 1
' enum CHUNKSTATE
%EQUATE `CHUNK_TEXT = &H1
%EQUATE `CHUNK_VALUE = &H2
%EQUATE `CHUNK_FILTER_OWNED_VALUE = &H4
#ENDIF
#IF NOT %DEF(%CHUNK_BREAKTYPE_DEFINED)
%EQUATE `CHUNK_BREAKTYPE_DEFINED = 1
' enum CHUNK_BREAKTYPE
%EQUATE `CHUNK_NO_BREAK = 0
%EQUATE `CHUNK_EOW = 1
%EQUATE `CHUNK_EOS = 2
%EQUATE `CHUNK_EOP = 3
%EQUATE `CHUNK_EOC = 4
#ENDIF
#IF NOT %DEF(%FILTERREGION_DEFINED)
%EQUATE `FILTERREGION_DEFINED = 1
' // Size = 12 bytes
TYPE FILTERREGION DWORD
 idChunk AS DWORD ' ULONG
 cwcStart AS DWORD ' ULONG
 cwcExtent AS DWORD ' ULONG
END TYPE
#ENDIF
#IF NOT %DEF(%STAT_CHUNK_DEFINED)
%EQUATE `STAT_CHUNK_DEFINED = 1
' // Size = 52 bytes
TYPE STAT_CHUNK DWORD
 idChunk AS DWORD ' ULONG
 breakType AS LONG ' CHUNK_BREAKTYPE
 flags AS DWORD ' CHUNKSTATE
 locale AS DWORD ' LCID
 attribute AS FULLPROPSPEC ' FULLPROPSPEC
 idChunkSource AS DWORD ' ULONG
 cwcStartSource AS DWORD ' ULONG
 cwcLenSource AS DWORD ' ULONG
END TYPE
#ENDIF
$IID_IFilter = GUID$("{89BCB740-6119-101A-BCB7-00DD010655AF}")
INTERFACE IFilter $IID_IFilter
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Init ( ' VTable offset = 12
 BYVAL grfFlags AS DWORD
 , BYVAL cAttributes AS DWORD
 , BYREF aAttributes AS FULLPROPSPEC
 , BYREF pFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetChunk ( ' VTable offset = 16
 BYREF pStat AS STAT_CHUNK
 ) AS LONG
 ' =====================================================================================
 METHOD GetText ( ' VTable offset = 20
 BYREF pcwcBuffer AS DWORD
 , BYREF awcBuffer AS WSTRINGZ
 ) AS LONG
 ' =====================================================================================
 METHOD GetValue ( ' VTable offset = 24
 BYREF ppPropValue AS PROPVARIANT
 ) AS LONG
 ' =====================================================================================
 METHOD BindRegion ( ' VTable offset = 28
 BYREF origPos AS FILTERREGION
 , BYREF riid AS GUID
 , BYREF ppunk AS IUnknown
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF ' /* __IFilter_INTERFACE_DEFINED__ */
#ENDIF
