1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski 23*b1cdbd2cSJim Jagielski #ifndef _CCLASS_CJK_H_ 24*b1cdbd2cSJim Jagielski #define _CCLASS_CJK_H_ 25*b1cdbd2cSJim Jagielski 26*b1cdbd2cSJim Jagielski #include <cclass_unicode.hxx> 27*b1cdbd2cSJim Jagielski 28*b1cdbd2cSJim Jagielski namespace com { namespace sun { namespace star { namespace i18n { 29*b1cdbd2cSJim Jagielski 30*b1cdbd2cSJim Jagielski #define MAXLEN 31 // Define max length for CJK number 31*b1cdbd2cSJim Jagielski 32*b1cdbd2cSJim Jagielski #define ZERO 0x0030 // Define unicode zero 33*b1cdbd2cSJim Jagielski #define ONE 0x0031 // Define unicode one 34*b1cdbd2cSJim Jagielski 35*b1cdbd2cSJim Jagielski class cclass_CJK : public cclass_Unicode { 36*b1cdbd2cSJim Jagielski public: 37*b1cdbd2cSJim Jagielski cclass_CJK( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); 38*b1cdbd2cSJim Jagielski ~cclass_CJK(); 39*b1cdbd2cSJim Jagielski i18n::ParseResult SAL_CALL parsePredefinedToken( 40*b1cdbd2cSJim Jagielski sal_Int32 nTokenType, 41*b1cdbd2cSJim Jagielski const rtl::OUString& Text, 42*b1cdbd2cSJim Jagielski sal_Int32 nPos, 43*b1cdbd2cSJim Jagielski const com::sun::star::lang::Locale& rLocale, 44*b1cdbd2cSJim Jagielski sal_Int32 nStartCharFlags, 45*b1cdbd2cSJim Jagielski const rtl::OUString& userDefinedCharactersStart, 46*b1cdbd2cSJim Jagielski sal_Int32 nContCharFlags, 47*b1cdbd2cSJim Jagielski const rtl::OUString& userDefinedCharactersCont ) 48*b1cdbd2cSJim Jagielski throw(com::sun::star::uno::RuntimeException); 49*b1cdbd2cSJim Jagielski 50*b1cdbd2cSJim Jagielski protected: 51*b1cdbd2cSJim Jagielski sal_Int32 size; 52*b1cdbd2cSJim Jagielski rtl::OUString number; 53*b1cdbd2cSJim Jagielski sal_Unicode *text; 54*b1cdbd2cSJim Jagielski sal_Int32 textPos; 55*b1cdbd2cSJim Jagielski 56*b1cdbd2cSJim Jagielski sal_Unicode *Upper; 57*b1cdbd2cSJim Jagielski sal_Unicode *Base; 58*b1cdbd2cSJim Jagielski sal_Unicode *Plus; 59*b1cdbd2cSJim Jagielski 60*b1cdbd2cSJim Jagielski static sal_Int32 cclass_CJK::upperVal[]; 61*b1cdbd2cSJim Jagielski static sal_Int32 cclass_CJK::baseVal[]; 62*b1cdbd2cSJim Jagielski static sal_Int32 cclass_CJK::plusVal[]; 63*b1cdbd2cSJim Jagielski 64*b1cdbd2cSJim Jagielski private: 65*b1cdbd2cSJim Jagielski sal_Int32 ToNum(); 66*b1cdbd2cSJim Jagielski sal_Int32 ToNum(sal_Unicode *n, sal_Int32 s); 67*b1cdbd2cSJim Jagielski void Init(sal_Unicode *n, sal_Int32 s); 68*b1cdbd2cSJim Jagielski void NumberCopy(sal_Unicode *s, sal_Unicode *t, sal_Int32 n); 69*b1cdbd2cSJim Jagielski void NumberReverse(sal_Unicode *s, sal_Int32 n); 70*b1cdbd2cSJim Jagielski sal_Int32 oneDigit(sal_Unicode s); 71*b1cdbd2cSJim Jagielski sal_Int32 baseDigit(sal_Unicode s); 72*b1cdbd2cSJim Jagielski sal_Int32 plusDigit(sal_Unicode s); 73*b1cdbd2cSJim Jagielski }; 74*b1cdbd2cSJim Jagielski 75*b1cdbd2cSJim Jagielski #define CCLASS_CJK( name ) \ 76*b1cdbd2cSJim Jagielski class name : public cclass_CJK \ 77*b1cdbd2cSJim Jagielski { \ 78*b1cdbd2cSJim Jagielski public: \ 79*b1cdbd2cSJim Jagielski name ( const com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& rxMSF ); \ 80*b1cdbd2cSJim Jagielski }; 81*b1cdbd2cSJim Jagielski 82*b1cdbd2cSJim Jagielski #ifdef CCLASS_ALL 83*b1cdbd2cSJim Jagielski CCLASS_CJK(cclass_zh) 84*b1cdbd2cSJim Jagielski CCLASS_CJK(cclass_zh_TW) 85*b1cdbd2cSJim Jagielski CCLASS_CJK(cclass_ko) 86*b1cdbd2cSJim Jagielski #endif 87*b1cdbd2cSJim Jagielski #undef CCLASS_CJK 88*b1cdbd2cSJim Jagielski 89*b1cdbd2cSJim Jagielski } } } } 90*b1cdbd2cSJim Jagielski 91*b1cdbd2cSJim Jagielski #endif 92