1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: cclass_cjk.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CCLASS_CJK_H_
31 #define _CCLASS_CJK_H_
33 #include <cclass_unicode.hxx>
35 namespace com
{ namespace sun
{ namespace star
{ namespace i18n
{
37 #define MAXLEN 31 // Define max length for CJK number
39 #define ZERO 0x0030 // Define unicode zero
40 #define ONE 0x0031 // Define unicode one
42 class cclass_CJK
: public cclass_Unicode
{
44 cclass_CJK( const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
46 i18n::ParseResult SAL_CALL
parsePredefinedToken(
48 const rtl::OUString
& Text
,
50 const com::sun::star::lang::Locale
& rLocale
,
51 sal_Int32 nStartCharFlags
,
52 const rtl::OUString
& userDefinedCharactersStart
,
53 sal_Int32 nContCharFlags
,
54 const rtl::OUString
& userDefinedCharactersCont
)
55 throw(com::sun::star::uno::RuntimeException
);
67 static sal_Int32
cclass_CJK::upperVal
[];
68 static sal_Int32
cclass_CJK::baseVal
[];
69 static sal_Int32
cclass_CJK::plusVal
[];
73 sal_Int32
ToNum(sal_Unicode
*n
, sal_Int32 s
);
74 void Init(sal_Unicode
*n
, sal_Int32 s
);
75 void NumberCopy(sal_Unicode
*s
, sal_Unicode
*t
, sal_Int32 n
);
76 void NumberReverse(sal_Unicode
*s
, sal_Int32 n
);
77 sal_Int32
oneDigit(sal_Unicode s
);
78 sal_Int32
baseDigit(sal_Unicode s
);
79 sal_Int32
plusDigit(sal_Unicode s
);
82 #define CCLASS_CJK( name ) \
83 class name : public cclass_CJK \
86 name ( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); \
91 CCLASS_CJK(cclass_zh_TW
)