Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.3 KiB

  1. // IDXOBR.H: Definition of CITIndexObjBridge
  2. #ifndef __IDXOBR_H__
  3. #define __IDXOBR_H__
  4. #include "verinfo.h"
  5. #include <itwbrk.h>
  6. #include <itstem.h>
  7. // REVIEW (billa): EXBRKPM needs to get moved to mvsearch.h, where PARSE_PARMS
  8. // is defined. A pointer to this structure will replace the lpfnTable member
  9. // of PARSE_PARMS.
  10. class CITIndexObjBridge :
  11. public IWordSink,
  12. public IStemSink
  13. {
  14. public:
  15. CITIndexObjBridge();
  16. virtual ~CITIndexObjBridge();
  17. // IUnknown methods
  18. STDMETHOD(QueryInterface)(REFIID riid, LPVOID *ppvObj);
  19. STDMETHOD_(ULONG, AddRef)(void);
  20. STDMETHOD_(ULONG, Release)(void);
  21. // IWordSink methods
  22. STDMETHOD(PutWord)(WCHAR const *pwcInBuf, ULONG cwc,
  23. ULONG cwcSrcLen, ULONG cwcSrcPos);
  24. STDMETHOD(PutAltWord)(WCHAR const *pwcInBuf, ULONG cwc,
  25. ULONG cwcSrcLen, ULONG cwcSrcPos);
  26. STDMETHOD(StartAltPhrase)(void);
  27. STDMETHOD(EndAltPhrase)(void);
  28. STDMETHOD(PutBreak)(WORDREP_BREAK_TYPE breakType);
  29. // IStemSink methods
  30. STDMETHOD(PutWord)(WCHAR const *pwcInBuf, ULONG cwc);
  31. STDMETHOD(PutAltWord)(WCHAR const *pwcInBuf, ULONG cwc);
  32. // Public methods not derived from IUnknown.
  33. STDMETHOD(SetWordBreaker)(PIWBRK piwbrk);
  34. STDMETHOD(BreakText)(PEXBRKPM pexbrkpm);
  35. STDMETHOD(LookupStopWord)(LPBYTE lpbStopWord);
  36. STDMETHOD(StemWord)(LPBYTE lpbStemWord, LPBYTE lpbRawWord);
  37. STDMETHOD(AddQueryResultTerm)(LPBYTE lpbTermHit, LPVOID *ppvTermHit);
  38. STDMETHOD(AdjustQueryResultTerms)(void);
  39. private:
  40. // Private methods
  41. HRESULT ReallocBuffer(HGLOBAL *phmemBuf, DWORD *cbBufCur, DWORD cbBufNew);
  42. // Private Data members
  43. ULONG m_cRef;
  44. PIWBRK m_piwbrk; // pointer to IWordBreaker
  45. PIWBRKC m_piwbrkc; // pointer to IWordBreakerConfig
  46. PISTEM m_pistem; // pointer to IStemmer
  47. PIITSTWDL m_piitstwdl; // pointer to IITStopWordList
  48. DWORD m_dwCodePageID; // from breaker to do AToW/WToA
  49. PEXBRKPM m_pexbrkpm; // Params for BreakText call in progress.
  50. BOOL m_fNormWord;
  51. HGLOBAL m_hmemSrc;
  52. HGLOBAL m_hmemDestNorm;
  53. HGLOBAL m_hmemDestRaw;
  54. DWORD m_cbBufSrcCur;
  55. DWORD m_cbBufDestNormCur;
  56. DWORD m_cbBufDestRawCur;
  57. LPSIPB m_lpsipbTermHit;
  58. };
  59. // Initial size of Ansi<->Unicode string conversion buffers.
  60. #define cbConvBufInit 256
  61. #define IDXOBR_TERMHASH_SIZE 1013 // Large prime number good for supporting
  62. // thousands of term hit words.
  63. #endif // __IDXOBR_H__