2001-09-26 04:40:45 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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 19:01:48 +03:00
|
|
|
#ifndef nsSampleWordBreaker_h__
|
|
|
|
#define nsSampleWordBreaker_h__
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsIWordBreaker.h"
|
|
|
|
|
2002-11-23 01:36:42 +03:00
|
|
|
typedef enum {
|
|
|
|
kWbClassSpace = 0,
|
|
|
|
kWbClassAlphaLetter,
|
|
|
|
kWbClassPunct,
|
|
|
|
kWbClassHanLetter,
|
|
|
|
kWbClassKatakanaLetter,
|
|
|
|
kWbClassHiraganaLetter,
|
|
|
|
kWbClassHWKatakanaLetter,
|
|
|
|
kWbClassThaiLetter
|
|
|
|
} wb_class;
|
|
|
|
|
1999-02-09 19:01:48 +03:00
|
|
|
class nsSampleWordBreaker : public nsIWordBreaker
|
|
|
|
{
|
|
|
|
NS_DECL_ISUPPORTS
|
1999-02-19 04:38:12 +03:00
|
|
|
public:
|
1999-02-09 19:01:48 +03:00
|
|
|
|
1999-02-10 02:56:05 +03:00
|
|
|
nsSampleWordBreaker() ;
|
1999-02-09 19:01:48 +03:00
|
|
|
|
2014-01-04 19:02:17 +04:00
|
|
|
bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1,
|
2015-01-06 23:12:14 +03:00
|
|
|
const char16_t* aText2 , uint32_t aTextLen2) MOZ_OVERRIDE;
|
2014-01-04 19:02:17 +04:00
|
|
|
nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1,
|
2015-01-06 23:12:14 +03:00
|
|
|
uint32_t aOffset) MOZ_OVERRIDE;
|
1999-02-16 21:11:14 +03:00
|
|
|
|
2015-01-06 23:12:14 +03:00
|
|
|
int32_t NextWord(const char16_t* aText, uint32_t aLen, uint32_t aPos) MOZ_OVERRIDE;
|
1999-03-26 03:49:57 +03:00
|
|
|
|
1999-02-19 04:38:12 +03:00
|
|
|
protected:
|
2014-01-04 19:02:17 +04:00
|
|
|
uint8_t GetClass(char16_t aChar);
|
2014-06-24 02:40:02 +04:00
|
|
|
|
|
|
|
virtual ~nsSampleWordBreaker();
|
1999-02-09 19:01:48 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsSampleWordBreaker_h__ */
|