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 mozilla_intl_WordBreaker_h__
6 #define mozilla_intl_WordBreaker_h__
9 #include "nsISupports.h"
11 #define NS_WORDBREAKER_NEED_MORE_TEXT -1
21 enum WordBreakClass
: uint8_t {
26 kWbClassKatakanaLetter
,
27 kWbClassHiraganaLetter
,
28 kWbClassHWKatakanaLetter
,
29 kWbClassScriptioContinua
34 NS_INLINE_DECL_REFCOUNTING(WordBreaker
)
36 static already_AddRefed
<WordBreaker
> Create();
38 bool BreakInBetween(const char16_t
* aText1
, uint32_t aTextLen1
,
39 const char16_t
* aText2
, uint32_t aTextLen2
);
40 WordRange
FindWord(const char16_t
* aText1
, uint32_t aTextLen1
,
42 int32_t NextWord(const char16_t
* aText
, uint32_t aLen
, uint32_t aPos
);
44 static WordBreakClass
GetClass(char16_t aChar
);
47 ~WordBreaker() = default;
51 } // namespace mozilla
53 #endif /* mozilla_intl_WordBreaker_h__ */