sl@0: /* sl@0: ********************************************************************** sl@0: * Copyright (C) 1997-2005, International Business Machines sl@0: * Corporation and others. All Rights Reserved. sl@0: ********************************************************************** sl@0: * sl@0: * File USCRIPT.H sl@0: * sl@0: * Modification History: sl@0: * sl@0: * Date Name Description sl@0: * 07/06/2001 Ram Creation. sl@0: ****************************************************************************** sl@0: */ sl@0: #ifndef USCRIPT_H sl@0: #define USCRIPT_H sl@0: #include "unicode/utypes.h" sl@0: sl@0: /** sl@0: * \file sl@0: * \brief C API: Unicode Script Information sl@0: */ sl@0: sl@0: /** sl@0: * Constants for Unicode script values from ScriptNames.txt. sl@0: * sl@0: * @stable ICU 2.2 sl@0: */ sl@0: typedef enum UScriptCode { sl@0: USCRIPT_INVALID_CODE = -1, sl@0: USCRIPT_COMMON = 0 , /* Zyyy */ sl@0: USCRIPT_INHERITED = 1, /* Qaai */ sl@0: USCRIPT_ARABIC = 2, /* Arab */ sl@0: USCRIPT_ARMENIAN = 3, /* Armn */ sl@0: USCRIPT_BENGALI = 4, /* Beng */ sl@0: USCRIPT_BOPOMOFO = 5, /* Bopo */ sl@0: USCRIPT_CHEROKEE = 6, /* Cher */ sl@0: USCRIPT_COPTIC = 7, /* Copt */ sl@0: USCRIPT_CYRILLIC = 8, /* Cyrl (Cyrs) */ sl@0: USCRIPT_DESERET = 9, /* Dsrt */ sl@0: USCRIPT_DEVANAGARI = 10, /* Deva */ sl@0: USCRIPT_ETHIOPIC = 11, /* Ethi */ sl@0: USCRIPT_GEORGIAN = 12, /* Geor (Geon, Geoa) */ sl@0: USCRIPT_GOTHIC = 13, /* Goth */ sl@0: USCRIPT_GREEK = 14, /* Grek */ sl@0: USCRIPT_GUJARATI = 15, /* Gujr */ sl@0: USCRIPT_GURMUKHI = 16, /* Guru */ sl@0: USCRIPT_HAN = 17, /* Hani */ sl@0: USCRIPT_HANGUL = 18, /* Hang */ sl@0: USCRIPT_HEBREW = 19, /* Hebr */ sl@0: USCRIPT_HIRAGANA = 20, /* Hira */ sl@0: USCRIPT_KANNADA = 21, /* Knda */ sl@0: USCRIPT_KATAKANA = 22, /* Kana */ sl@0: USCRIPT_KHMER = 23, /* Khmr */ sl@0: USCRIPT_LAO = 24, /* Laoo */ sl@0: USCRIPT_LATIN = 25, /* Latn (Latf, Latg) */ sl@0: USCRIPT_MALAYALAM = 26, /* Mlym */ sl@0: USCRIPT_MONGOLIAN = 27, /* Mong */ sl@0: USCRIPT_MYANMAR = 28, /* Mymr */ sl@0: USCRIPT_OGHAM = 29, /* Ogam */ sl@0: USCRIPT_OLD_ITALIC = 30, /* Ital */ sl@0: USCRIPT_ORIYA = 31, /* Orya */ sl@0: USCRIPT_RUNIC = 32, /* Runr */ sl@0: USCRIPT_SINHALA = 33, /* Sinh */ sl@0: USCRIPT_SYRIAC = 34, /* Syrc (Syrj, Syrn, Syre) */ sl@0: USCRIPT_TAMIL = 35, /* Taml */ sl@0: USCRIPT_TELUGU = 36, /* Telu */ sl@0: USCRIPT_THAANA = 37, /* Thaa */ sl@0: USCRIPT_THAI = 38, /* Thai */ sl@0: USCRIPT_TIBETAN = 39, /* Tibt */ sl@0: /** Canadian_Aboriginal script. @stable ICU 2.6 */ sl@0: USCRIPT_CANADIAN_ABORIGINAL = 40, /* Cans */ sl@0: /** Canadian_Aboriginal script (alias). @stable ICU 2.2 */ sl@0: USCRIPT_UCAS = USCRIPT_CANADIAN_ABORIGINAL, sl@0: USCRIPT_YI = 41, /* Yiii */ sl@0: USCRIPT_TAGALOG = 42, /* Tglg */ sl@0: USCRIPT_HANUNOO = 43, /* Hano */ sl@0: USCRIPT_BUHID = 44, /* Buhd */ sl@0: USCRIPT_TAGBANWA = 45, /* Tagb */ sl@0: sl@0: /* New scripts in Unicode 4 @stable ICU 2.6 */ sl@0: USCRIPT_BRAILLE, /* Brai */ sl@0: USCRIPT_CYPRIOT, /* Cprt */ sl@0: USCRIPT_LIMBU, /* Limb */ sl@0: USCRIPT_LINEAR_B, /* Linb */ sl@0: USCRIPT_OSMANYA, /* Osma */ sl@0: USCRIPT_SHAVIAN, /* Shaw */ sl@0: USCRIPT_TAI_LE, /* Tale */ sl@0: USCRIPT_UGARITIC, /* Ugar */ sl@0: sl@0: /** New script code in Unicode 4.0.1 @draft ICU 3.0 */ sl@0: USCRIPT_KATAKANA_OR_HIRAGANA,/*Hrkt */ sl@0: sl@0: /* New scripts in Unicode 4.1 @draft ICU 3.4 */ sl@0: USCRIPT_BUGINESE, /* Bugi */ sl@0: USCRIPT_GLAGOLITIC, /* Glag */ sl@0: USCRIPT_KHAROSHTHI, /* Khar */ sl@0: USCRIPT_SYLOTI_NAGRI, /* Sylo */ sl@0: USCRIPT_NEW_TAI_LUE, /* Talu */ sl@0: USCRIPT_TIFINAGH, /* Tfng */ sl@0: USCRIPT_OLD_PERSIAN, /* Xpeo */ sl@0: sl@0: USCRIPT_CODE_LIMIT sl@0: } UScriptCode; sl@0: sl@0: /** sl@0: * Gets script codes associated with the given locale or ISO 15924 abbreviation or name. sl@0: * Fills in USCRIPT_MALAYALAM given "Malayam" OR "Mlym". sl@0: * Fills in USCRIPT_LATIN given "en" OR "en_US" sl@0: * If required capacity is greater than capacity of the destination buffer then the error code sl@0: * is set to U_BUFFER_OVERFLOW_ERROR and the required capacity is returned sl@0: * sl@0: *

Note: To search by short or long script alias only, use sl@0: * u_getPropertyValueEnum(UCHAR_SCRIPT, alias) instead. This does sl@0: * a fast lookup with no access of the locale data. sl@0: * @param nameOrAbbrOrLocale name of the script, as given in sl@0: * PropertyValueAliases.txt, or ISO 15924 code or locale sl@0: * @param fillIn the UScriptCode buffer to fill in the script code sl@0: * @param capacity the capacity (size) fo UScriptCode buffer passed in. sl@0: * @param err the error status code. sl@0: * @return The number of script codes filled in the buffer passed in sl@0: * @stable ICU 2.4 sl@0: */ sl@0: U_STABLE int32_t U_EXPORT2 sl@0: uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err); sl@0: sl@0: /** sl@0: * Gets a script name associated with the given script code. sl@0: * Returns "Malayam" given USCRIPT_MALAYALAM sl@0: * @param scriptCode UScriptCode enum sl@0: * @return script long name as given in sl@0: * PropertyValueAliases.txt, or NULL if scriptCode is invalid sl@0: * @stable ICU 2.4 sl@0: */ sl@0: U_STABLE const char* U_EXPORT2 sl@0: uscript_getName(UScriptCode scriptCode); sl@0: sl@0: /** sl@0: * Gets a script name associated with the given script code. sl@0: * Returns "Mlym" given USCRIPT_MALAYALAM sl@0: * @param scriptCode UScriptCode enum sl@0: * @return script abbreviated name as given in sl@0: * PropertyValueAliases.txt, or NULL if scriptCode is invalid sl@0: * @stable ICU 2.4 sl@0: */ sl@0: U_STABLE const char* U_EXPORT2 sl@0: uscript_getShortName(UScriptCode scriptCode); sl@0: sl@0: /** sl@0: * Gets the script code associated with the given codepoint. sl@0: * Returns USCRIPT_MALAYALAM given 0x0D02 sl@0: * @param codepoint UChar32 codepoint sl@0: * @param err the error status code. sl@0: * @return The UScriptCode, or 0 if codepoint is invalid sl@0: * @stable ICU 2.4 sl@0: */ sl@0: U_STABLE UScriptCode U_EXPORT2 sl@0: uscript_getScript(UChar32 codepoint, UErrorCode *err); sl@0: sl@0: #endif sl@0: sl@0: