os/textandloc/fontservices/textshaperplugin/IcuSource/common/unicode/uscript.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
**********************************************************************
sl@0
     3
*   Copyright (C) 1997-2005, International Business Machines
sl@0
     4
*   Corporation and others.  All Rights Reserved.
sl@0
     5
**********************************************************************
sl@0
     6
*
sl@0
     7
* File USCRIPT.H
sl@0
     8
*
sl@0
     9
* Modification History:
sl@0
    10
*
sl@0
    11
*   Date        Name        Description
sl@0
    12
*   07/06/2001    Ram         Creation.
sl@0
    13
******************************************************************************
sl@0
    14
*/
sl@0
    15
#ifndef USCRIPT_H
sl@0
    16
#define USCRIPT_H
sl@0
    17
#include "unicode/utypes.h"
sl@0
    18
sl@0
    19
/**
sl@0
    20
 * \file
sl@0
    21
 * \brief C API: Unicode Script Information
sl@0
    22
 */
sl@0
    23
 
sl@0
    24
/**
sl@0
    25
 * Constants for Unicode script values from ScriptNames.txt.
sl@0
    26
 *
sl@0
    27
 * @stable ICU 2.2
sl@0
    28
 */
sl@0
    29
typedef enum UScriptCode {
sl@0
    30
      USCRIPT_INVALID_CODE = -1,
sl@0
    31
      USCRIPT_COMMON       =  0 , /* Zyyy */
sl@0
    32
      USCRIPT_INHERITED    =  1,  /* Qaai */
sl@0
    33
      USCRIPT_ARABIC       =  2,  /* Arab */
sl@0
    34
      USCRIPT_ARMENIAN     =  3,  /* Armn */
sl@0
    35
      USCRIPT_BENGALI      =  4,  /* Beng */
sl@0
    36
      USCRIPT_BOPOMOFO     =  5,  /* Bopo */
sl@0
    37
      USCRIPT_CHEROKEE     =  6,  /* Cher */
sl@0
    38
      USCRIPT_COPTIC       =  7,  /* Copt */
sl@0
    39
      USCRIPT_CYRILLIC     =  8,  /* Cyrl (Cyrs) */
sl@0
    40
      USCRIPT_DESERET      =  9,  /* Dsrt */
sl@0
    41
      USCRIPT_DEVANAGARI   = 10,  /* Deva */
sl@0
    42
      USCRIPT_ETHIOPIC     = 11,  /* Ethi */
sl@0
    43
      USCRIPT_GEORGIAN     = 12,  /* Geor (Geon, Geoa) */
sl@0
    44
      USCRIPT_GOTHIC       = 13,  /* Goth */
sl@0
    45
      USCRIPT_GREEK        = 14,  /* Grek */
sl@0
    46
      USCRIPT_GUJARATI     = 15,  /* Gujr */
sl@0
    47
      USCRIPT_GURMUKHI     = 16,  /* Guru */
sl@0
    48
      USCRIPT_HAN          = 17,  /* Hani */
sl@0
    49
      USCRIPT_HANGUL       = 18,  /* Hang */
sl@0
    50
      USCRIPT_HEBREW       = 19,  /* Hebr */
sl@0
    51
      USCRIPT_HIRAGANA     = 20,  /* Hira */
sl@0
    52
      USCRIPT_KANNADA      = 21,  /* Knda */
sl@0
    53
      USCRIPT_KATAKANA     = 22,  /* Kana */
sl@0
    54
      USCRIPT_KHMER        = 23,  /* Khmr */
sl@0
    55
      USCRIPT_LAO          = 24,  /* Laoo */
sl@0
    56
      USCRIPT_LATIN        = 25,  /* Latn (Latf, Latg) */
sl@0
    57
      USCRIPT_MALAYALAM    = 26,  /* Mlym */
sl@0
    58
      USCRIPT_MONGOLIAN    = 27,  /* Mong */
sl@0
    59
      USCRIPT_MYANMAR      = 28,  /* Mymr */
sl@0
    60
      USCRIPT_OGHAM        = 29,  /* Ogam */
sl@0
    61
      USCRIPT_OLD_ITALIC   = 30,  /* Ital */
sl@0
    62
      USCRIPT_ORIYA        = 31,  /* Orya */
sl@0
    63
      USCRIPT_RUNIC        = 32,  /* Runr */
sl@0
    64
      USCRIPT_SINHALA      = 33,  /* Sinh */
sl@0
    65
      USCRIPT_SYRIAC       = 34,  /* Syrc (Syrj, Syrn, Syre) */
sl@0
    66
      USCRIPT_TAMIL        = 35,  /* Taml */
sl@0
    67
      USCRIPT_TELUGU       = 36,  /* Telu */
sl@0
    68
      USCRIPT_THAANA       = 37,  /* Thaa */
sl@0
    69
      USCRIPT_THAI         = 38,  /* Thai */
sl@0
    70
      USCRIPT_TIBETAN      = 39,  /* Tibt */
sl@0
    71
      /** Canadian_Aboriginal script. @stable ICU 2.6 */
sl@0
    72
      USCRIPT_CANADIAN_ABORIGINAL = 40,  /* Cans */
sl@0
    73
      /** Canadian_Aboriginal script (alias). @stable ICU 2.2 */
sl@0
    74
      USCRIPT_UCAS         = USCRIPT_CANADIAN_ABORIGINAL,
sl@0
    75
      USCRIPT_YI           = 41,  /* Yiii */
sl@0
    76
      USCRIPT_TAGALOG      = 42,  /* Tglg */
sl@0
    77
      USCRIPT_HANUNOO      = 43,  /* Hano */
sl@0
    78
      USCRIPT_BUHID        = 44,  /* Buhd */
sl@0
    79
      USCRIPT_TAGBANWA     = 45,  /* Tagb */
sl@0
    80
sl@0
    81
      /* New scripts in Unicode 4 @stable ICU 2.6 */
sl@0
    82
      USCRIPT_BRAILLE,            /* Brai */
sl@0
    83
      USCRIPT_CYPRIOT,            /* Cprt */
sl@0
    84
      USCRIPT_LIMBU,              /* Limb */
sl@0
    85
      USCRIPT_LINEAR_B,           /* Linb */
sl@0
    86
      USCRIPT_OSMANYA,            /* Osma */
sl@0
    87
      USCRIPT_SHAVIAN,            /* Shaw */
sl@0
    88
      USCRIPT_TAI_LE,             /* Tale */
sl@0
    89
      USCRIPT_UGARITIC,           /* Ugar */
sl@0
    90
sl@0
    91
      /** New script code in Unicode 4.0.1 @draft ICU 3.0 */
sl@0
    92
      USCRIPT_KATAKANA_OR_HIRAGANA,/*Hrkt */
sl@0
    93
sl@0
    94
      /* New scripts in Unicode 4.1 @draft ICU 3.4 */
sl@0
    95
      USCRIPT_BUGINESE,           /* Bugi */
sl@0
    96
      USCRIPT_GLAGOLITIC,         /* Glag */
sl@0
    97
      USCRIPT_KHAROSHTHI,         /* Khar */
sl@0
    98
      USCRIPT_SYLOTI_NAGRI,       /* Sylo */
sl@0
    99
      USCRIPT_NEW_TAI_LUE,        /* Talu */
sl@0
   100
      USCRIPT_TIFINAGH,           /* Tfng */
sl@0
   101
      USCRIPT_OLD_PERSIAN,        /* Xpeo */
sl@0
   102
sl@0
   103
      USCRIPT_CODE_LIMIT
sl@0
   104
} UScriptCode;
sl@0
   105
sl@0
   106
/**
sl@0
   107
 * Gets script codes associated with the given locale or ISO 15924 abbreviation or name. 
sl@0
   108
 * Fills in USCRIPT_MALAYALAM given "Malayam" OR "Mlym".
sl@0
   109
 * Fills in USCRIPT_LATIN given "en" OR "en_US" 
sl@0
   110
 * If required capacity is greater than capacity of the destination buffer then the error code
sl@0
   111
 * is set to U_BUFFER_OVERFLOW_ERROR and the required capacity is returned
sl@0
   112
 *
sl@0
   113
 * <p>Note: To search by short or long script alias only, use
sl@0
   114
 * u_getPropertyValueEnum(UCHAR_SCRIPT, alias) instead.  This does
sl@0
   115
 * a fast lookup with no access of the locale data.
sl@0
   116
 * @param nameOrAbbrOrLocale name of the script, as given in
sl@0
   117
 * PropertyValueAliases.txt, or ISO 15924 code or locale
sl@0
   118
 * @param fillIn the UScriptCode buffer to fill in the script code
sl@0
   119
 * @param capacity the capacity (size) fo UScriptCode buffer passed in.
sl@0
   120
 * @param err the error status code.
sl@0
   121
 * @return The number of script codes filled in the buffer passed in 
sl@0
   122
 * @stable ICU 2.4
sl@0
   123
 */
sl@0
   124
U_STABLE int32_t  U_EXPORT2 
sl@0
   125
uscript_getCode(const char* nameOrAbbrOrLocale,UScriptCode* fillIn,int32_t capacity,UErrorCode *err);
sl@0
   126
sl@0
   127
/**
sl@0
   128
 * Gets a script name associated with the given script code. 
sl@0
   129
 * Returns  "Malayam" given USCRIPT_MALAYALAM
sl@0
   130
 * @param scriptCode UScriptCode enum
sl@0
   131
 * @return script long name as given in
sl@0
   132
 * PropertyValueAliases.txt, or NULL if scriptCode is invalid
sl@0
   133
 * @stable ICU 2.4
sl@0
   134
 */
sl@0
   135
U_STABLE const char*  U_EXPORT2 
sl@0
   136
uscript_getName(UScriptCode scriptCode);
sl@0
   137
sl@0
   138
/**
sl@0
   139
 * Gets a script name associated with the given script code. 
sl@0
   140
 * Returns  "Mlym" given USCRIPT_MALAYALAM
sl@0
   141
 * @param scriptCode UScriptCode enum
sl@0
   142
 * @return script abbreviated name as given in
sl@0
   143
 * PropertyValueAliases.txt, or NULL if scriptCode is invalid
sl@0
   144
 * @stable ICU 2.4
sl@0
   145
 */
sl@0
   146
U_STABLE const char*  U_EXPORT2 
sl@0
   147
uscript_getShortName(UScriptCode scriptCode);
sl@0
   148
sl@0
   149
/** 
sl@0
   150
 * Gets the script code associated with the given codepoint.
sl@0
   151
 * Returns USCRIPT_MALAYALAM given 0x0D02 
sl@0
   152
 * @param codepoint UChar32 codepoint
sl@0
   153
 * @param err the error status code.
sl@0
   154
 * @return The UScriptCode, or 0 if codepoint is invalid 
sl@0
   155
 * @stable ICU 2.4
sl@0
   156
 */
sl@0
   157
U_STABLE UScriptCode  U_EXPORT2 
sl@0
   158
uscript_getScript(UChar32 codepoint, UErrorCode *err);
sl@0
   159
sl@0
   160
#endif
sl@0
   161
sl@0
   162