xref: /aoo41x/main/i18npool/inc/wtt.h (revision 514f4c20)
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 _I18N_WTT_H_
24 #define _I18N_WTT_H_
25 
26 namespace com { namespace sun { namespace star { namespace i18n {
27 
28 /*
29  * Thai character type definition.
30  */
31 
32 #define CT_CTRL		0		// Control character
33 #define CT_NON		1		// Non-composible
34 #define CT_CONS		2		// Consonant
35 #define CT_LV		3		// Leading vowel
36 #define CT_FV1		4		// Following vowel
37 #define CT_FV2		5		// Following vowel
38 #define CT_FV3		6
39 #define CT_BV1		7		// Below vowel
40 #define CT_BV2		8
41 #define CT_BD		9		// Below diacritic
42 #define CT_TONE		10		// Tone
43 #define CT_AD1		11		// Above diacritic
44 #define CT_AD2		12
45 #define CT_AD3		13
46 #define CT_AV1		14		// Above vowel
47 #define CT_AV2		15
48 #define CT_AV3		16
49 
50 #define MAX_CT		17
51 
52 static const sal_uInt16 thaiCT[128] = {		// Thai character type
53 	CT_NON, CT_CONS, CT_CONS, CT_CONS, CT_CONS,CT_CONS, CT_CONS, CT_CONS,		//0E00
54 	CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS,
55 	CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS,		//0E10
56 	CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS,
57 	CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_FV3, CT_CONS, CT_FV3, CT_CONS,		//0E20
58 	CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_CONS, CT_NON,
59 	CT_FV1, CT_AV2, CT_FV1, CT_FV1, CT_AV1, CT_AV3, CT_AV2, CT_AV3,			//0E30
60 	CT_BV1, CT_BV2, CT_BD, CT_NON, CT_NON, CT_NON, CT_NON, CT_NON,
61 	CT_LV, CT_LV, CT_LV, CT_LV, CT_LV, CT_FV2, CT_NON, CT_AD2,			//0E40
62 	CT_TONE, CT_TONE, CT_TONE, CT_TONE, CT_AD1, CT_AD1, CT_AD3, CT_NON,
63 	CT_NON, CT_NON, CT_NON, CT_NON, CT_NON, CT_NON, CT_NON, CT_NON,			//0E50
64 	CT_NON, CT_NON, CT_NON, CT_NON, CT_NON, CT_NON, CT_NON, CT_CTRL };
65 
66 #define getCharType(x) ((x >= 0x0E00 && x < 0x0E60) ? thaiCT[x - 0x0E00] : CT_NON)
67 
68 } } } }
69 
70 #endif // _I18N_WTT_H_
71