2001-07-10 18:33:40 +00:00
|
|
|
/*
|
|
|
|
**********************************************************************
|
2006-01-18 03:34:19 +00:00
|
|
|
* Copyright (C) 1997-2006, International Business Machines
|
2001-07-10 18:33:40 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
**********************************************************************
|
|
|
|
*
|
|
|
|
* File USCRIPT.H
|
|
|
|
*
|
|
|
|
* Modification History:
|
|
|
|
*
|
|
|
|
* Date Name Description
|
|
|
|
* 07/06/2001 Ram Creation.
|
|
|
|
******************************************************************************
|
|
|
|
*/
|
|
|
|
#ifndef USCRIPT_H
|
|
|
|
#define USCRIPT_H
|
2004-03-26 22:08:00 +00:00
|
|
|
#include "unicode/utypes.h"
|
2001-07-10 18:33:40 +00:00
|
|
|
|
2001-11-13 22:47:47 +00:00
|
|
|
/**
|
2005-06-22 22:39:36 +00:00
|
|
|
* \file
|
|
|
|
* \brief C API: Unicode Script Information
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constants for Unicode script values from ScriptNames.txt.
|
2001-11-13 22:47:47 +00:00
|
|
|
*
|
2003-11-18 02:37:24 +00:00
|
|
|
* @stable ICU 2.2
|
2001-11-13 22:47:47 +00:00
|
|
|
*/
|
2005-06-28 22:23:05 +00:00
|
|
|
typedef enum UScriptCode {
|
2001-09-11 05:00:34 +00:00
|
|
|
USCRIPT_INVALID_CODE = -1,
|
|
|
|
USCRIPT_COMMON = 0 , /* Zyyy */
|
|
|
|
USCRIPT_INHERITED = 1, /* Qaai */
|
|
|
|
USCRIPT_ARABIC = 2, /* Arab */
|
|
|
|
USCRIPT_ARMENIAN = 3, /* Armn */
|
|
|
|
USCRIPT_BENGALI = 4, /* Beng */
|
|
|
|
USCRIPT_BOPOMOFO = 5, /* Bopo */
|
|
|
|
USCRIPT_CHEROKEE = 6, /* Cher */
|
2004-10-13 00:39:42 +00:00
|
|
|
USCRIPT_COPTIC = 7, /* Copt */
|
2001-09-11 05:00:34 +00:00
|
|
|
USCRIPT_CYRILLIC = 8, /* Cyrl (Cyrs) */
|
|
|
|
USCRIPT_DESERET = 9, /* Dsrt */
|
|
|
|
USCRIPT_DEVANAGARI = 10, /* Deva */
|
|
|
|
USCRIPT_ETHIOPIC = 11, /* Ethi */
|
|
|
|
USCRIPT_GEORGIAN = 12, /* Geor (Geon, Geoa) */
|
|
|
|
USCRIPT_GOTHIC = 13, /* Goth */
|
|
|
|
USCRIPT_GREEK = 14, /* Grek */
|
|
|
|
USCRIPT_GUJARATI = 15, /* Gujr */
|
|
|
|
USCRIPT_GURMUKHI = 16, /* Guru */
|
|
|
|
USCRIPT_HAN = 17, /* Hani */
|
|
|
|
USCRIPT_HANGUL = 18, /* Hang */
|
|
|
|
USCRIPT_HEBREW = 19, /* Hebr */
|
|
|
|
USCRIPT_HIRAGANA = 20, /* Hira */
|
|
|
|
USCRIPT_KANNADA = 21, /* Knda */
|
|
|
|
USCRIPT_KATAKANA = 22, /* Kana */
|
|
|
|
USCRIPT_KHMER = 23, /* Khmr */
|
|
|
|
USCRIPT_LAO = 24, /* Laoo */
|
|
|
|
USCRIPT_LATIN = 25, /* Latn (Latf, Latg) */
|
|
|
|
USCRIPT_MALAYALAM = 26, /* Mlym */
|
|
|
|
USCRIPT_MONGOLIAN = 27, /* Mong */
|
|
|
|
USCRIPT_MYANMAR = 28, /* Mymr */
|
|
|
|
USCRIPT_OGHAM = 29, /* Ogam */
|
|
|
|
USCRIPT_OLD_ITALIC = 30, /* Ital */
|
|
|
|
USCRIPT_ORIYA = 31, /* Orya */
|
|
|
|
USCRIPT_RUNIC = 32, /* Runr */
|
|
|
|
USCRIPT_SINHALA = 33, /* Sinh */
|
|
|
|
USCRIPT_SYRIAC = 34, /* Syrc (Syrj, Syrn, Syre) */
|
|
|
|
USCRIPT_TAMIL = 35, /* Taml */
|
|
|
|
USCRIPT_TELUGU = 36, /* Telu */
|
|
|
|
USCRIPT_THAANA = 37, /* Thaa */
|
|
|
|
USCRIPT_THAI = 38, /* Thai */
|
|
|
|
USCRIPT_TIBETAN = 39, /* Tibt */
|
2004-11-02 07:28:07 +00:00
|
|
|
/** Canadian_Aboriginal script. @stable ICU 2.6 */
|
2003-02-27 00:59:50 +00:00
|
|
|
USCRIPT_CANADIAN_ABORIGINAL = 40, /* Cans */
|
2003-11-18 02:37:24 +00:00
|
|
|
/** Canadian_Aboriginal script (alias). @stable ICU 2.2 */
|
2003-03-04 00:47:01 +00:00
|
|
|
USCRIPT_UCAS = USCRIPT_CANADIAN_ABORIGINAL,
|
2001-09-11 05:00:34 +00:00
|
|
|
USCRIPT_YI = 41, /* Yiii */
|
2002-06-01 00:34:36 +00:00
|
|
|
USCRIPT_TAGALOG = 42, /* Tglg */
|
|
|
|
USCRIPT_HANUNOO = 43, /* Hano */
|
|
|
|
USCRIPT_BUHID = 44, /* Buhd */
|
|
|
|
USCRIPT_TAGBANWA = 45, /* Tagb */
|
2003-03-04 00:47:01 +00:00
|
|
|
|
2004-11-02 07:28:07 +00:00
|
|
|
/* New scripts in Unicode 4 @stable ICU 2.6 */
|
2003-03-17 18:02:10 +00:00
|
|
|
USCRIPT_BRAILLE, /* Brai */
|
|
|
|
USCRIPT_CYPRIOT, /* Cprt */
|
|
|
|
USCRIPT_LIMBU, /* Limb */
|
|
|
|
USCRIPT_LINEAR_B, /* Linb */
|
|
|
|
USCRIPT_OSMANYA, /* Osma */
|
|
|
|
USCRIPT_SHAVIAN, /* Shaw */
|
|
|
|
USCRIPT_TAI_LE, /* Tale */
|
|
|
|
USCRIPT_UGARITIC, /* Ugar */
|
2003-03-04 00:47:01 +00:00
|
|
|
|
2006-01-18 03:34:19 +00:00
|
|
|
/** New script code in Unicode 4.0.1 @stable ICU 3.0 */
|
2004-04-02 17:41:06 +00:00
|
|
|
USCRIPT_KATAKANA_OR_HIRAGANA,/*Hrkt */
|
|
|
|
|
2005-01-10 18:02:54 +00:00
|
|
|
/* New scripts in Unicode 4.1 @draft ICU 3.4 */
|
|
|
|
USCRIPT_BUGINESE, /* Bugi */
|
|
|
|
USCRIPT_GLAGOLITIC, /* Glag */
|
|
|
|
USCRIPT_KHAROSHTHI, /* Khar */
|
|
|
|
USCRIPT_SYLOTI_NAGRI, /* Sylo */
|
|
|
|
USCRIPT_NEW_TAI_LUE, /* Talu */
|
|
|
|
USCRIPT_TIFINAGH, /* Tfng */
|
|
|
|
USCRIPT_OLD_PERSIAN, /* Xpeo */
|
|
|
|
|
2002-06-01 00:34:36 +00:00
|
|
|
USCRIPT_CODE_LIMIT
|
2001-07-16 16:49:46 +00:00
|
|
|
} UScriptCode;
|
2001-07-11 23:52:58 +00:00
|
|
|
|
2001-07-10 18:33:40 +00:00
|
|
|
/**
|
2001-10-23 02:00:50 +00:00
|
|
|
* Gets script codes associated with the given locale or ISO 15924 abbreviation or name.
|
2002-05-13 21:50:59 +00:00
|
|
|
* Fills in USCRIPT_MALAYALAM given "Malayam" OR "Mlym".
|
2001-10-23 02:00:50 +00:00
|
|
|
* Fills in USCRIPT_LATIN given "en" OR "en_US"
|
|
|
|
* If required capacity is greater than capacity of the destination buffer then the error code
|
|
|
|
* is set to U_BUFFER_OVERFLOW_ERROR and the required capacity is returned
|
2002-11-01 14:51:43 +00:00
|
|
|
*
|
|
|
|
* <p>Note: To search by short or long script alias only, use
|
|
|
|
* u_getPropertyValueEnum(UCHAR_SCRIPT, alias) instead. This does
|
|
|
|
* a fast lookup with no access of the locale data.
|
2002-10-30 18:25:27 +00:00
|
|
|
* @param nameOrAbbrOrLocale name of the script, as given in
|
|
|
|
* PropertyValueAliases.txt, or ISO 15924 code or locale
|
2001-10-23 02:00:50 +00:00
|
|
|
* @param fillIn the UScriptCode buffer to fill in the script code
|
|
|
|
* @param capacity the capacity (size) fo UScriptCode buffer passed in.
|
2001-07-10 18:33:40 +00:00
|
|
|
* @param err the error status code.
|
2001-10-23 02:00:50 +00:00
|
|
|
* @return The number of script codes filled in the buffer passed in
|
2004-03-26 19:42:04 +00:00
|
|
|
* @stable ICU 2.4
|
2001-07-10 18:33:40 +00:00
|
|
|
*/
|
2004-03-26 19:42:04 +00:00
|
|
|
U_STABLE int32_t U_EXPORT2
|
2001-10-23 02:00:50 +00:00
|
|
|
uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err);
|
2001-07-10 18:33:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a script name associated with the given script code.
|
2002-05-13 21:50:59 +00:00
|
|
|
* Returns "Malayam" given USCRIPT_MALAYALAM
|
2001-07-10 18:33:40 +00:00
|
|
|
* @param scriptCode UScriptCode enum
|
2002-10-30 18:25:27 +00:00
|
|
|
* @return script long name as given in
|
|
|
|
* PropertyValueAliases.txt, or NULL if scriptCode is invalid
|
2004-03-26 19:42:04 +00:00
|
|
|
* @stable ICU 2.4
|
2001-07-10 18:33:40 +00:00
|
|
|
*/
|
2004-03-26 19:42:04 +00:00
|
|
|
U_STABLE const char* U_EXPORT2
|
2001-09-11 05:00:34 +00:00
|
|
|
uscript_getName(UScriptCode scriptCode);
|
2001-07-10 18:33:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a script name associated with the given script code.
|
2002-05-13 21:50:59 +00:00
|
|
|
* Returns "Mlym" given USCRIPT_MALAYALAM
|
2001-07-10 18:33:40 +00:00
|
|
|
* @param scriptCode UScriptCode enum
|
2002-10-30 18:25:27 +00:00
|
|
|
* @return script abbreviated name as given in
|
|
|
|
* PropertyValueAliases.txt, or NULL if scriptCode is invalid
|
2004-03-26 19:42:04 +00:00
|
|
|
* @stable ICU 2.4
|
2001-07-10 18:33:40 +00:00
|
|
|
*/
|
2004-03-26 19:42:04 +00:00
|
|
|
U_STABLE const char* U_EXPORT2
|
2001-09-11 05:00:34 +00:00
|
|
|
uscript_getShortName(UScriptCode scriptCode);
|
2001-07-10 18:33:40 +00:00
|
|
|
|
2001-09-21 05:09:22 +00:00
|
|
|
/**
|
|
|
|
* Gets the script code associated with the given codepoint.
|
2002-05-13 21:50:59 +00:00
|
|
|
* Returns USCRIPT_MALAYALAM given 0x0D02
|
2001-09-21 05:09:22 +00:00
|
|
|
* @param codepoint UChar32 codepoint
|
|
|
|
* @param err the error status code.
|
2002-11-13 20:03:11 +00:00
|
|
|
* @return The UScriptCode, or 0 if codepoint is invalid
|
2004-03-26 19:42:04 +00:00
|
|
|
* @stable ICU 2.4
|
2001-09-21 05:09:22 +00:00
|
|
|
*/
|
2004-03-26 19:42:04 +00:00
|
|
|
U_STABLE UScriptCode U_EXPORT2
|
2001-09-21 05:09:22 +00:00
|
|
|
uscript_getScript(UChar32 codepoint, UErrorCode *err);
|
|
|
|
|
2001-07-10 18:33:40 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|