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.

96 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: IWBreak.hxx
  7. //
  8. // Contents: Korean Word Breaker
  9. //
  10. // Classes: CWordBreaker
  11. //
  12. // History: 09-Sep-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. void Tokenize( unsigned cwc,
  55. BOOL bMoreText,
  56. TEXT_SOURCE *pTextSource,
  57. WT *Type);
  58. BOOL ProcessTokens( TEXT_SOURCE *pTextSource,
  59. WT Type,
  60. IWordSink *pWordSink,
  61. IPhraseSink *pPhraseSink );
  62. long _cRefs;
  63. LCID _lcid;
  64. BOOL _fQuery;
  65. ULONG _ulMaxTokenSize;
  66. DWORD _cchTextProcessed;
  67. };
  68. #define VERBCHAR 0xB2E4 // it will be appended to the root form of a Verb.
  69. #endif // __IWBREAK_HXX__