epoc32/include/mw/ptidefs.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 ptidefs.h
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.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     EPtiEngineMaxInputModes = EPtiEngineMultitappingKorean
       
   304     };
       
   305 
       
   306 
       
   307 /*
       
   308 * Predictive qwerty error correction levels. 
       
   309 */
       
   310 enum TPtiErrorCorrectionLevel
       
   311     {
       
   312     EPtiErrorCorrectionLevelOff  = 0,
       
   313     EPtiErrorCorrectionLevelLow  = 1,
       
   314     EPtiErrorCorrectionLevelHigh = 2
       
   315     };
       
   316 
       
   317 
       
   318 /**
       
   319 * Key enumerations for conventional (ITU-T) and qwerty keyboards.
       
   320 * Constant names for qwerty keypad keys are named after scan code
       
   321 * values of a device using English language keymappings. The
       
   322 * actual character that will be inserted into editor buffer depends on
       
   323 * keymappings of currently selected input language and may be something else
       
   324 * than what enum name suggests. For example
       
   325 * non-shifted EPtiKeyQwertyHash produces '#'-character if input language is
       
   326 * English, but will produce '+'-character if
       
   327 * input language is Danish, Norwegian, Swedish or Finnish.
       
   328 * The key coordinates on standard 4x12 qwerty keypad are given in
       
   329 * comments.
       
   330 */
       
   331 enum TPtiKey
       
   332     {
       
   333     EPtiKeyNone = 0,
       
   334     
       
   335     EPtiKey1    = '1',
       
   336     EPtiKey2    = '2',
       
   337     EPtiKey3    = '3',
       
   338     EPtiKey4    = '4',
       
   339     EPtiKey5    = '5',
       
   340     EPtiKey6    = '6',
       
   341     EPtiKey7    = '7',
       
   342     EPtiKey8    = '8',
       
   343     EPtiKey9    = '9',
       
   344     EPtiKeyStar = '*',
       
   345     EPtiKey0    = '0',
       
   346     EPtiKeyHash = '#',
       
   347 
       
   348     // alternate names
       
   349     EPtiKeyPunct = EPtiKey1,
       
   350     EPtiKeyABC   = EPtiKey2,
       
   351     EPtiKeyDEF   = EPtiKey3,
       
   352     EPtiKeyGHI   = EPtiKey4,
       
   353     EPtiKeyJKL   = EPtiKey5,
       
   354     EPtiKeyMNO   = EPtiKey6,
       
   355     EPtiKeyPQRS  = EPtiKey7,
       
   356     EPtiKeyTUV   = EPtiKey8,
       
   357     EPtiKeyWXYZ  = EPtiKey9,
       
   358 
       
   359     // qwerty keys
       
   360     EPtiKeyQwerty1     = 0x31,   
       
   361     EPtiKeyQwerty2     = 0x32,   
       
   362     EPtiKeyQwerty3     = 0x33,   
       
   363     EPtiKeyQwerty4     = 0x34,   
       
   364     EPtiKeyQwerty5     = 0x35,   
       
   365     EPtiKeyQwerty6     = 0x36,   
       
   366     EPtiKeyQwerty7     = 0x37,   
       
   367     EPtiKeyQwerty8     = 0x38,   
       
   368     EPtiKeyQwerty9     = 0x39,   
       
   369     EPtiKeyQwerty0     = 0x30,   
       
   370 
       
   371     EPtiKeyQwertyPlus        = 0x2b,                    
       
   372     EPtiKeyQwertyMinus       = EStdKeyMinus,            
       
   373     EPtiKeyQwertyComma       = EStdKeyComma,            
       
   374     EPtiKeyQwertySemicolon   = EStdKeySemiColon,        
       
   375     EPtiKeyQwertyFullstop    = EStdKeyFullStop,         
       
   376     EPtiKeyQwertyHash        = EStdKeyHash,             
       
   377     EPtiKeyQwertySlash       = EStdKeyForwardSlash,     
       
   378     EPtiKeyQwertyApostrophe  = EStdKeySingleQuote,      
       
   379     EPtiKeyQwertySpace       = EStdKeySpace,  
       
   380     EPtiKeyQwertyAtCharacter = EStdKeySquareBracketRight,
       
   381     EPtiKeyQwertyLeftShift   = EStdKeyLeftShift,           // Needed only for special cases.
       
   382 
       
   383     EPtiKeyQwertyA = 0x41,     
       
   384     EPtiKeyQwertyB = 0x42,     
       
   385     EPtiKeyQwertyC = 0x43,     
       
   386     EPtiKeyQwertyD = 0x44,     
       
   387     EPtiKeyQwertyE = 0x45,     
       
   388     EPtiKeyQwertyF = 0x46,     
       
   389     EPtiKeyQwertyG = 0x47,     
       
   390     EPtiKeyQwertyH = 0x48,     
       
   391     EPtiKeyQwertyI = 0x49,      
       
   392     EPtiKeyQwertyJ = 0x4a,      
       
   393     EPtiKeyQwertyK = 0x4b,      
       
   394     EPtiKeyQwertyL = 0x4c,     
       
   395     EPtiKeyQwertyM = 0x4d,     
       
   396     EPtiKeyQwertyN = 0x4e,     
       
   397     EPtiKeyQwertyO = 0x4f,      
       
   398     EPtiKeyQwertyP = 0x50,     
       
   399     EPtiKeyQwertyQ = 0x51,      
       
   400     EPtiKeyQwertyR = 0x52,     
       
   401     EPtiKeyQwertyS = 0x53,     
       
   402     EPtiKeyQwertyT = 0x54,      
       
   403     EPtiKeyQwertyU = 0x55,     
       
   404     EPtiKeyQwertyV = 0x56,     
       
   405     EPtiKeyQwertyW = 0x57,     
       
   406     EPtiKeyQwertyX = 0x58,       
       
   407     EPtiKeyQwertyY = 0x59,     
       
   408     EPtiKeyQwertyZ = 0x5a      
       
   409     
       
   410     // ----> Half Qwerty
       
   411     , EPtiKeyQwertyChr = EStdKeyLeftFunc 	// key (4, 4) 
       
   412     // Half Qwerty <----
       
   413     };
       
   414 
       
   415 
       
   416 
       
   417 /**
       
   418 * Enumerations for PtiCore capabilities. These can be queries through
       
   419 * MPtiCoreInfo::CapsBits(). 
       
   420 * Here are descriptions:
       
   421 *
       
   422 * EWordCompletion
       
   423 *      The core object supports word completion -feature.
       
   424 *
       
   425 * EReordering
       
   426 *      The core object supports user dictionary reordering. This feature means that
       
   427 *      most commonly used words are moved up in prediction candidate
       
   428 *      list.
       
   429 *
       
   430 * ENextWordPrediction
       
   431 *      The core supports next word prediction feature. When this feature is
       
   432 *      enabled, prediction engine tries to guess next word based on previous word(s).
       
   433 *
       
   434 * ESupportUserDictionaries
       
   435 *      The core supports supports user dictionaries. 
       
   436 *
       
   437 * ESupportSCTToneMarks
       
   438 *        
       
   439 * ESupportCangjieInput 
       
   440 *      The core object supports Chinese CangJie input.
       
   441 *
       
   442 * ESupportDualLanguage
       
   443 *      The core object supports dual language preditcion.
       
   444 * 
       
   445 * ESupportAutoSubstitution
       
   446 *      The core object supports auto-substitution feature. This feature
       
   447 *      automatically expands predefined string to longer string.
       
   448 *      ie. "l8r" -> "later"
       
   449 */
       
   450 enum TPtiEngineCapsBits
       
   451     {
       
   452     EWordCompletion          = 0x01,
       
   453     EReordering              = 0x02,
       
   454     ENextWordPrediction      = 0x04,
       
   455     ESupportUserDictionaries = 0x08,
       
   456     ESupportSCTToneMarks     = 0x10,
       
   457     ESupportCangjieInput     = 0x20,
       
   458     EPreferedSpelling        = 0x40,
       
   459     ESupportDualLanguage     = 0x80,
       
   460     ESupportAutoSubstitution = 0x100
       
   461     };
       
   462 
       
   463 
       
   464 /**
       
   465 * Text case defintions.
       
   466 */
       
   467 enum TPtiTextCase
       
   468     {
       
   469     EPtiCaseLower = 0,    // Normal lower case input
       
   470     EPtiCaseUpper,        // Normal upper case input.
       
   471     EPtiCaseChrLower,     // Qwerty chr-key lower case input.
       
   472     EPtiCaseChrUpper,     // Qwerty chr-key upper case input.
       
   473     EPtiCaseFnLower,      // Qwerty fn-key lower case input.    
       
   474     EPtiCaseFnUpper,       // Qwerty fn-key upper case input.
       
   475     EPtiCaseMax
       
   476     };
       
   477 
       
   478 
       
   479 enum TPtiCharConversion
       
   480     {
       
   481     EPtiSimplifiedToComplex = 0x01,  // Chinese simplified to Chinese complex
       
   482     EPtiUcs2ToUtf8 = 0x02,           // Unicode to utf8
       
   483     EPtiUcs2ToBig5 = 0x04,           // Unicode to big5
       
   484     EPtiUcs2ToGB = 0x08,             // Unicode to Guo-Biao 
       
   485     EPtiUtf8ToUcs2 = 0x10,           // Utf8 to Unicode
       
   486     EPtiKo2ToWc = 0x20,              // KSC5601 to Hangul Syllable
       
   487     EPtiWcToKo2 = 0x30,              // Hangul Syllable to KSC5601
       
   488     EPtiBig5ToUcs2 = 0x40,           // Big5 to Unicode
       
   489     EPtiComplexToSimplified = 0x80   // Chinese complex to Chinese simplified
       
   490     };
       
   491 
       
   492 /**
       
   493 * Enumerates supported spelling types for CPtiEngine::GetSpelling method.
       
   494 */
       
   495 enum TPtiSpelling   
       
   496     {
       
   497     EPtiStrokes  = 0x01,
       
   498     EPtiPinyin   = 0x02,
       
   499     EPtiBopomofo = 0x04,
       
   500     EPtiZhuyin   = 0x08,
       
   501     EPtiCangJie  = 0x10,
       
   502     EPtiEasyCangjie = 0x20,
       
   503     EPtiAdvCangjie = 0x40
       
   504     };
       
   505 
       
   506 /**
       
   507 * Enumerates different Chinese variants.
       
   508 */
       
   509 enum TPtiChineseVariant
       
   510     {
       
   511     EPtiChineseVariantPrc = 0,
       
   512     EPtiChineseVariantHk, 
       
   513     EPtiChineseVariantTw 
       
   514     };
       
   515 
       
   516 /**
       
   517 * Command definitions for CPtiEngine::HandleCommandL api methods. Many of these
       
   518 * are for internal communication between PtiEngine framework and a specific
       
   519 * core object and there for not documented.
       
   520 */
       
   521 enum TPtiEngineCommand
       
   522     {
       
   523     EPtiCommandNone,
       
   524     EPtiCommandUserActionLeft,
       
   525     EPtiCommandUserActionRight,
       
   526     EPtiCommandUserActionConvert,
       
   527     EPtiCommandUserActionPrevious,
       
   528     EPtiCommandUserActionLengthen,
       
   529     EPtiCommandUserActionShorten,
       
   530     EPtiCommandUserActionCancel,
       
   531     EPtiCommandUserActionComplete,
       
   532     EPtiCommandUserActionAllComplete,
       
   533     EPtiCommandUserActionGetCurrentIndexOfCandidates,
       
   534     EPtiCommandUserActionCompleteCandidate,
       
   535     EPtiCommandUserActionCompleteFull0,
       
   536     EPtiCommandUserActionCompleteFull1,
       
   537     EPtiCommandUserActionCompleteFull2,
       
   538     EPtiCommandUserActionCompleteFull3,
       
   539     EPtiCommandUserActionCompleteFull4,
       
   540     EPtiCommandUserActionCompleteFull5,
       
   541     EPtiCommandUserActionCompleteFull6,
       
   542     EPtiCommandUserActionCompleteFull7,
       
   543     EPtiCommandUserActionCompleteFull8,
       
   544     EPtiCommandUserActionCompleteFull9,
       
   545     EPtiCommandUserActionCompleteHalf0,
       
   546     EPtiCommandUserActionCompleteHalf1,
       
   547     EPtiCommandUserActionCompleteHalf2,
       
   548     EPtiCommandUserActionCompleteHalf3,
       
   549     EPtiCommandUserActionCompleteHalf4,
       
   550     EPtiCommandUserActionCompleteHalf5,
       
   551     EPtiCommandUserActionCompleteHalf6,
       
   552     EPtiCommandUserActionCompleteHalf7,
       
   553     EPtiCommandUserActionCompleteHalf8,
       
   554     EPtiCommandUserActionCompleteHalf9,
       
   555     EPtiCommandEnableToneMarks,
       
   556     EPtiCommandDisableToneMarks,
       
   557     EPtiCommandResetToneMark,
       
   558     EPtiCommandIncrementToneMark,
       
   559     EPtiCommandIncrementToneMarkOverrideInvalid,
       
   560     EPtiCommandReloadLearningInfo,
       
   561     EPtiCommandUserDictionaryDelaySaving,
       
   562     EPtiCommandUserDictionarySaveNow,
       
   563     EPtiCommandUserActionSetCurrentIndexOfCandidates,  
       
   564     EPtiCommandUseLatinDefaultKeyMap,       
       
   565     EPtiCommandUseLatinCaseUpperOnlyKeyMap, 
       
   566     EPtiCommandUseLatinCaseLowerOnlyKeyMap,
       
   567 	  EPtiCommandResetLearningInfo,
       
   568 	  EPtiCommandPollQwertyDeadKeyRootFlag,       // Indicates that dead key root char was added to buffer.
       
   569 	  EPtiCommandGetAndClearDeadKeyRootChar,
       
   570 	  EPtiCommandDeadKeyWaiting,
       
   571 	  EPtiCommandQueryAndClearGetAllFlag,
       
   572 	  EPtiCommandGetAndClearVowelSequence,			 
       
   573     EPtiCommandSetMultitapTimer,                // Set multitap timer for japanese varint only
       
   574     EPtiCommandVowelSeqFlag,
       
   575     EPtiCommandClearVowelSeq,
       
   576     EPtiCommandSetJapaneseQwertyFlags,          // Set Japanese Qwerty flags for japanese varint only
       
   577     EPtiCommandGetAndClearLastVietnameseChar,
       
   578     EPtiCommandSetVietnameseLastChar,
       
   579     EPtiCommandQueryReplacePrevious,  
       
   580     EPtiCommandSetLastKeyForVietnamese,
       
   581     EPtiCommandResetVietnameseVowelSeqAndToneMark,
       
   582     EPtiCommandGetVietnameseLastKey,
       
   583     EPtiCommandDoubleWideEntry,
       
   584     EPtiCommandSetClearFunction,                // Set the behavior of clear key for japanese varint only
       
   585     EPtiCommandUserActionRetroActiveCandidateHalf,
       
   586     EPtiCommandUserActionRetroActiveCandidateFull,
       
   587     EPtiCommandUserActionRetroActiveClear,
       
   588     EPtiCommandUserActionRetroActiveCommit,
       
   589     EPtiCommandAppendCharacter,          // Append a character for Japanese varint only
       
   590     EPtiCommandBackSpaceByForce,          // BackSpace by force for Japanese varint only
       
   591     EPtiCommandGetPhoneticText,
       
   592     EPtiCommandClearPhoneticBuffer,
       
   593     EPtiCommandBreakSyllable,
       
   594     EPtiCommandAllowPictographCandidate,    // Allow the candidates with pictograph cahracter for Japanese variant only
       
   595     EPtiCommandLoopback,  // Loop back input character (Loop back: c->b->a)
       
   596     EPtiCommandSetAutoSubstitution,
       
   597     EPtiCommandAddAutoSubstEntry,           // TPtiAutoSubstBinding passed in aParams.
       
   598     EPtiCommandDeleteAutoSubstEntry,        // TPtiAutoSubstBinding passed in aParams.
       
   599     EPtiCommandNumberOfAutoSubstEntries,
       
   600     EPtiCommandGetAutoSubstEntry,           // TPtiAutoSubstBinding passed in aParams.
       
   601     EPtiCommandFindAutoSubstEntry,          // TPtiAutoSubstBinding* passed in aParams.   
       
   602     EPtiCommandUncommitWord,
       
   603     EPtiCommandEnableAutoCompletion,
       
   604     EPtiCommandDisableAutoCompletion,
       
   605     EPtiCommandSetCorrectionLevel,          // TErrorCorrectionLevel* passed in aParams.
       
   606     EPtiCommandGetAutoCompletionTailLength, // TInt* passed in aParams for output.
       
   607     EPtiCommandLockCurrentCandidate,
       
   608     EPtiCommandSetProactiveCorrection,      // TBool passed in aParams
       
   609     EPtiCommandIsExactKnownWord,
       
   610     EPtiCommandSetAutoCompletion,
       
   611 	EPtiCommandSetNumberCandidateStatus,    // 
       
   612     EPtiCommandSetAutoCompletionMaxLength,  // Param is integer. Sets maximum lenght of ato completed word. Zero == no limit.
       
   613     EPtiCommandMarkAutoCapitalized,          // No parameters.
       
   614     EPtiCommandUserActionGetIndexOfSecondaryCandidate, // index of secondary candidate, TInt* passed in param
       
   615     EPtiCommandAddPhrase,                   // Add new phrase for next word prediction. const TDesC* passed in param. 
       
   616     EPtiCommandSetSecondaryInputLanguage,
       
   617     EPtiCommandSetFlagToUpdateCandidates,
       
   618     EPtiCommandSetCursorCrossedMaxLength,   // sets when cursor crosses max words length in editor
       
   619     EPtiCommandResetCursorCrossedMaxLength,
       
   620     EPtiCommandUserActionSetIndexOfActiveCandidate,
       
   621     EPtiCommandAddWordToUDBWithoutPunctMark   
       
   622     };
       
   623 
       
   624 /**
       
   625 * A convinience class for auto substitution related EPtiCommands. Needed
       
   626 * only in core object and framework code.
       
   627 */ 
       
   628 class TPtiAutoSubstBinding
       
   629     {
       
   630     public:    
       
   631         TInt iIndex;
       
   632         TBuf<KMaxAutoSubstStringLength> iShortcut;
       
   633         TBuf<KMaxAutoSubstStringLength> iSubstitution;    
       
   634     };
       
   635 
       
   636 
       
   637 /**
       
   638 * A structure for binding language name and language code.
       
   639 * only in core object and framework code.
       
   640 */ 
       
   641 class TPtiLangName
       
   642     {
       
   643     public:
       
   644         TInt iLanguageCode;
       
   645         TBuf<KMaxLanguageNameLength> iName;
       
   646     };
       
   647 
       
   648 
       
   649 /**
       
   650 * This is language code for 'numeric' language.
       
   651 * It is langugae object which is always available and
       
   652 * has only numeric input mode.
       
   653 */
       
   654 #define ELangNumeric 0x5000
       
   655 
       
   656 /**
       
   657 * An interface class for accessing core info attributes.
       
   658 */
       
   659 class MPtiCoreInfo 
       
   660     {
       
   661     public: 
       
   662     	/**	
       
   663     	* Returns a boolean value indicating whether the word completion
       
   664     	* feature is supported by the core object in question
       
   665     	* 
       
   666     	* @since S60 V2.6
       
   667     	* @return ETrue if core object supports word completion feature.
       
   668     	*         EFalse otherwise.
       
   669     	*/
       
   670         virtual TBool WordCompletion() const = 0;
       
   671         
       
   672         /**
       
   673         * Returns a boolean value indicating whether the user dictionary 
       
   674         * re-ordering feature is supported by the core object in question.
       
   675         *
       
   676         * @since S60 V2.6
       
   677         * @return ETrue if core object supports re-ordering feature.
       
   678         *         EFalse otherwise.
       
   679         */
       
   680         virtual TBool Reordering() const = 0;
       
   681         
       
   682         /**
       
   683         * Returns maximum length of single word this core object is able to produce.
       
   684         * 
       
   685         * @since S60 V2.6
       
   686         * @return The maximum word length.
       
   687         */
       
   688         virtual TInt MaximumWordLength() const = 0;
       
   689         
       
   690         /**
       
   691         * Returns the maximum number of prediction candidates the core object
       
   692         * is able to produce for any input sequence. Doesn't apply for
       
   693         * Chinese and Japanese modes.
       
   694         *
       
   695         * @since S60 V2.6
       
   696         * @return The maximum number of candidates.
       
   697         */
       
   698         virtual TInt MaximumNumberOfCandidates() const = 0;
       
   699         
       
   700         /**
       
   701         * Returns a boolean value indicating whether the next word prediction feature
       
   702         * supported by the core object in question.
       
   703         *
       
   704         * @since S60 V2.6
       
   705         * @return ETrue if next wrod prediction is supported.
       
   706         *         EFalse otherwise.
       
   707         */
       
   708         virtual TBool NextWordPrediction() const = 0;
       
   709         
       
   710         /**
       
   711         * Returns core object vendor specific id string.
       
   712         *
       
   713         * @since S60 V2.6
       
   714         * @return Vendor specific id string.  
       
   715         */
       
   716         virtual TPtrC VendorString() const = 0;
       
   717         
       
   718         /**
       
   719         * Returns a bit vector containing flags for various core object features.
       
   720         * See TPtiEngineCapsBits for list of specified bits. 
       
   721         *
       
   722         * @since S60 V2.6
       
   723         * @return A bit vector containing flags for various core object features.
       
   724         */
       
   725         virtual TUint32 CapsBits() const = 0;
       
   726         
       
   727         /**
       
   728         * Returns uid value for core object.
       
   729         * 
       
   730         * @since S60 V2.6
       
   731         * @return Core object uid as an integer value.
       
   732         */
       
   733         virtual TInt32 Uid() const = 0;
       
   734         
       
   735         /**
       
   736         * Returns a bitvector containing flags for available character conversion
       
   737         * methods. See TPtiCharConversion for list of specified bits.
       
   738         *
       
   739         * @since S60 V2.6
       
   740         * @return A bit vector containing flags for available character conversions.
       
   741         */
       
   742         virtual TUint32 CharConversions() const = 0;
       
   743         
       
   744  		/**
       
   745         * Returns a bitvector containing flags for available spelling conversion
       
   746         * methods. See TPtiSpelling for list of specified bits.
       
   747         *
       
   748         * @since S60 V2.6
       
   749         * @return A bit vector containing flags for available spelling conversions.
       
   750         */        
       
   751         virtual TUint32 Spellings() const = 0;
       
   752     };
       
   753 
       
   754 
       
   755 class TPtiCoreInfo : public MPtiCoreInfo
       
   756     {
       
   757     public:
       
   758         inline TBool WordCompletion() const;
       
   759         inline TBool Reordering() const;
       
   760         inline TInt MaximumWordLength() const;
       
   761         inline TInt MaximumNumberOfCandidates() const;
       
   762         inline TBool NextWordPrediction() const;
       
   763         inline TPtrC VendorString() const;
       
   764         inline TInt32 Uid() const;
       
   765         inline TUint32 CharConversions() const;
       
   766         inline TUint32 Spellings() const;
       
   767 
       
   768         inline TUint32 CapsBits() const;
       
   769         inline void SetCapsBits(TUint32 aBits);
       
   770         inline void SetVendorString(const TDesC& aStr);
       
   771         inline void SetMaxWordLength(TInt aMaxLen);
       
   772         inline void SetUid(TInt32 aUid);
       
   773         inline void SetSpellings(TUint32 aSpellings);
       
   774         inline void SetMaxNumberOfCandidates(TInt aMax);
       
   775         inline void SetCharConversions(TUint32 aConvs);
       
   776 
       
   777 	private:
       
   778 		TUint32 iCapsBits;
       
   779 		TPtrC iVendorIdStr;
       
   780 		TInt iMaxWordLength;
       
   781 		TInt iMaxNumberOfCandidates;
       
   782 		TInt32 iUid;
       
   783 		TUint32 iCharConversions;
       
   784 		TUint32 iSpellings;
       
   785 	};
       
   786 
       
   787 
       
   788 #define KPtiEngineChineseSeparator 0x0027
       
   789 
       
   790 // Tone marks for pinyin input
       
   791 enum
       
   792     {
       
   793     KPtiPinyinTone0 = 0x02C9,
       
   794     KPtiPinyinTone1 = 0x02CA,
       
   795     KPtiPinyinTone2 = 0x02C7,
       
   796     KPtiPinyinTone3 = 0x02CB,
       
   797     KPtiPinyinTone4 = 0x02D9
       
   798     };
       
   799 
       
   800 // Tone marks for zhuyin input
       
   801 enum
       
   802     {
       
   803     KPtiZhuyinTone0 = 0x0020,
       
   804     KPtiZhuyinTone1 = 0x02CA,
       
   805     KPtiZhuyinTone2 = 0x02C7,
       
   806     KPtiZhuyinTone3 = 0x02CB,
       
   807     KPtiZhuyinTone4 = 0x02D9
       
   808     };
       
   809 
       
   810 
       
   811 class TPtiNumericKeyBinding
       
   812 	{
       
   813 	public:
       
   814 		TUint16 iChar;	
       
   815 		TPtiKey iKey;
       
   816 		TPtiTextCase iCase;		
       
   817 	};
       
   818 
       
   819 
       
   820 // type definition for HWR
       
   821 typedef struct TRecognitionRangeTag
       
   822     {
       
   823     TLanguage iLanguage;
       
   824     TUint     iSubRange;
       
   825     } TRecognitionRange;
       
   826 
       
   827 
       
   828 enum TRecognitionSubRanges
       
   829     {
       
   830     EPtiRangePRCChinese,
       
   831     EPtiRangeHKChinese,
       
   832     EPtiRangeTWChinese,
       
   833     EPtiRangeLatin,
       
   834     EPtiRangeSymbol,
       
   835     EPtiRangeNumber,
       
   836     EPtiRangeNative, // native text of a language, EPtiRangeLatin also belong to it
       
   837     EPtiRangeHiraganaKanji,
       
   838     EPtiRangeKatakana,
       
   839     EPtiRangeFullWidthKatakana,
       
   840     EPtiRangeFullWidthEnglish,
       
   841     EPtiRangeFullWidthNumeric,
       
   842     EPtiRangeHiraganaOnly,
       
   843     EPtiRangeNativeNumber,
       
   844     EPtiRangeNone
       
   845     };
       
   846     
       
   847     
       
   848 enum TLatinLetterOrder
       
   849     {
       
   850     EUpperFirst,
       
   851     ELowerFirst	
       
   852     };
       
   853        
       
   854 /*
       
   855 * List of supported keyboard types. Each of these keyboard types
       
   856 * may have own data block in keyboard data file. 
       
   857 */        
       
   858 enum TPtiKeyboardType
       
   859     {
       
   860     EPtiKeyboardNone,
       
   861      
       
   862     /**
       
   863     * Conventional 12 phone keypad
       
   864     */
       
   865     EPtiKeyboard12Key,     
       
   866     
       
   867     /**
       
   868     * 4x12 Qwerty keyboard.
       
   869     */
       
   870     EPtiKeyboardQwerty4x12,
       
   871     
       
   872     /**
       
   873     * 4x10 Qwerty keyboard.
       
   874     */
       
   875     EPtiKeyboardQwerty4x10, 
       
   876 
       
   877     /**
       
   878     * 3x11 Qwerty keyboard.
       
   879     */
       
   880     EPtiKeyboardQwerty3x11, 
       
   881     
       
   882     /**
       
   883     * Half qwerty.
       
   884     */    
       
   885     EPtiKeyboardHalfQwerty,
       
   886     
       
   887     /** 
       
   888     * Custom qwerty keyboard.
       
   889     * Bound to [KEYBOARD BLOCK QWERTY CUSTOM] in keymapping
       
   890     * definition files. 
       
   891     */           
       
   892     EPtiKeyboardCustomQwerty,
       
   893     
       
   894     EPtiKeyboardMaxLayout
       
   895     };    
       
   896 
       
   897 #include "PtiDefs.inl"
       
   898 
       
   899 #endif // _PTI_DEFS_H
       
   900 
       
   901 // End od file