nsJISx4051LineBreaker.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 nsJISx4051LineBreaker_h__
  6. #define nsJISx4051LineBreaker_h__
  7. #include "nsILineBreaker.h"
  8. class nsJISx4051LineBreaker : public nsILineBreaker
  9. {
  10. NS_DECL_ISUPPORTS
  11. private:
  12. virtual ~nsJISx4051LineBreaker();
  13. public:
  14. nsJISx4051LineBreaker();
  15. int32_t Next( const char16_t* aText, uint32_t aLen, uint32_t aPos) override;
  16. int32_t Prev( const char16_t* aText, uint32_t aLen, uint32_t aPos) override;
  17. virtual void GetJISx4051Breaks(const char16_t* aText, uint32_t aLength,
  18. uint8_t aBreakMode,
  19. uint8_t* aBreakBefore) override;
  20. virtual void GetJISx4051Breaks(const uint8_t* aText, uint32_t aLength,
  21. uint8_t aBreakMode,
  22. uint8_t* aBreakBefore) override;
  23. private:
  24. int32_t WordMove(const char16_t* aText, uint32_t aLen, uint32_t aPos,
  25. int8_t aDirection);
  26. };
  27. #endif /* nsJISx4051LineBreaker_h__ */