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.

93 lines
2.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: IWBreak.hxx
  7. //
  8. // Contents: Thai Word Breaker
  9. //
  10. // Classes: CWordBreaker
  11. //
  12. // History: 11-Nov-1997 WeibZ Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #ifndef __IWBREAK_HXX__
  16. #define __IWBREAK_HXX__
  17. //+---------------------------------------------------------------------------
  18. //
  19. // Class: CWordBreaker
  20. //
  21. // Purpose: Break text into phrases and words (Infosoft's wordbreaker)
  22. //
  23. //----------------------------------------------------------------------------
  24. class CWordBreaker : public IWordBreaker
  25. {
  26. public:
  27. //
  28. // From IUnknown
  29. //
  30. virtual SCODE STDMETHODCALLTYPE
  31. QueryInterface( REFIID riid, void **ppvObject );
  32. virtual ULONG STDMETHODCALLTYPE
  33. AddRef();
  34. virtual ULONG STDMETHODCALLTYPE
  35. Release();
  36. // From IWordBreaker
  37. //
  38. virtual SCODE STDMETHODCALLTYPE
  39. Init( BOOL fQuery, ULONG ulMaxTokenSize, BOOL *pfLicense );
  40. virtual SCODE STDMETHODCALLTYPE
  41. BreakText( TEXT_SOURCE *pTextSource, IWordSink *pWordSink,
  42. IPhraseSink *pPhraseSink );
  43. virtual SCODE STDMETHODCALLTYPE
  44. ComposePhrase( WCHAR const *pwcNoun, ULONG cwcNoun,
  45. WCHAR const *pwcModifier, ULONG cwcModifier, ULONG ulAttachmentType,
  46. WCHAR *pwcPhrase, ULONG *pcwcPhrase );
  47. virtual SCODE STDMETHODCALLTYPE
  48. GetLicenseToUse( const WCHAR **ppwcsLicense );
  49. // Local methods
  50. //
  51. CWordBreaker( LCID lcid );
  52. private:
  53. ~CWordBreaker();
  54. BOOL ProcessItem(PCWSTR pwcChars,
  55. INT cChars,
  56. SCRIPT_ITEM *pItem,
  57. BOOL fKeep,
  58. TEXT_SOURCE *pTextSource,
  59. IWordSink *pWordSink,
  60. IPhraseSink *pPhraseSink);
  61. long _cRefs;
  62. LCID _lcid;
  63. BOOL _fQuery;
  64. ULONG _ulMaxTokenSize;
  65. };
  66. typedef struct tag_ThaiWord {
  67. ULONG offset;
  68. ULONG len;
  69. } THAIWORD, *PTHAIWORD;
  70. #endif // __IWBREAK_HXX__