2001-09-26 00:40:45 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-02-09 16:01:48 +00:00
|
|
|
#ifndef nsSampleWordBreaker_h__
|
|
|
|
#define nsSampleWordBreaker_h__
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsIWordBreaker.h"
|
|
|
|
|
2002-11-22 22:36:42 +00:00
|
|
|
typedef enum {
|
|
|
|
kWbClassSpace = 0,
|
|
|
|
kWbClassAlphaLetter,
|
|
|
|
kWbClassPunct,
|
|
|
|
kWbClassHanLetter,
|
|
|
|
kWbClassKatakanaLetter,
|
|
|
|
kWbClassHiraganaLetter,
|
|
|
|
kWbClassHWKatakanaLetter,
|
|
|
|
kWbClassThaiLetter
|
|
|
|
} wb_class;
|
|
|
|
|
1999-02-09 16:01:48 +00:00
|
|
|
class nsSampleWordBreaker : public nsIWordBreaker
|
|
|
|
{
|
|
|
|
NS_DECL_ISUPPORTS
|
1999-02-19 01:38:12 +00:00
|
|
|
public:
|
1999-02-09 16:01:48 +00:00
|
|
|
|
1999-02-09 23:56:05 +00:00
|
|
|
nsSampleWordBreaker() ;
|
1999-02-09 16:01:48 +00:00
|
|
|
|
2014-01-04 15:02:17 +00:00
|
|
|
bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1,
|
2015-01-06 20:12:14 +00:00
|
|
|
const char16_t* aText2 , uint32_t aTextLen2) MOZ_OVERRIDE;
|
2014-01-04 15:02:17 +00:00
|
|
|
nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1,
|
2015-01-06 20:12:14 +00:00
|
|
|
uint32_t aOffset) MOZ_OVERRIDE;
|
1999-02-16 18:11:14 +00:00
|
|
|
|
2015-01-06 20:12:14 +00:00
|
|
|
int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos) MOZ_OVERRIDE;
|
1999-03-26 00:49:57 +00:00
|
|
|
|
1999-02-19 01:38:12 +00:00
|
|
|
protected:
|
2014-01-04 15:02:17 +00:00
|
|
|
uint8_t GetClass(char16_t aChar);
|
2014-06-23 22:40:02 +00:00
|
|
|
|
|
|
|
virtual ~nsSampleWordBreaker();
|
1999-02-09 16:01:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsSampleWordBreaker_h__ */
|