1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef INCLUDED_I18NUTIL_UNICODE_HXX 24 #define INCLUDED_I18NUTIL_UNICODE_HXX 25 26 #include <com/sun/star/i18n/UnicodeScript.hpp> 27 #include <sal/types.h> 28 29 typedef struct _ScriptTypeList { 30 sal_Int16 from; 31 sal_Int16 to; 32 sal_Int16 value; 33 } ScriptTypeList; 34 35 class unicode 36 { 37 public: 38 39 static sal_Int16 SAL_CALL getUnicodeType( const sal_Unicode ch ); 40 static sal_Bool SAL_CALL isUnicodeScriptType( const sal_Unicode ch, sal_Int16 type); 41 static sal_Int16 SAL_CALL getUnicodeScriptType( const sal_Unicode ch, ScriptTypeList *typeList = NULL, sal_Int16 unknownType = 0 ); 42 static sal_Unicode SAL_CALL getUnicodeScriptStart(com::sun::star::i18n::UnicodeScript type); 43 static sal_Unicode SAL_CALL getUnicodeScriptEnd(com::sun::star::i18n::UnicodeScript type); 44 static sal_uInt8 SAL_CALL getUnicodeDirection( const sal_Unicode ch ); 45 static sal_Int32 SAL_CALL getCharType( const sal_Unicode ch ); 46 static sal_Bool SAL_CALL isUpper( const sal_Unicode ch); 47 static sal_Bool SAL_CALL isLower( const sal_Unicode ch); 48 static sal_Bool SAL_CALL isTitle( const sal_Unicode ch); 49 static sal_Bool SAL_CALL isDigit( const sal_Unicode ch); 50 static sal_Bool SAL_CALL isControl( const sal_Unicode ch); 51 static sal_Bool SAL_CALL isPrint( const sal_Unicode ch); 52 static sal_Bool SAL_CALL isBase( const sal_Unicode ch); 53 static sal_Bool SAL_CALL isAlpha( const sal_Unicode ch); 54 static sal_Bool SAL_CALL isSpace( const sal_Unicode ch); 55 static sal_Bool SAL_CALL isWhiteSpace( const sal_Unicode ch); 56 static sal_Bool SAL_CALL isAlphaDigit( const sal_Unicode ch); 57 static sal_Bool SAL_CALL isPunctuation( const sal_Unicode ch); 58 }; 59 60 #endif 61 62 63 64