inputmethods_pub/ptiengine_iti_api/inc/PtiDefs.h
changeset 0 eb1f2e154e89
child 9 e6a39382bb9c
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:               Global PtiEngine definitions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 
       
    31 #ifndef _PTI_DEFS_H
       
    32 #define _PTI_DEFS_H
       
    33 
       
    34 #include <e32keys.h>
       
    35 
       
    36 #ifdef RD_HINDI_PHONETIC_INPUT
       
    37 /* Indic Phonetic input */
       
    38 
       
    39 /*
       
    40 * Defines the state of the syllable. This is used by FEP for either committing 
       
    41 * the inline text or updating the inline text.
       
    42 */
       
    43 
       
    44 enum TSyllableState
       
    45 {
       
    46     EIndicSyllableStateFirst,
       
    47     EIndicSyllableStateInsideSyllable,
       
    48     EIndicSyllableStateSyllableBroken,
       
    49     EIndicSyllableStateLast
       
    50 };
       
    51 
       
    52 
       
    53 /*
       
    54 * This is a structure that abstracts the phonetic argument and the response
       
    55 * from the Indic phonetic core in a structure.
       
    56 */
       
    57 
       
    58 typedef struct
       
    59 {
       
    60     TChar iChar;
       
    61     TDes *iDest;
       
    62     TSyllableState iState;
       
    63 }TPhoneticArg;
       
    64 
       
    65 #endif
       
    66 const TInt KMaxLanguageNameLength = 50;
       
    67 const TInt KMaxAutoSubstStringLength = 32;
       
    68 
       
    69 const TInt KErrPtiEngineBase = (-1000); //based on the value of leave in PtiEngine
       
    70 
       
    71 
       
    72 enum TPtiError
       
    73     {
       
    74     KErrNoActiveLanguage = KErrPtiEngineBase-1,   
       
    75     KErrLanguageNotFound = KErrPtiEngineBase-2,
       
    76     KErrNoSuitableCore = KErrPtiEngineBase-3,
       
    77     KErrNotAllowed = KErrPtiEngineBase-4,
       
    78     KErrTooLongWord = KErrPtiEngineBase-5,
       
    79     KErrInvalidWord = KErrPtiEngineBase-6,
       
    80     KErrTooLongReading = KErrPtiEngineBase-7,
       
    81     KErrInvalidReading = KErrPtiEngineBase-8,
       
    82     KErrUserDic = KErrPtiEngineBase-9,
       
    83     KErrInternalCoreError = KErrPtiEngineBase-10,
       
    84     KErrLengthMismatch = KErrPtiEngineBase-11
       
    85     };
       
    86 
       
    87 
       
    88 /**
       
    89 * Enumerations for all the possible input modes supported by PtiEngine. 
       
    90 * The modes actually available in the device depend on core object, resource 
       
    91 * and keyboard configuration.
       
    92 * Here are short descriptions:
       
    93 *
       
    94 * EPtiEngineMultitapping 
       
    95 *        Traditional text input method for latin-like languages, where 
       
    96 *        a list of characters is associated to each keypad keys
       
    97 *        and user cycles through associated characters by consecutive key presses.
       
    98 *
       
    99 * EPtiEnginePredictive 
       
   100 *        Predictive text input mode, where user presses only one key press per
       
   101 *        character and the prediction engine provides a list of candidate words
       
   102 *        associated top that key sequence.
       
   103 * 
       
   104 * EPtiEngineWordCompletion
       
   105 *        This is same as EPtiEnginePredictive, except that prediction engine
       
   106 *        will include also complete words containing more characters than
       
   107 *        the number of key presses in current key sequence.
       
   108 *
       
   109 * EPtiEngineNumeric 
       
   110 *        This is numeric input mode. All the languages suppor it, since it uses
       
   111 *        static keymappings built directly into PtiEngine. It works in same way
       
   112 *        as EPtiEngineMultitapping, except that keymapping data contains
       
   113 *        only number mode characters. 
       
   114 *
       
   115 * EPtiEngineQwerty
       
   116 *        Standard qwerty-keyboard input mode for latin-like languages.
       
   117 *
       
   118 * EPtiEnginePinyin
       
   119 *        Chinese PinYin input mode for ITU-T keypad.
       
   120 *
       
   121 * EPtiEngineStroke
       
   122 *        Chinese Strokes input mode for ITU-T keypad.       
       
   123 *
       
   124 * EPtiEngineStroke
       
   125 *        Chinese ZhuYin input mode for ITU-T keypad.       
       
   126 *
       
   127 * EPtiEngineHirakanaKanji
       
   128 *        Japanese Hiragana/Kanji input mode.       
       
   129 *
       
   130 * EPtiEngineHirakanaKanjiPredictive
       
   131 *        Predictive Japanese Hiragana/Kanji input mode.       
       
   132 *
       
   133 * EPtiEngineKatakana
       
   134 *        Japanese Katakana input mode.   
       
   135 *
       
   136 * EPtiEngineFullWitdthKatakana
       
   137 *        Japanese full width Katakana input mode. 
       
   138 *
       
   139 * EPtiEngineFullWitdthKatakana
       
   140 *        Japanese full width numeric input mode. 
       
   141 *
       
   142 * EPtiEngineFullWitdthAlphabet
       
   143 *        Japanese full width alphabet input mode. 
       
   144 *
       
   145 * EPtiEngineHiragana
       
   146 *        Japanese Hiragana input mode. 
       
   147 *
       
   148 * EPtiEnginePinyinByPhrase
       
   149 *        Chinese Pinyin phrase input. This is same as EPtiEnginePinyin, execpt that
       
   150 *        input string may contain pinyin words for several chinese characters.
       
   151 *
       
   152 * EPtiEngineZhuyinByPhrase
       
   153 *        Chinese Zinyin phrase input. This is same as EPtiEngineZhuyin, execpt that
       
   154 *        input string may contain zhuyin sequences for several chinese characters.
       
   155 *
       
   156 * EPtiEngineZhuyinQwerty
       
   157 *        Chinese Zhuyin input for qwerty keyboard.
       
   158 *
       
   159 * EPtiEngineZhuyinPhraseQwerty
       
   160 *        Chinese Zinyin phrase input for qwerty keyboard. This is same as EPtiEngineZhuyinQwerty,
       
   161 *        execpt that input string may contain zhuyin sequences for several chinese characters.
       
   162 *
       
   163 * EPtiEnginePinyinQwerty
       
   164 *        Chinese Pinyin input for qwerty keyboard.
       
   165 *
       
   166 * PtiEnginePinyinPhraseQwerty
       
   167 *        Same as EPtiEnginePinyinByPhrase but for qwerty keyboard
       
   168 *
       
   169 * EPtiEngineStrokeQwerty
       
   170 *        Same as EPtiEngineStroke but for qwerty keyboard
       
   171 *
       
   172 * EPtiEngineNormalCangjieQwerty
       
   173 *        Normal Chinese CangJie input for qwerty keyboard
       
   174 *        (CangJie is available only for qwerty).
       
   175 *
       
   176 * EPtiEngineEasyCangjieQwerty
       
   177 *        Easy Chinese CangJie input for qwerty keyboard
       
   178 *        (CangJie is available only for qwerty).
       
   179 *
       
   180 * EPtiEngineAdvCangjieQwerty       
       
   181 *        Advanced Chinese CangJie input for qwerty keyboard
       
   182 *        (CangJie is available only for qwerty).
       
   183 *
       
   184 * EPtiEngineHiraganaKanjiQwerty
       
   185 *       Japanese Hiragana/Kanji input for qwerty keyboard.
       
   186 *
       
   187 * EPtiEngineHiraganaKanjiPredictiveQwerty  
       
   188 *       Japanese predictive Hiragana/Kanji input for qwerty keyboard
       
   189 *
       
   190 * EPtiEngineKatakanaQwerty            
       
   191 *       Japanese Half-width Katakana input for qwerty keyboard.
       
   192 *
       
   193 * EPtiEngineFullWidthKatakanaQwerty  
       
   194 *       Japanese Full-width Katakana input for qwerty keyboard.
       
   195 *
       
   196 * EPtiEngineFullWidthNumericQwerty
       
   197 *       Japanese Full-width Alphabet input for qwerty keyboard.
       
   198 *
       
   199 * EPtiEngineFullWidthAlphabetQwerty
       
   200 *       Japanese Full-width Alphabet input for qwerty keyboard.
       
   201 *        
       
   202 * EPtiEngineHiraganaQwerty          
       
   203 *       Japanese Hiragana input for qwerty keyboard. 
       
   204 *
       
   205 * EPtiEngineStrokeByPhrase,             // Stroke phrase input.
       
   206 *       Chinese Stroke input for ITU-T keypad. Phrasal version.
       
   207 *
       
   208 * EPtiEngineStrokePhraseQwerty
       
   209 *       Chinese Stroke input for qwerty keyboard. Phrasal version.
       
   210 *
       
   211 * EPtiEngineQwertyPredictive,           // "Sloppy type" input for qwerty keyboard.
       
   212 *       Intelligent qwerty input. Used for word completion and spell
       
   213 *       correction features for qwerty keyboard.
       
   214 *
       
   215 * EPtiEngineHalfQwerty
       
   216 *       Basic multitaping style text input for half-qwerty keyboard. The functionality
       
   217 *       of half-qwerty keyboard is same as conventional itu-t phone keypad, except that
       
   218 *       each key is associated with two basic characters (instead of three or four
       
   219 *       as in itu-t keypad). Character mapping is also organized to follow qwerty
       
   220 *       layout (instead of alphabetical order as in itu-t keypad).
       
   221 * 
       
   222 * EPtiEngineHalfQwertyPredictive,
       
   223 *       Predictive text input for half-qwerty keyboard. The functionality
       
   224 *       of half-qwerty keyboard is same as conventional itu-t phone keypad, except that
       
   225 *       each key is associated with two basic characters(instead of three or four
       
   226 *       as in itu-t keypad). . Character mapping is also organized to follow qwerty
       
   227 *       layout (instead of alphabetical order as in itu-t keypad). This input mode 
       
   228 *       is essentially same as EPtiEngineWordCompletion but uses half-qwerty keyboard. 
       
   229 *
       
   230 * EPtiEngineInputModeIndicPhoneticMultitap
       
   231 *       Hindi phonetic input for itu-t keypad.
       
   232 *
       
   233 * EPtiEngineInputModeIndicPhoneticQwerty
       
   234 *       Hindi phonetic input for qwerty keyboard.
       
   235 *
       
   236 * EPtiEngineInputModeZhuyinMiniQwertyFind
       
   237 *       Zhuyin multitap input method for mini qwerty symbol find.
       
   238 *
       
   239 */
       
   240 enum TPtiEngineInputMode
       
   241     {
       
   242     EPtiEngineInputModeNone = 0,
       
   243     EPtiEngineMultitapping,             // Basic multitapping input for latin languages.
       
   244     EPtiEnginePredictive,               // Predictive input for latin languages.
       
   245     EPtiEngineWordCompletion,           // Predictive input with word completion for latin languages.
       
   246     EPtiEngineNumeric,                  // Latin numeric input mode.  
       
   247     EPtiEngineQwerty,                   // Basic qwerty input mode.
       
   248     EPtiEnginePinyin,                   // Chinese pinyin mode.        
       
   249     EPtiEngineStroke,                   // Chinese stroke mode.
       
   250     EPtiEngineZhuyin,                   // Chinese zhuyin mode. 
       
   251     EPtiEngineHiraganaKanji,            // Hiragana/Kanji mode.
       
   252     EPtiEngineHiraganaKanjiPredictive,  // Predictive Hiragana/Kanji mode.
       
   253     EPtiEngineKatakana,                 // Half-width Katakana mode. 
       
   254     EPtiEngineFullWidthKatakana,        // Full-width Katakana mode.
       
   255     EPtiEngineFullWidthNumeric,         // Full-width Alphabet mode (for Japanese input).
       
   256     EPtiEngineFullWidthAlphabet,        // Full-width Alphabet mode (for Japanese input).
       
   257     EPtiEngineHiragana,                 // Hiragana only mode. 
       
   258     EPtiEnginePinyinByPhrase,           // Pinyin phrase input.         
       
   259     EPtiEngineZhuyinByPhrase,           // Zhuyin phrase input.
       
   260     EPtiEngineZhuyinQwerty,             // Zhuyin qwerty input. 
       
   261     EPtiEngineZhuyinPhraseQwerty,       // Zhuyin phrase qwerty input. 
       
   262     EPtiEnginePinyinQwerty,             // Pinyin qwerty input.
       
   263     EPtiEnginePinyinPhraseQwerty,       // Pinyin phrase qwerty input. 
       
   264     EPtiEngineStrokeQwerty,             // Stroke qwerty input.
       
   265     EPtiEngineNormalCangjieQwerty,      // Normal Cangjie qwerty input
       
   266     EPtiEngineEasyCangjieQwerty,        // Easy Cangjie qwerty input
       
   267     EPtiEngineAdvCangjieQwerty,         // Advanced Cangjie qwerty input
       
   268     EPtiEngineHiraganaKanjiQwerty,      // Hiragana/Kanji qwerty input mode.
       
   269     EPtiEngineHiraganaKanjiPredictiveQwerty,  // Predictive Hiragana/Kanji qwerty input mode.
       
   270     EPtiEngineKatakanaQwerty,           // Half-width Katakana qwerty input mode. 
       
   271     EPtiEngineFullWidthKatakanaQwerty,  // Full-width Katakana qwerty input mode.
       
   272     EPtiEngineFullWidthNumericQwerty,   // Full-width Alphabet qwerty input mode (for Japanese input).
       
   273     EPtiEngineFullWidthAlphabetQwerty,  // Full-width Alphabet qwerty input mode (for Japanese input).
       
   274     EPtiEngineHiraganaQwerty,           // Hiragana only qwerty input mode.   
       
   275     EPtiEnginePinyinVkb,                  // Chinese pinyin mode.        
       
   276     EPtiEngineStrokeVkb,                  // Chinese stroke mode.
       
   277     EPtiEngineZhuyinVkb,                  // Chinese zhuyin mode. 
       
   278 	  EPtiEngineStrokeByPhrase,             // Stroke phrase input.
       
   279     EPtiEngineStrokePhraseQwerty,         // Stroke phrase qwerty input.
       
   280     EPtiEngineHiraganaKanjiVkb,           // Hiragana/Kanji mode for VKB.
       
   281     EPtiEngineHiraganaKanjiPredictiveVkb, // Predictive Hiragana/Kanji mode for VKB.
       
   282     EPtiEngineHiraganaKanjiHwr,           // Hiragana/Kanji mode for HWR.
       
   283     EPtiEngineHiraganaKanjiPredictiveHwr, // Predictive Hiragana/Kanji mode for HWR.
       
   284     EPtiEngineKatakanaVkb,                // Half-width Katakana mode for VKB.
       
   285     EPtiEngineFullWidthKatakanaVkb,       // Full-width Katakana mode for VKB.
       
   286     EPtiEngineHiraganaVkb,                // Hiragana only qwerty input mode for VKB.
       
   287     EPtiEngineNormalCangjieVkb,  
       
   288     EPtiEngineEasyCangjieVkb,    
       
   289     EPtiEngineAdvCangjieVkb,     
       
   290     EPtiEngineInputModeIndicPhoneticMultitap,
       
   291     EPtiEngineInputModeIndicPhoneticQwerty,
       
   292     EPtiEngineHiraganaKanjiVkbRomaji,           // Hiragana/Kanji mode for VKB/FSQ Romaji input.
       
   293     EPtiEngineHiraganaKanjiPredictiveVkbRomaji, // Predictive Hiragana/Kanji mode for VKB/FSQ Romaji input.
       
   294     EPtiEngineQwertyPredictive,           // "Sloppy type" input for qwerty keyboard.
       
   295     EPtiEngineHalfQwerty,
       
   296     EPtiEngineHalfQwertyPredictive,
       
   297     EPtiEngineInputModeQwertyPredictive ,
       
   298 	EPtiEngineInputModeZhuyinMiniQwertyFind,
       
   299     EPtiEnginePinyinPhraseHalfQwerty,
       
   300     EPtiEngineStrokePhraseHalfQwerty,
       
   301     EPtiEngineZhuyinPhraseHalfQwerty,
       
   302     EPtiEngineMultitappingKorean,       // Basic multitapping input for korean language.
       
   303     EPtiEngineQwertyKorean,    
       
   304     EPtiEngineMaxInputModes = EPtiEngineQwertyKorean  
       
   305     };
       
   306 
       
   307 
       
   308 /*
       
   309 * Predictive qwerty error correction levels. 
       
   310 */
       
   311 enum TPtiErrorCorrectionLevel
       
   312     {
       
   313     EPtiErrorCorrectionLevelOff  = 0,
       
   314     EPtiErrorCorrectionLevelLow  = 1,
       
   315     EPtiErrorCorrectionLevelHigh = 2
       
   316     };
       
   317 
       
   318 
       
   319 /**
       
   320 * Key enumerations for conventional (ITU-T) and qwerty keyboards.
       
   321 * Constant names for qwerty keypad keys are named after scan code
       
   322 * values of a device using English language keymappings. The
       
   323 * actual character that will be inserted into editor buffer depends on
       
   324 * keymappings of currently selected input language and may be something else
       
   325 * than what enum name suggests. For example
       
   326 * non-shifted EPtiKeyQwertyHash produces '#'-character if input language is
       
   327 * English, but will produce '+'-character if
       
   328 * input language is Danish, Norwegian, Swedish or Finnish.
       
   329 * The key coordinates on standard 4x12 qwerty keypad are given in
       
   330 * comments.
       
   331 */
       
   332 enum TPtiKey
       
   333     {
       
   334     EPtiKeyNone = 0,
       
   335     
       
   336     EPtiKey1    = '1',
       
   337     EPtiKey2    = '2',
       
   338     EPtiKey3    = '3',
       
   339     EPtiKey4    = '4',
       
   340     EPtiKey5    = '5',
       
   341     EPtiKey6    = '6',
       
   342     EPtiKey7    = '7',
       
   343     EPtiKey8    = '8',
       
   344     EPtiKey9    = '9',
       
   345     EPtiKeyStar = '*',
       
   346     EPtiKey0    = '0',
       
   347     EPtiKeyHash = '#',
       
   348 
       
   349     // alternate names
       
   350     EPtiKeyPunct = EPtiKey1,
       
   351     EPtiKeyABC   = EPtiKey2,
       
   352     EPtiKeyDEF   = EPtiKey3,
       
   353     EPtiKeyGHI   = EPtiKey4,
       
   354     EPtiKeyJKL   = EPtiKey5,
       
   355     EPtiKeyMNO   = EPtiKey6,
       
   356     EPtiKeyPQRS  = EPtiKey7,
       
   357     EPtiKeyTUV   = EPtiKey8,
       
   358     EPtiKeyWXYZ  = EPtiKey9,
       
   359 
       
   360     // qwerty keys
       
   361     EPtiKeyQwerty1     = 0x31,   
       
   362     EPtiKeyQwerty2     = 0x32,   
       
   363     EPtiKeyQwerty3     = 0x33,   
       
   364     EPtiKeyQwerty4     = 0x34,   
       
   365     EPtiKeyQwerty5     = 0x35,   
       
   366     EPtiKeyQwerty6     = 0x36,   
       
   367     EPtiKeyQwerty7     = 0x37,   
       
   368     EPtiKeyQwerty8     = 0x38,   
       
   369     EPtiKeyQwerty9     = 0x39,   
       
   370     EPtiKeyQwerty0     = 0x30,   
       
   371 
       
   372     EPtiKeyQwertyPlus        = 0x2b,                    
       
   373     EPtiKeyQwertyMinus       = EStdKeyMinus,            
       
   374     EPtiKeyQwertyComma       = EStdKeyComma,            
       
   375     EPtiKeyQwertySemicolon   = EStdKeySemiColon,        
       
   376     EPtiKeyQwertyFullstop    = EStdKeyFullStop,         
       
   377     EPtiKeyQwertyHash        = EStdKeyHash,             
       
   378     EPtiKeyQwertySlash       = EStdKeyForwardSlash,     
       
   379     EPtiKeyQwertyApostrophe  = EStdKeySingleQuote,      
       
   380     EPtiKeyQwertySpace       = EStdKeySpace,  
       
   381     EPtiKeyQwertyAtCharacter = EStdKeySquareBracketRight,
       
   382     EPtiKeyQwertyLeftShift   = EStdKeyLeftShift,           // Needed only for special cases.
       
   383 
       
   384     EPtiKeyQwertyA = 0x41,     
       
   385     EPtiKeyQwertyB = 0x42,     
       
   386     EPtiKeyQwertyC = 0x43,     
       
   387     EPtiKeyQwertyD = 0x44,     
       
   388     EPtiKeyQwertyE = 0x45,     
       
   389     EPtiKeyQwertyF = 0x46,     
       
   390     EPtiKeyQwertyG = 0x47,     
       
   391     EPtiKeyQwertyH = 0x48,     
       
   392     EPtiKeyQwertyI = 0x49,      
       
   393     EPtiKeyQwertyJ = 0x4a,      
       
   394     EPtiKeyQwertyK = 0x4b,      
       
   395     EPtiKeyQwertyL = 0x4c,     
       
   396     EPtiKeyQwertyM = 0x4d,     
       
   397     EPtiKeyQwertyN = 0x4e,     
       
   398     EPtiKeyQwertyO = 0x4f,      
       
   399     EPtiKeyQwertyP = 0x50,     
       
   400     EPtiKeyQwertyQ = 0x51,      
       
   401     EPtiKeyQwertyR = 0x52,     
       
   402     EPtiKeyQwertyS = 0x53,     
       
   403     EPtiKeyQwertyT = 0x54,      
       
   404     EPtiKeyQwertyU = 0x55,     
       
   405     EPtiKeyQwertyV = 0x56,     
       
   406     EPtiKeyQwertyW = 0x57,     
       
   407     EPtiKeyQwertyX = 0x58,       
       
   408     EPtiKeyQwertyY = 0x59,     
       
   409     EPtiKeyQwertyZ = 0x5a      
       
   410     
       
   411     // ----> Half Qwerty
       
   412     , EPtiKeyQwertyChr = EStdKeyLeftFunc 	// key (4, 4) 
       
   413     // Half Qwerty <----
       
   414     };
       
   415 
       
   416 
       
   417 
       
   418 /**
       
   419 * Enumerations for PtiCore capabilities. These can be queries through
       
   420 * MPtiCoreInfo::CapsBits(). 
       
   421 * Here are descriptions:
       
   422 *
       
   423 * EWordCompletion
       
   424 *      The core object supports word completion -feature.
       
   425 *
       
   426 * EReordering
       
   427 *      The core object supports user dictionary reordering. This feature means that
       
   428 *      most commonly used words are moved up in prediction candidate
       
   429 *      list.
       
   430 *
       
   431 * ENextWordPrediction
       
   432 *      The core supports next word prediction feature. When this feature is
       
   433 *      enabled, prediction engine tries to guess next word based on previous word(s).
       
   434 *
       
   435 * ESupportUserDictionaries
       
   436 *      The core supports supports user dictionaries. 
       
   437 *
       
   438 * ESupportSCTToneMarks
       
   439 *        
       
   440 * ESupportCangjieInput 
       
   441 *      The core object supports Chinese CangJie input.
       
   442 *
       
   443 * ESupportDualLanguage
       
   444 *      The core object supports dual language preditcion.
       
   445 * 
       
   446 * ESupportAutoSubstitution
       
   447 *      The core object supports auto-substitution feature. This feature
       
   448 *      automatically expands predefined string to longer string.
       
   449 *      ie. "l8r" -> "later"
       
   450 */
       
   451 enum TPtiEngineCapsBits
       
   452     {
       
   453     EWordCompletion          = 0x01,
       
   454     EReordering              = 0x02,
       
   455     ENextWordPrediction      = 0x04,
       
   456     ESupportUserDictionaries = 0x08,
       
   457     ESupportSCTToneMarks     = 0x10,
       
   458     ESupportCangjieInput     = 0x20,
       
   459     EPreferedSpelling        = 0x40,
       
   460     ESupportDualLanguage     = 0x80,
       
   461     ESupportAutoSubstitution = 0x100
       
   462     };
       
   463 
       
   464 
       
   465 /**
       
   466 * Text case defintions.
       
   467 */
       
   468 enum TPtiTextCase
       
   469     {
       
   470     EPtiCaseLower = 0,    // Normal lower case input
       
   471     EPtiCaseUpper,        // Normal upper case input.
       
   472     EPtiCaseChrLower,     // Qwerty chr-key lower case input.
       
   473     EPtiCaseChrUpper,     // Qwerty chr-key upper case input.
       
   474     EPtiCaseFnLower,      // Qwerty fn-key lower case input.    
       
   475     EPtiCaseFnUpper,       // Qwerty fn-key upper case input.
       
   476     EPtiCaseMax
       
   477     };
       
   478 
       
   479 
       
   480 enum TPtiCharConversion
       
   481     {
       
   482     EPtiSimplifiedToComplex = 0x01,  // Chinese simplified to Chinese complex
       
   483     EPtiUcs2ToUtf8 = 0x02,           // Unicode to utf8
       
   484     EPtiUcs2ToBig5 = 0x04,           // Unicode to big5
       
   485     EPtiUcs2ToGB = 0x08,             // Unicode to Guo-Biao 
       
   486     EPtiUtf8ToUcs2 = 0x10,           // Utf8 to Unicode
       
   487     EPtiKo2ToWc = 0x20,              // KSC5601 to Hangul Syllable
       
   488     EPtiWcToKo2 = 0x30,              // Hangul Syllable to KSC5601
       
   489     EPtiBig5ToUcs2 = 0x40,           // Big5 to Unicode
       
   490     EPtiComplexToSimplified = 0x80   // Chinese complex to Chinese simplified
       
   491     };
       
   492 
       
   493 /**
       
   494 * Enumerates supported spelling types for CPtiEngine::GetSpelling method.
       
   495 */
       
   496 enum TPtiSpelling   
       
   497     {
       
   498     EPtiStrokes  = 0x01,
       
   499     EPtiPinyin   = 0x02,
       
   500     EPtiBopomofo = 0x04,
       
   501     EPtiZhuyin   = 0x08,
       
   502     EPtiCangJie  = 0x16,
       
   503     EPtiEasyCangjie = 0x20,
       
   504     EPtiAdvCangjie = 0x40
       
   505     };
       
   506 
       
   507 /**
       
   508 * Enumerates different Chinese variants.
       
   509 */
       
   510 enum TPtiChineseVariant
       
   511     {
       
   512     EPtiChineseVariantPrc = 0,
       
   513     EPtiChineseVariantHk, 
       
   514     EPtiChineseVariantTw 
       
   515     };
       
   516 
       
   517 /**
       
   518 * Command definitions for CPtiEngine::HandleCommandL api methods. Many of these
       
   519 * are for internal communication between PtiEngine framework and a specific
       
   520 * core object and there for not documented.
       
   521 */
       
   522 enum TPtiEngineCommand
       
   523     {
       
   524     EPtiCommandNone,
       
   525     EPtiCommandUserActionLeft,
       
   526     EPtiCommandUserActionRight,
       
   527     EPtiCommandUserActionConvert,
       
   528     EPtiCommandUserActionPrevious,
       
   529     EPtiCommandUserActionLengthen,
       
   530     EPtiCommandUserActionShorten,
       
   531     EPtiCommandUserActionCancel,
       
   532     EPtiCommandUserActionComplete,
       
   533     EPtiCommandUserActionAllComplete,
       
   534     EPtiCommandUserActionGetCurrentIndexOfCandidates,
       
   535     EPtiCommandUserActionCompleteCandidate,
       
   536     EPtiCommandUserActionCompleteFull0,
       
   537     EPtiCommandUserActionCompleteFull1,
       
   538     EPtiCommandUserActionCompleteFull2,
       
   539     EPtiCommandUserActionCompleteFull3,
       
   540     EPtiCommandUserActionCompleteFull4,
       
   541     EPtiCommandUserActionCompleteFull5,
       
   542     EPtiCommandUserActionCompleteFull6,
       
   543     EPtiCommandUserActionCompleteFull7,
       
   544     EPtiCommandUserActionCompleteFull8,
       
   545     EPtiCommandUserActionCompleteFull9,
       
   546     EPtiCommandUserActionCompleteHalf0,
       
   547     EPtiCommandUserActionCompleteHalf1,
       
   548     EPtiCommandUserActionCompleteHalf2,
       
   549     EPtiCommandUserActionCompleteHalf3,
       
   550     EPtiCommandUserActionCompleteHalf4,
       
   551     EPtiCommandUserActionCompleteHalf5,
       
   552     EPtiCommandUserActionCompleteHalf6,
       
   553     EPtiCommandUserActionCompleteHalf7,
       
   554     EPtiCommandUserActionCompleteHalf8,
       
   555     EPtiCommandUserActionCompleteHalf9,
       
   556     EPtiCommandEnableToneMarks,
       
   557     EPtiCommandDisableToneMarks,
       
   558     EPtiCommandResetToneMark,
       
   559     EPtiCommandIncrementToneMark,
       
   560     EPtiCommandIncrementToneMarkOverrideInvalid,
       
   561     EPtiCommandReloadLearningInfo,
       
   562     EPtiCommandUserDictionaryDelaySaving,
       
   563     EPtiCommandUserDictionarySaveNow,
       
   564     EPtiCommandUserActionSetCurrentIndexOfCandidates,  
       
   565     EPtiCommandUseLatinDefaultKeyMap,       
       
   566     EPtiCommandUseLatinCaseUpperOnlyKeyMap, 
       
   567     EPtiCommandUseLatinCaseLowerOnlyKeyMap,
       
   568 	  EPtiCommandResetLearningInfo,
       
   569 	  EPtiCommandPollQwertyDeadKeyRootFlag,       // Indicates that dead key root char was added to buffer.
       
   570 	  EPtiCommandGetAndClearDeadKeyRootChar,
       
   571 	  EPtiCommandDeadKeyWaiting,
       
   572 	  EPtiCommandQueryAndClearGetAllFlag,
       
   573 	  EPtiCommandGetAndClearVowelSequence,			 
       
   574     EPtiCommandSetMultitapTimer,                // Set multitap timer for japanese varint only
       
   575     EPtiCommandVowelSeqFlag,
       
   576     EPtiCommandClearVowelSeq,
       
   577     EPtiCommandSetJapaneseQwertyFlags,          // Set Japanese Qwerty flags for japanese varint only
       
   578     EPtiCommandGetAndClearLastVietnameseChar,
       
   579     EPtiCommandSetVietnameseLastChar,
       
   580     EPtiCommandQueryReplacePrevious,  
       
   581     EPtiCommandSetLastKeyForVietnamese,
       
   582     EPtiCommandResetVietnameseVowelSeqAndToneMark,
       
   583     EPtiCommandGetVietnameseLastKey,
       
   584     EPtiCommandDoubleWideEntry,
       
   585     EPtiCommandSetClearFunction,                // Set the behavior of clear key for japanese varint only
       
   586     EPtiCommandUserActionRetroActiveCandidateHalf,
       
   587     EPtiCommandUserActionRetroActiveCandidateFull,
       
   588     EPtiCommandUserActionRetroActiveClear,
       
   589     EPtiCommandUserActionRetroActiveCommit,
       
   590     EPtiCommandAppendCharacter,          // Append a character for Japanese varint only
       
   591     EPtiCommandBackSpaceByForce,          // BackSpace by force for Japanese varint only
       
   592     EPtiCommandGetPhoneticText,
       
   593     EPtiCommandClearPhoneticBuffer,
       
   594     EPtiCommandBreakSyllable,
       
   595     EPtiCommandAllowPictographCandidate,    // Allow the candidates with pictograph cahracter for Japanese variant only
       
   596     EPtiCommandLoopback,  // Loop back input character (Loop back: c->b->a)
       
   597     EPtiCommandSetAutoSubstitution,
       
   598     EPtiCommandAddAutoSubstEntry,           // TPtiAutoSubstBinding passed in aParams.
       
   599     EPtiCommandDeleteAutoSubstEntry,        // TPtiAutoSubstBinding passed in aParams.
       
   600     EPtiCommandNumberOfAutoSubstEntries,
       
   601     EPtiCommandGetAutoSubstEntry,           // TPtiAutoSubstBinding passed in aParams.
       
   602     EPtiCommandFindAutoSubstEntry,          // TPtiAutoSubstBinding* passed in aParams.   
       
   603     EPtiCommandUncommitWord,
       
   604     EPtiCommandEnableAutoCompletion,
       
   605     EPtiCommandDisableAutoCompletion,
       
   606     EPtiCommandSetCorrectionLevel,          // TErrorCorrectionLevel* passed in aParams.
       
   607     EPtiCommandGetAutoCompletionTailLength, // TInt* passed in aParams for output.
       
   608     EPtiCommandLockCurrentCandidate,
       
   609     EPtiCommandSetProactiveCorrection,      // TBool passed in aParams
       
   610     EPtiCommandIsExactKnownWord,
       
   611     EPtiCommandSetAutoCompletion,
       
   612 	EPtiCommandSetNumberCandidateStatus,    // 
       
   613     EPtiCommandSetAutoCompletionMaxLength,  // Param is integer. Sets maximum lenght of ato completed word. Zero == no limit.
       
   614     EPtiCommandMarkAutoCapitalized,          // No parameters.
       
   615     EPtiCommandUserActionGetIndexOfSecondaryCandidate, // index of secondary candidate, TInt* passed in param
       
   616     EPtiCommandAddPhrase,                   // Add new phrase for next word prediction. const TDesC* passed in param. 
       
   617     EPtiCommandSetSecondaryInputLanguage,
       
   618     EPtiCommandSetFlagToUpdateCandidates,
       
   619     EPtiCommandSetCursorCrossedMaxLength,   // sets when cursor crosses max words length in editor
       
   620     EPtiCommandResetCursorCrossedMaxLength,
       
   621     EPtiCommandUserActionSetIndexOfActiveCandidate,
       
   622     EPtiCommandAddWordToUDBWithoutPunctMark,
       
   623     EPtiCommandGetSecondaryCandidate,   
       
   624     EPtiCommandAutoCompletionOnToOff        //to signify that autocompletion is set from on to off in between typing  
       
   625     };
       
   626 
       
   627 /**
       
   628 * A convinience class for auto substitution related EPtiCommands. Needed
       
   629 * only in core object and framework code.
       
   630 */ 
       
   631 class TPtiAutoSubstBinding
       
   632     {
       
   633     public:    
       
   634         TInt iIndex;
       
   635         TBuf<KMaxAutoSubstStringLength> iShortcut;
       
   636         TBuf<KMaxAutoSubstStringLength> iSubstitution;    
       
   637     };
       
   638 
       
   639 
       
   640 /**
       
   641 * A structure for binding language name and language code.
       
   642 * only in core object and framework code.
       
   643 */ 
       
   644 class TPtiLangName
       
   645     {
       
   646     public:
       
   647         TInt iLanguageCode;
       
   648         TBuf<KMaxLanguageNameLength> iName;
       
   649     };
       
   650 
       
   651 
       
   652 /**
       
   653 * This is language code for 'numeric' language.
       
   654 * It is langugae object which is always available and
       
   655 * has only numeric input mode.
       
   656 */
       
   657 #define ELangNumeric 0x5000
       
   658 
       
   659 /**
       
   660 * An interface class for accessing core info attributes.
       
   661 */
       
   662 class MPtiCoreInfo 
       
   663     {
       
   664     public: 
       
   665     	/**	
       
   666     	* Returns a boolean value indicating whether the word completion
       
   667     	* feature is supported by the core object in question
       
   668     	* 
       
   669     	* @since S60 V2.6
       
   670     	* @return ETrue if core object supports word completion feature.
       
   671     	*         EFalse otherwise.
       
   672     	*/
       
   673         virtual TBool WordCompletion() const = 0;
       
   674         
       
   675         /**
       
   676         * Returns a boolean value indicating whether the user dictionary 
       
   677         * re-ordering feature is supported by the core object in question.
       
   678         *
       
   679         * @since S60 V2.6
       
   680         * @return ETrue if core object supports re-ordering feature.
       
   681         *         EFalse otherwise.
       
   682         */
       
   683         virtual TBool Reordering() const = 0;
       
   684         
       
   685         /**
       
   686         * Returns maximum length of single word this core object is able to produce.
       
   687         * 
       
   688         * @since S60 V2.6
       
   689         * @return The maximum word length.
       
   690         */
       
   691         virtual TInt MaximumWordLength() const = 0;
       
   692         
       
   693         /**
       
   694         * Returns the maximum number of prediction candidates the core object
       
   695         * is able to produce for any input sequence. Doesn't apply for
       
   696         * Chinese and Japanese modes.
       
   697         *
       
   698         * @since S60 V2.6
       
   699         * @return The maximum number of candidates.
       
   700         */
       
   701         virtual TInt MaximumNumberOfCandidates() const = 0;
       
   702         
       
   703         /**
       
   704         * Returns a boolean value indicating whether the next word prediction feature
       
   705         * supported by the core object in question.
       
   706         *
       
   707         * @since S60 V2.6
       
   708         * @return ETrue if next wrod prediction is supported.
       
   709         *         EFalse otherwise.
       
   710         */
       
   711         virtual TBool NextWordPrediction() const = 0;
       
   712         
       
   713         /**
       
   714         * Returns core object vendor specific id string.
       
   715         *
       
   716         * @since S60 V2.6
       
   717         * @return Vendor specific id string.  
       
   718         */
       
   719         virtual TPtrC VendorString() const = 0;
       
   720         
       
   721         /**
       
   722         * Returns a bit vector containing flags for various core object features.
       
   723         * See TPtiEngineCapsBits for list of specified bits. 
       
   724         *
       
   725         * @since S60 V2.6
       
   726         * @return A bit vector containing flags for various core object features.
       
   727         */
       
   728         virtual TUint32 CapsBits() const = 0;
       
   729         
       
   730         /**
       
   731         * Returns uid value for core object.
       
   732         * 
       
   733         * @since S60 V2.6
       
   734         * @return Core object uid as an integer value.
       
   735         */
       
   736         virtual TInt32 Uid() const = 0;
       
   737         
       
   738         /**
       
   739         * Returns a bitvector containing flags for available character conversion
       
   740         * methods. See TPtiCharConversion for list of specified bits.
       
   741         *
       
   742         * @since S60 V2.6
       
   743         * @return A bit vector containing flags for available character conversions.
       
   744         */
       
   745         virtual TUint32 CharConversions() const = 0;
       
   746         
       
   747  		/**
       
   748         * Returns a bitvector containing flags for available spelling conversion
       
   749         * methods. See TPtiSpelling for list of specified bits.
       
   750         *
       
   751         * @since S60 V2.6
       
   752         * @return A bit vector containing flags for available spelling conversions.
       
   753         */        
       
   754         virtual TUint32 Spellings() const = 0;
       
   755     };
       
   756 
       
   757 
       
   758 class TPtiCoreInfo : public MPtiCoreInfo
       
   759     {
       
   760     public:
       
   761         inline TBool WordCompletion() const;
       
   762         inline TBool Reordering() const;
       
   763         inline TInt MaximumWordLength() const;
       
   764         inline TInt MaximumNumberOfCandidates() const;
       
   765         inline TBool NextWordPrediction() const;
       
   766         inline TPtrC VendorString() const;
       
   767         inline TInt32 Uid() const;
       
   768         inline TUint32 CharConversions() const;
       
   769         inline TUint32 Spellings() const;
       
   770 
       
   771         inline TUint32 CapsBits() const;
       
   772         inline void SetCapsBits(TUint32 aBits);
       
   773         inline void SetVendorString(const TDesC& aStr);
       
   774         inline void SetMaxWordLength(TInt aMaxLen);
       
   775         inline void SetUid(TInt32 aUid);
       
   776         inline void SetSpellings(TUint32 aSpellings);
       
   777         inline void SetMaxNumberOfCandidates(TInt aMax);
       
   778         inline void SetCharConversions(TUint32 aConvs);
       
   779 
       
   780 	private:
       
   781 		TUint32 iCapsBits;
       
   782 		TPtrC iVendorIdStr;
       
   783 		TInt iMaxWordLength;
       
   784 		TInt iMaxNumberOfCandidates;
       
   785 		TInt32 iUid;
       
   786 		TUint32 iCharConversions;
       
   787 		TUint32 iSpellings;
       
   788 	};
       
   789 
       
   790 
       
   791 #define KPtiEngineChineseSeparator 0x0027
       
   792 
       
   793 // Tone marks for pinyin input
       
   794 enum
       
   795     {
       
   796     KPtiPinyinTone0 = 0x02C9,
       
   797     KPtiPinyinTone1 = 0x02CA,
       
   798     KPtiPinyinTone2 = 0x02C7,
       
   799     KPtiPinyinTone3 = 0x02CB,
       
   800     KPtiPinyinTone4 = 0x02D9
       
   801     };
       
   802 
       
   803 // Tone marks for zhuyin input
       
   804 enum
       
   805     {
       
   806     KPtiZhuyinTone0 = 0x0020,
       
   807     KPtiZhuyinTone1 = 0x02CA,
       
   808     KPtiZhuyinTone2 = 0x02C7,
       
   809     KPtiZhuyinTone3 = 0x02CB,
       
   810     KPtiZhuyinTone4 = 0x02D9
       
   811     };
       
   812 
       
   813 
       
   814 class TPtiNumericKeyBinding
       
   815 	{
       
   816 	public:
       
   817 		TUint16 iChar;	
       
   818 		TPtiKey iKey;
       
   819 		TPtiTextCase iCase;		
       
   820 	};
       
   821 
       
   822 
       
   823 // type definition for HWR
       
   824 typedef struct TRecognitionRangeTag
       
   825     {
       
   826     TLanguage iLanguage;
       
   827     TUint     iSubRange;
       
   828     } TRecognitionRange;
       
   829 
       
   830 
       
   831 enum TRecognitionSubRanges
       
   832     {
       
   833     EPtiRangePRCChinese,
       
   834     EPtiRangeHKChinese,
       
   835     EPtiRangeTWChinese,
       
   836     EPtiRangeLatin,
       
   837     EPtiRangeSymbol,
       
   838     EPtiRangeNumber,
       
   839     EPtiRangeNative, // native text of a language, EPtiRangeLatin also belong to it
       
   840     EPtiRangeHiraganaKanji,
       
   841     EPtiRangeKatakana,
       
   842     EPtiRangeFullWidthKatakana,
       
   843     EPtiRangeFullWidthEnglish,
       
   844     EPtiRangeFullWidthNumeric,
       
   845     EPtiRangeHiraganaOnly,
       
   846     EPtiRangeNativeNumber,
       
   847     EPtiRangeNone
       
   848     };
       
   849     
       
   850     
       
   851 enum TLatinLetterOrder
       
   852     {
       
   853     EUpperFirst,
       
   854     ELowerFirst	
       
   855     };
       
   856        
       
   857 /*
       
   858 * List of supported keyboard types. Each of these keyboard types
       
   859 * may have own data block in keyboard data file. 
       
   860 */        
       
   861 enum TPtiKeyboardType
       
   862     {
       
   863     EPtiKeyboardNone,
       
   864      
       
   865     /**
       
   866     * Conventional 12 phone keypad
       
   867     */
       
   868     EPtiKeyboard12Key,     
       
   869     
       
   870     /**
       
   871     * 4x12 Qwerty keyboard.
       
   872     */
       
   873     EPtiKeyboardQwerty4x12,
       
   874     
       
   875     /**
       
   876     * 4x10 Qwerty keyboard.
       
   877     */
       
   878     EPtiKeyboardQwerty4x10, 
       
   879 
       
   880     /**
       
   881     * 3x11 Qwerty keyboard.
       
   882     */
       
   883     EPtiKeyboardQwerty3x11, 
       
   884     
       
   885     /**
       
   886     * Half qwerty.
       
   887     */    
       
   888     EPtiKeyboardHalfQwerty,
       
   889     
       
   890     /** 
       
   891     * Custom qwerty keyboard.
       
   892     * Bound to [KEYBOARD BLOCK QWERTY CUSTOM] in keymapping
       
   893     * definition files. 
       
   894     */           
       
   895     EPtiKeyboardCustomQwerty,
       
   896     
       
   897     EPtiKeyboardMaxLayout
       
   898     };    
       
   899 
       
   900 #include "PtiDefs.inl"
       
   901 
       
   902 #endif // _PTI_DEFS_H
       
   903 
       
   904 // End od file