michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef nsSampleWordBreaker_h__ michael@0: #define nsSampleWordBreaker_h__ michael@0: michael@0: michael@0: #include "nsIWordBreaker.h" michael@0: michael@0: typedef enum { michael@0: kWbClassSpace = 0, michael@0: kWbClassAlphaLetter, michael@0: kWbClassPunct, michael@0: kWbClassHanLetter, michael@0: kWbClassKatakanaLetter, michael@0: kWbClassHiraganaLetter, michael@0: kWbClassHWKatakanaLetter, michael@0: kWbClassThaiLetter michael@0: } wb_class; michael@0: michael@0: class nsSampleWordBreaker : public nsIWordBreaker michael@0: { michael@0: NS_DECL_ISUPPORTS michael@0: public: michael@0: michael@0: nsSampleWordBreaker() ; michael@0: virtual ~nsSampleWordBreaker() ; michael@0: michael@0: bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1, michael@0: const char16_t* aText2 , uint32_t aTextLen2); michael@0: nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1, michael@0: uint32_t aOffset); michael@0: michael@0: int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos); michael@0: michael@0: protected: michael@0: uint8_t GetClass(char16_t aChar); michael@0: }; michael@0: michael@0: #endif /* nsSampleWordBreaker_h__ */