|
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 |
|
8 |
|
9 #include "nsIWordBreaker.h" |
|
10 |
|
11 typedef enum { |
|
12 kWbClassSpace = 0, |
|
13 kWbClassAlphaLetter, |
|
14 kWbClassPunct, |
|
15 kWbClassHanLetter, |
|
16 kWbClassKatakanaLetter, |
|
17 kWbClassHiraganaLetter, |
|
18 kWbClassHWKatakanaLetter, |
|
19 kWbClassThaiLetter |
|
20 } wb_class; |
|
21 |
|
22 class nsSampleWordBreaker : public nsIWordBreaker |
|
23 { |
|
24 NS_DECL_ISUPPORTS |
|
25 public: |
|
26 |
|
27 nsSampleWordBreaker() ; |
|
28 virtual ~nsSampleWordBreaker() ; |
|
29 |
|
30 bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1, |
|
31 const char16_t* aText2 , uint32_t aTextLen2); |
|
32 nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1, |
|
33 uint32_t aOffset); |
|
34 |
|
35 int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos); |
|
36 |
|
37 protected: |
|
38 uint8_t GetClass(char16_t aChar); |
|
39 }; |
|
40 |
|
41 #endif /* nsSampleWordBreaker_h__ */ |