/*******************************************************************************
;*******************************************************************************
;**                                                                           **
;**                    COPYRIGHT 2008-2011 NUANCE COMMUNICATIONS              **
;**                                                                           **
;**               NUANCE COMMUNICATIONS PROPRIETARY INFORMATION               **
;**                                                                           **
;**     This software is supplied under the terms of a license agreement      **
;**     or non-disclosure agreement with Nuance Communications and may not     **
;**     be copied or disclosed except in accordance with the terms of that    **
;**     agreement.                                                            **
;**                                                                           **
;**                                                                           **
;*******************************************************************************
;**                                                                           **
;**     FileName: et9kjamo.h                                                  **
;**                                                                           **
;**  Description: Korean XT9 Jamo-Hangul module. header file.                 **
;**               Conforming to the development version of Korean XT9.        **
;**                                                                           **
;*******************************************************************************
;******************************************************************************/

#ifndef ET9KJAMO_H
#define ET9KJAMO_H 1

/* don't mangle the function name if compile under C++ */
#if defined(__cplusplus)
extern "C" {
#endif

#define ET9K_HANGUL_UNI_MIN    ((ET9SYMB)0xAC00)
#define ET9K_HANGUL_UNI_MAX    ((ET9SYMB)0xD7A3)

#define ET9K_INITIAL_UNI_MIN   ((ET9SYMB)0x1100)
#define ET9K_INITIAL_UNI_MAX   ((ET9SYMB)0x1112)
#define ET9K_INITIAL_COUNT     ((ET9U16)19)

#define ET9K_MEDIAL_UNI_MIN    ((ET9SYMB)0x1161)
#define ET9K_MEDIAL_UNI_MAX    ((ET9SYMB)0x1175)
#define ET9K_MEDIAL_COUNT      ((ET9U16)21)

#define ET9K_FINAL_UNI_MIN     ((ET9SYMB)0x11A7)  /* 0x11A7 is the Final "No Final" --- artificial dummy unicode */
#define ET9K_FINAL_UNI_MAX     ((ET9SYMB)0x11C2)
#define ET9K_FINAL_COUNT       ((ET9U16)28)

#define ET9K_CHUNJIIN_UNI_HLINE    ((ET9SYMB)0x1173)
#define ET9K_CHUNJIIN_UNI_VLINE    ((ET9SYMB)0x1175)
#define ET9K_CHUNJIIN_UNI_DOT      ((ET9SYMB)0x119E)   /* single-dot: Chun-ji-in symbol outside the Medial set but may be combined with other Medial symbols */
#define ET9K_CHUNJIIN_UNI_DOTDOT   ((ET9SYMB)0x11A2)   /* double-dot: Chun-ji-in symbol outside the Medial set but may be combined with other Medial symbols */

#define ET9K_MEDIAL_X_FINAL_COUNT   ((ET9U16)588)     /* ET9K_MEDIAL_COUNT * ET9K_FINAL_COUNT = 588 */
#define ET9K_HANGUL_COUNT           ((ET9U16)11172)   /* ET9K_INITIAL_COUNT * ET9K_MEDIAL_COUNT  * ET9K_FINAL_COUNT = 11172 */

#define ET9K_COMPJAMO_UNI_MIN       ((ET9SYMB)0x3131)
#define ET9K_COMPJAMO_UNI_MAX       ((ET9SYMB)0x318E)


#define ET9K_IS_LOWER_JAMO( c )   ( (c) >= 0x1100 && (c) <= 0x11FF )
#define ET9K_IS_UPPER_JAMO( c )   ( (c) >= 0xE100 && (c) <= 0xE1FF )

#define ET9K_TO_UPPER_JAMO( c )   ( ((c) >= 0x1100 && (c) <= 0x11FF)? ((c) ^ 0xF000): (c) )
#define ET9K_TO_LOWER_JAMO( c )   ( ((c) >= 0xE100 && (c) <= 0xE1FF)? ((c) ^ 0xF000): (c) )

/*  -IDR-    
                                                                                                                             */
typedef struct JamoMap_s
{
    ET9SYMB sJamo1;
    ET9SYMB sJamo2;
    ET9SYMB sJamoCombo;
} JamoMap;

/*  -IDR-    
                                                                                     */
typedef struct JamoDemap_s
{
    ET9SYMB sJamo1;
    ET9SYMB sJamo2;
} JamoDemap;

/*  -IDR-    
                                                     */
typedef struct JamoIMF_s
{                        
    ET9SYMB initial;
    ET9SYMB medial;
    ET9SYMB final;
    ET9U8 initialSymbCount;
    ET9U8 medialSymbCount;
    ET9U8 finalSymbCount;
    ET9BOOL bIsMultiSymbMedial;
} JamoIMF;


ET9STATUS ET9FARCALL ET9_K_Jamo2Hangul(const ET9SYMB * pJamoStr, ET9U16 wJamoStrLen, const ET9U8 * pbJamoType, ET9KHangulWord * pHangul);
ET9STATUS ET9FARCALL ET9_K_Hangul2Jamo(const ET9SYMB * pHangulStr, ET9U16 wHangulStrLen, ET9SimpleWord * pJamo, ET9BOOL bLeadingUpper);

/* End don't mangle the function name if compile under C++ */
#if defined(__cplusplus)
    }
#endif

#endif  /* #ifndef ET9KJAMO_H */

/* ----------------------------------< eof >--------------------------------- */
