nsSampleWordBreaker.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef nsSampleWordBreaker_h__
  6. #define nsSampleWordBreaker_h__
  7. #include "nsIWordBreaker.h"
  8. typedef enum {
  9. kWbClassSpace = 0,
  10. kWbClassAlphaLetter,
  11. kWbClassPunct,
  12. kWbClassHanLetter,
  13. kWbClassKatakanaLetter,
  14. kWbClassHiraganaLetter,
  15. kWbClassHWKatakanaLetter,
  16. kWbClassThaiLetter
  17. } wb_class;
  18. class nsSampleWordBreaker : public nsIWordBreaker
  19. {
  20. NS_DECL_ISUPPORTS
  21. public:
  22. nsSampleWordBreaker() ;
  23. bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1,
  24. const char16_t* aText2 , uint32_t aTextLen2) override;
  25. nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1,
  26. uint32_t aOffset) override;
  27. int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos) override;
  28. protected:
  29. uint8_t GetClass(char16_t aChar);
  30. virtual ~nsSampleWordBreaker();
  31. };
  32. #endif /* nsSampleWordBreaker_h__ */