00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _PTI_DEFS_H
00020 #define _PTI_DEFS_H
00021
00022 #include <e32keys.h>
00023
00024 const TInt KMaxLanguageNameLength = 50;
00025
00026 const TInt KErrPtiEngineBase = (-1000);
00027 enum TPtiError
00028 {
00029 KErrNoActiveLanguage = KErrPtiEngineBase-1,
00030 KErrLanguageNotFound = KErrPtiEngineBase-2,
00031 KErrNoSuitableCore = KErrPtiEngineBase-3,
00032 KErrNotAllowed = KErrPtiEngineBase-4,
00033 KErrTooLongWord = KErrPtiEngineBase-5,
00034 KErrInvalidWord = KErrPtiEngineBase-6,
00035 KErrTooLongReading = KErrPtiEngineBase-7,
00036 KErrInvalidReading = KErrPtiEngineBase-8,
00037 KErrUserDic = KErrPtiEngineBase-9
00038 };
00039
00040
00117 enum TPtiEngineInputMode
00118 {
00119 EPtiEngineInputModeNone = 0,
00120 EPtiEngineMultitapping,
00121 EPtiEnginePredictive,
00122 EPtiEngineWordCompletion,
00123 EPtiEngineNumeric,
00124 EPtiEngineQwerty,
00125 EPtiEnginePinyin,
00126 EPtiEngineStroke,
00127 EPtiEngineZhuyin,
00128 EPtiEngineHiraganaKanji,
00129 EPtiEngineHiraganaKanjiPredictive,
00130 EPtiEngineKatakana,
00131 EPtiEngineFullWidthKatakana,
00132 EPtiEngineFullWidthNumeric,
00133 EPtiEngineFullWidthAlphabet,
00134 EPtiEngineHiragana,
00135 EPtiEnginePinyinByPhrase,
00136 EPtiEngineZhuyinByPhrase,
00137 EPtiEngineZhuyinQwerty,
00138 EPtiEngineZhuyinPhraseQwerty,
00139 EPtiEnginePinyinQwerty,
00140 EPtiEnginePinyinPhraseQwerty,
00141 EPtiEngineStrokeQwerty,
00142 EPtiEngineNormalCangjieQwerty,
00143 EPtiEngineEasyCangjieQwerty,
00144 EPtiEngineAdvCangjieQwerty,
00145 EPtiEngineHiraganaKanjiQwerty,
00146 EPtiEngineHiraganaKanjiPredictiveQwerty,
00147 EPtiEngineKatakanaQwerty,
00148 EPtiEngineFullWidthKatakanaQwerty,
00149 EPtiEngineFullWidthNumericQwerty,
00150 EPtiEngineFullWidthAlphabetQwerty,
00151 EPtiEngineHiraganaQwerty,
00152
00153 EPtiEnginePinyinVkb,
00154 EPtiEngineStrokeVkb,
00155 EPtiEngineZhuyinVkb,
00156 EPtiEngineStrokeByPhrase,
00157 EPtiEngineStrokePhraseQwerty,
00158 EPtiEngineHiraganaKanjiVkb,
00159 EPtiEngineHiraganaKanjiPredictiveVkb,
00160 EPtiEngineHiraganaKanjiHwr,
00161 EPtiEngineHiraganaKanjiPredictiveHwr,
00162 EPtiEngineKatakanaVkb,
00163 EPtiEngineFullWidthKatakanaVkb,
00164 EPtiEngineHiraganaVkb,
00165 EPtiEngineNormalCangjieVkb,
00166 EPtiEngineEasyCangjieVkb,
00167 EPtiEngineAdvCangjieVkb,
00168 EPtiEngineInputModeIndicPhoneticMultitap,
00169 EPtiEngineInputModeIndicPhoneticQwerty,
00170 EPtiEngineMaxInputModes = EPtiEngineInputModeIndicPhoneticQwerty
00171 };
00172
00173
00187 enum TPtiKey
00188 {
00189 EPtiKeyNone = 0,
00190
00191 EPtiKey1 = '1',
00192 EPtiKey2 = '2',
00193 EPtiKey3 = '3',
00194 EPtiKey4 = '4',
00195 EPtiKey5 = '5',
00196 EPtiKey6 = '6',
00197 EPtiKey7 = '7',
00198 EPtiKey8 = '8',
00199 EPtiKey9 = '9',
00200 EPtiKeyStar = '*',
00201 EPtiKey0 = '0',
00202 EPtiKeyHash = '#',
00203
00204
00205 EPtiKeyPunct = EPtiKey1,
00206 EPtiKeyABC = EPtiKey2,
00207 EPtiKeyDEF = EPtiKey3,
00208 EPtiKeyGHI = EPtiKey4,
00209 EPtiKeyJKL = EPtiKey5,
00210 EPtiKeyMNO = EPtiKey6,
00211 EPtiKeyPQRS = EPtiKey7,
00212 EPtiKeyTUV = EPtiKey8,
00213 EPtiKeyWXYZ = EPtiKey9,
00214
00215
00216 EPtiKeyQwerty1 = 0x31,
00217 EPtiKeyQwerty2 = 0x32,
00218 EPtiKeyQwerty3 = 0x33,
00219 EPtiKeyQwerty4 = 0x34,
00220 EPtiKeyQwerty5 = 0x35,
00221 EPtiKeyQwerty6 = 0x36,
00222 EPtiKeyQwerty7 = 0x37,
00223 EPtiKeyQwerty8 = 0x38,
00224 EPtiKeyQwerty9 = 0x39,
00225 EPtiKeyQwerty0 = 0x30,
00226
00227 EPtiKeyQwertyPlus = 0x2b,
00228 EPtiKeyQwertyMinus = EStdKeyMinus,
00229 EPtiKeyQwertyComma = EStdKeyComma,
00230 EPtiKeyQwertySemicolon = EStdKeySemiColon,
00231 EPtiKeyQwertyFullstop = EStdKeyFullStop,
00232 EPtiKeyQwertyHash = EStdKeyHash,
00233 EPtiKeyQwertySlash = EStdKeyForwardSlash,
00234 EPtiKeyQwertyApostrophe = EStdKeySingleQuote,
00235 EPtiKeyQwertySpace = EStdKeySpace,
00236
00237 EPtiKeyQwertyA = 0x41,
00238 EPtiKeyQwertyB = 0x42,
00239 EPtiKeyQwertyC = 0x43,
00240 EPtiKeyQwertyD = 0x44,
00241 EPtiKeyQwertyE = 0x45,
00242 EPtiKeyQwertyF = 0x46,
00243 EPtiKeyQwertyG = 0x47,
00244 EPtiKeyQwertyH = 0x48,
00245 EPtiKeyQwertyI = 0x49,
00246 EPtiKeyQwertyJ = 0x4a,
00247 EPtiKeyQwertyK = 0x4b,
00248 EPtiKeyQwertyL = 0x4c,
00249 EPtiKeyQwertyM = 0x4d,
00250 EPtiKeyQwertyN = 0x4e,
00251 EPtiKeyQwertyO = 0x4f,
00252 EPtiKeyQwertyP = 0x50,
00253 EPtiKeyQwertyQ = 0x51,
00254 EPtiKeyQwertyR = 0x52,
00255 EPtiKeyQwertyS = 0x53,
00256 EPtiKeyQwertyT = 0x54,
00257 EPtiKeyQwertyU = 0x55,
00258 EPtiKeyQwertyV = 0x56,
00259 EPtiKeyQwertyW = 0x57,
00260 EPtiKeyQwertyX = 0x58,
00261 EPtiKeyQwertyY = 0x59,
00262 EPtiKeyQwertyZ = 0x5a
00263 };
00264
00265
00291 enum TPtiEngineCapsBits
00292 {
00293 EWordCompletion = 0x01,
00294 EReordering = 0x02,
00295 ENextWordPrediction = 0x04,
00296 ESupportUserDictionaries = 0x08,
00297 ESupportSCTToneMarks = 0x10,
00298 ESupportCangjieInput = 0x20,
00299 EPreferedSpelling = 0x40
00300 };
00301
00302
00306 enum TPtiTextCase
00307 {
00308 EPtiCaseLower = 0,
00309 EPtiCaseUpper,
00310 EPtiCaseChrLower,
00311 EPtiCaseChrUpper
00312 };
00313
00314
00315 enum TPtiCharConversion
00316 {
00317 EPtiSimplifiedToComplex = 0x01,
00318 EPtiUcs2ToUtf8 = 0x02,
00319 EPtiUcs2ToBig5 = 0x04,
00320 EPtiUcs2ToGB = 0x08,
00321 EPtiUtf8ToUcs2 = 0x10,
00322 EPtiKo2ToWc = 0x20,
00323 EPtiWcToKo2 = 0x30,
00324 EPtiBig5ToUcs2 = 0x40,
00325 EPtiComplexToSimplified = 0x80
00326 };
00327
00328
00329 enum TPtiSpelling
00330 {
00331 EPtiStrokes = 0x01,
00332 EPtiPinyin = 0x02,
00333 EPtiBopomofo = 0x04,
00334 EPtiZhuyin = 0x08,
00335 EPtiCangJie = 0x16
00336 };
00337
00338
00339 enum TPtiChineseVariant
00340 {
00341 EPtiChineseVariantPrc = 0,
00342 EPtiChineseVariantHk,
00343 EPtiChineseVariantTw
00344 };
00345
00346
00347 enum TPtiEngineCommand
00348 {
00349 EPtiCommandNone,
00350 EPtiCommandUserActionLeft,
00351 EPtiCommandUserActionRight,
00352 EPtiCommandUserActionConvert,
00353 EPtiCommandUserActionPrevious,
00354 EPtiCommandUserActionLengthen,
00355 EPtiCommandUserActionShorten,
00356 EPtiCommandUserActionCancel,
00357 EPtiCommandUserActionComplete,
00358 EPtiCommandUserActionAllComplete,
00359 EPtiCommandUserActionGetCurrentIndexOfCandidates,
00360 EPtiCommandUserActionCompleteCandidate,
00361 EPtiCommandUserActionCompleteFull0,
00362 EPtiCommandUserActionCompleteFull1,
00363 EPtiCommandUserActionCompleteFull2,
00364 EPtiCommandUserActionCompleteFull3,
00365 EPtiCommandUserActionCompleteFull4,
00366 EPtiCommandUserActionCompleteFull5,
00367 EPtiCommandUserActionCompleteFull6,
00368 EPtiCommandUserActionCompleteFull7,
00369 EPtiCommandUserActionCompleteFull8,
00370 EPtiCommandUserActionCompleteFull9,
00371 EPtiCommandUserActionCompleteHalf0,
00372 EPtiCommandUserActionCompleteHalf1,
00373 EPtiCommandUserActionCompleteHalf2,
00374 EPtiCommandUserActionCompleteHalf3,
00375 EPtiCommandUserActionCompleteHalf4,
00376 EPtiCommandUserActionCompleteHalf5,
00377 EPtiCommandUserActionCompleteHalf6,
00378 EPtiCommandUserActionCompleteHalf7,
00379 EPtiCommandUserActionCompleteHalf8,
00380 EPtiCommandUserActionCompleteHalf9,
00381 EPtiCommandEnableToneMarks,
00382 EPtiCommandDisableToneMarks,
00383 EPtiCommandResetToneMark,
00384 EPtiCommandIncrementToneMark,
00385 EPtiCommandIncrementToneMarkOverrideInvalid,
00386 EPtiCommandReloadLearningInfo,
00387 EPtiCommandUserDictionaryDelaySaving,
00388 EPtiCommandUserDictionarySaveNow,
00389 EPtiCommandUserActionSetCurrentIndexOfCandidates,
00390 EPtiCommandUseLatinDefaultKeyMap,
00391 EPtiCommandUseLatinCaseUpperOnlyKeyMap,
00392 EPtiCommandUseLatinCaseLowerOnlyKeyMap,
00393 EPtiCommandResetLearningInfo,
00394 EPtiCommandPollQwertyDeadKeyRootFlag,
00395 EPtiCommandGetAndClearDeadKeyRootChar,
00396 EPtiCommandDeadKeyWaiting,
00397 EPtiCommandQueryAndClearGetAllFlag,
00398 EPtiCommandGetAndClearVowelSequence,
00399 EPtiCommandSetMultitapTimer,
00400 EPtiCommandVowelSeqFlag,
00401 EPtiCommandClearVowelSeq,
00402 EPtiCommandSetJapaneseQwertyFlags,
00403 EPtiCommandGetAndClearLastVietnameseChar,
00404 EPtiCommandSetVietnameseLastChar,
00405 EPtiCommandQueryReplacePrevious,
00406 EPtiCommandSetLastKeyForVietnamese,
00407 EPtiCommandResetVietnameseVowelSeqAndToneMark,
00408 EPtiCommandGetVietnameseLastKey,
00409 EPtiCommandDoubleWideEntry,
00410 EPtiCommandSetClearFunction,
00411 EPtiCommandUserActionRetroActiveCandidateHalf,
00412 EPtiCommandUserActionRetroActiveCandidateFull,
00413 EPtiCommandUserActionRetroActiveClear,
00414 EPtiCommandUserActionRetroActiveCommit,
00415 EPtiCommandAppendCharacter,
00416 EPtiCommandBackSpaceByForce,
00417 EPtiCommandGetPhoneticText,
00418 EPtiCommandClearPhoneticBuffer,
00419 EPtiCommandBreakSyllable,
00420 EPtiCommandAllowPictographCandidate
00421
00422 };
00423
00424
00425 class TPtiLangName
00426 {
00427 public:
00428 TInt iLanguageCode;
00429 TBuf<KMaxLanguageNameLength> iName;
00430 };
00431
00432
00438 #define ELangNumeric 0x5000
00439
00440
00441 class MPtiCoreInfo
00442 {
00443 public:
00452 virtual TBool WordCompletion() const = 0;
00453
00462 virtual TBool Reordering() const = 0;
00463
00470 virtual TInt MaximumWordLength() const = 0;
00471
00480 virtual TInt MaximumNumberOfCandidates() const = 0;
00481
00490 virtual TBool NextWordPrediction() const = 0;
00491
00498 virtual TPtrC VendorString() const = 0;
00499
00507 virtual TUint32 CapsBits() const = 0;
00508
00515 virtual TInt32 Uid() const = 0;
00516
00524 virtual TUint32 CharConversions() const = 0;
00525
00533 virtual TUint32 Spellings() const = 0;
00534 };
00535
00536
00537
00538 class TPtiCoreInfo : public MPtiCoreInfo
00539 {
00540 public:
00541 inline TBool WordCompletion() const;
00542 inline TBool Reordering() const;
00543 inline TInt MaximumWordLength() const;
00544 inline TInt MaximumNumberOfCandidates() const;
00545 inline TBool NextWordPrediction() const;
00546 inline TPtrC VendorString() const;
00547 inline TInt32 Uid() const;
00548 inline TUint32 CharConversions() const;
00549 inline TUint32 Spellings() const;
00550
00551 inline TUint32 CapsBits() const;
00552 inline void SetCapsBits(TUint32 aBits);
00553 inline void SetVendorString(const TDesC& aStr);
00554 inline void SetMaxWordLength(TInt aMaxLen);
00555 inline void SetUid(TInt32 aUid);
00556 inline void SetSpellings(TUint32 aSpellings);
00557 inline void SetMaxNumberOfCandidates(TInt aMax);
00558 inline void SetCharConversions(TUint32 aConvs);
00559
00560 private:
00561 TUint32 iCapsBits;
00562 TPtrC iVendorIdStr;
00563 TInt iMaxWordLength;
00564 TInt iMaxNumberOfCandidates;
00565 TInt32 iUid;
00566 TUint32 iCharConversions;
00567 TUint32 iSpellings;
00568 };
00569
00570
00571 #define KPtiEngineChineseSeparator 0x0027
00572
00573
00574 enum
00575 {
00576 KPtiPinyinTone0 = 0x02C9,
00577 KPtiPinyinTone1 = 0x02CA,
00578 KPtiPinyinTone2 = 0x02C7,
00579 KPtiPinyinTone3 = 0x02CB,
00580 KPtiPinyinTone4 = 0x02D9
00581 };
00582
00583
00584 enum
00585 {
00586 KPtiZhuyinTone0 = 0x0020,
00587 KPtiZhuyinTone1 = 0x02CA,
00588 KPtiZhuyinTone2 = 0x02C7,
00589 KPtiZhuyinTone3 = 0x02CB,
00590 KPtiZhuyinTone4 = 0x02D9
00591 };
00592
00593
00594 class TPtiNumericKeyBinding
00595 {
00596 public:
00597 TUint16 iChar;
00598 TPtiKey iKey;
00599 TPtiTextCase iCase;
00600 };
00601
00602
00603 typedef struct TRecognitionRangeTag
00604 {
00605 TLanguage iLanguage;
00606 TUint iSubRange;
00607 } TRecognitionRange;
00608
00609 enum TRecognitionSubRanges
00610 {
00611 EPtiRangePRCChinese,
00612 EPtiRangeHKChinese,
00613 EPtiRangeTWChinese,
00614 EPtiRangeLatin,
00615 EPtiRangeSymbol,
00616 EPtiRangeNumber,
00617 EPtiRangeNative,
00618 EPtiRangeHiraganaKanji,
00619 EPtiRangeKatakana,
00620 EPtiRangeFullWidthKatakana,
00621 EPtiRangeFullWidthEnglish,
00622 EPtiRangeFullWidthNumeric,
00623 EPtiRangeHiraganaOnly,
00624 EPtiRangeNativeNumber,
00625 EPtiRangeNone
00626 };
00627
00628 enum TLatinLetterOrder
00629 {
00630 EUpperFirst,
00631 ELowerFirst
00632 };
00633
00634 #include "PtiDefs.inl"
00635
00636
00637 #endif
00638
00639