1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
40 // The following constants define unicode subranges
41 // values below kRangeNum must be continuous so that we can map to
42 // lang group directly.
43 // all ranges we care about should be defined under 32, that allows
44 // us to store range using bits of a PRUint32
46 // frequently used range definitions
47 const PRUint8 kRangeCyrillic
= 0;
48 const PRUint8 kRangeGreek
= 1;
49 const PRUint8 kRangeTurkish
= 2;
50 const PRUint8 kRangeHebrew
= 3;
51 const PRUint8 kRangeArabic
= 4;
52 const PRUint8 kRangeBaltic
= 5;
53 const PRUint8 kRangeThai
= 6;
54 const PRUint8 kRangeKorean
= 7;
55 const PRUint8 kRangeJapanese
= 8;
56 const PRUint8 kRangeSChinese
= 9;
57 const PRUint8 kRangeTChinese
= 10;
58 const PRUint8 kRangeDevanagari
= 11;
59 const PRUint8 kRangeTamil
= 12;
60 const PRUint8 kRangeArmenian
= 13;
61 const PRUint8 kRangeBengali
= 14;
62 const PRUint8 kRangeCanadian
= 15;
63 const PRUint8 kRangeEthiopic
= 16;
64 const PRUint8 kRangeGeorgian
= 17;
65 const PRUint8 kRangeGujarati
= 18;
66 const PRUint8 kRangeGurmukhi
= 19;
67 const PRUint8 kRangeKhmer
= 20;
68 const PRUint8 kRangeMalayalam
= 21;
69 const PRUint8 kRangeOriya
= 22;
70 const PRUint8 kRangeTelugu
= 23;
71 const PRUint8 kRangeKannada
= 24;
72 const PRUint8 kRangeSinhala
= 25;
74 const PRUint8 kRangeSpecificItemNum
= 26;
76 //range/rangeSet grow to this place 26-29
78 const PRUint8 kRangeSetStart
= 30; // range set definition starts from here
79 const PRUint8 kRangeSetLatin
= 30;
80 const PRUint8 kRangeSetCJK
= 31;
81 const PRUint8 kRangeSetEnd
= 31; // range set definition ends here
83 // less frequently used range definition
84 const PRUint8 kRangeSurrogate
= 32;
85 const PRUint8 kRangePrivate
= 33;
86 const PRUint8 kRangeMisc
= 34;
87 const PRUint8 kRangeUnassigned
= 35;
88 const PRUint8 kRangeSyriac
= 36;
89 const PRUint8 kRangeThaana
= 37;
90 const PRUint8 kRangeLao
= 38;
91 const PRUint8 kRangeTibetan
= 39;
92 const PRUint8 kRangeMyanmar
= 40;
93 const PRUint8 kRangeCherokee
= 41;
94 const PRUint8 kRangeOghamRunic
= 42;
95 const PRUint8 kRangeMongolian
= 43;
96 const PRUint8 kRangeMathOperators
= 44;
97 const PRUint8 kRangeMiscTechnical
= 45;
98 const PRUint8 kRangeControlOpticalEnclose
= 46;
99 const PRUint8 kRangeBoxBlockGeometrics
= 47;
100 const PRUint8 kRangeMiscSymbols
= 48;
101 const PRUint8 kRangeDingbats
= 49;
102 const PRUint8 kRangeBraillePattern
= 50;
103 const PRUint8 kRangeYi
= 51;
104 const PRUint8 kRangeCombiningDiacriticalMarks
= 52;
105 const PRUint8 kRangeSpecials
= 53;
107 const PRUint8 kRangeTableBase
= 128; //values over 127 are reserved for internal use only
108 const PRUint8 kRangeTertiaryTable
= 145; // leave room for 16 subtable
109 // indices (kRangeTableBase + 1 ..
110 // kRangeTableBase + 16)
114 PRUint32
FindCharUnicodeRange(PRUnichar ch
);
115 const char* LangGroupFromUnicodeRange(PRUint8 unicodeRange
);