00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _PTI_ENGINE_H
00021 #define _PTI_ENGINE_H
00022
00023
00024 #include <e32base.h>
00025 #include <badesca.h>
00026 #include "PtiDefs.h"
00027 #include "PtiObserver.h"
00028 #include "PtiLanguage.h"
00029
00030
00031 class CPtiUserDictionary;
00032 class MPtiUserDictionary;
00033 class MPtiEngineCompositionDataInterface;
00034 class MPtiUserDictionaryEntry;
00035 class CPtiEngineImpl;
00036 class MPtiHwrRecognizer;
00037
00134 NONSHARABLE_CLASS(CPtiEngine) : public CBase
00135 {
00136 public:
00143 IMPORT_C static CPtiEngine* NewL(TBool aUseDefaultUserDictionary = EFalse);
00144
00150 IMPORT_C static CPtiEngine* NewL(const TDesC& aCoreName, TBool aUseDefaultUserDictionary = EFalse);
00151
00159 IMPORT_C static CPtiEngine* NewL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse);
00160
00164 IMPORT_C ~CPtiEngine();
00165
00176 IMPORT_C TInt ActivateLanguageL(TInt aEpocLanguageID, TPtiEngineInputMode aMode = EPtiEngineInputModeNone);
00177
00187 IMPORT_C void CloseCurrentLanguageL();
00188
00196 IMPORT_C MPtiCoreInfo* CoreInfo(TPtiEngineInputMode aMode) const;
00197
00204 IMPORT_C MPtiLanguage* CurrentLanguage();
00205
00214 IMPORT_C MPtiLanguage* GetLanguage(TInt aCode) const;
00215
00223 IMPORT_C TInt NumberOfCandidates();
00224
00236 IMPORT_C TPtrC AppendKeyPress(TPtiKey aKey);
00237
00245 IMPORT_C TPtrC DeleteKeyPress();
00246
00250 IMPORT_C TInt AddCoreL(const TDesC& aFileName, TBool aUseDefaultUserDictionary = EFalse);
00251
00263 IMPORT_C TInt AddCoreL(const TUid aCoreUid, TBool aUseDefaultUserDictionary = EFalse);
00264
00276 IMPORT_C TInt GetCandidateListL(CDesCArray& aList);
00277
00290 IMPORT_C TInt GetNextWordCandidateListL(CDesCArray& aList);
00291
00300 IMPORT_C TPtrC FirstCandidate();
00301
00311 IMPORT_C TPtrC NextCandidate();
00312
00322 IMPORT_C TPtrC PreviousCandidate();
00323
00333 IMPORT_C TInt SetInputMode(TPtiEngineInputMode aMode);
00334
00341 IMPORT_C TPtiEngineInputMode InputMode() const;
00342
00356 IMPORT_C TInt SetReordering(TBool aStatus);
00357
00367 IMPORT_C TInt SetCurrentWord(TPtrC aWord);
00368
00375 IMPORT_C TPtrC CurrentWord();
00376
00385 IMPORT_C void ClearCurrentWord();
00386
00400 IMPORT_C void SetCase(TPtiTextCase aCase);
00401
00408 IMPORT_C TPtiTextCase Case() const;
00409
00416 IMPORT_C void GetAvailableLanguagesL(CArrayFix<TInt>* aResult);
00417
00424 IMPORT_C void GetAvailableLanguagesL(RArray<TInt>& aResult);
00425
00432 IMPORT_C TInt NumberOfLanguages() const;
00433
00448 IMPORT_C TInt CreateUserDictionaryL(TDesC& aFileName, CDesCArrayFlat* aWords, TPtiEngineInputMode aMode);
00449
00458 IMPORT_C MPtiUserDictionary* AttachUserDictionaryL(TDesC& aFileName);
00459
00468 IMPORT_C MPtiUserDictionary* AttachDefaultUserDictionaryL(TUid aCoreUid, TInt aSymbolClass);
00469
00477 IMPORT_C TInt DetachUserDictionary(TDesC& aFileName);
00478
00486 IMPORT_C TInt DetachUserDictionary(TInt aId);
00487
00499 IMPORT_C void GetLocalizedLanguageName(TInt aLangCode, TDes& aResult);
00500
00513 IMPORT_C TInt CommitCurrentWord();
00514
00535 IMPORT_C TInt CharConversion(TPtiCharConversion aType,
00536 TAny* aInput,
00537 TInt aInputLength,
00538 TAny* aOutput);
00539
00549 IMPORT_C TUint32 AvailableCharConversions() const;
00550
00560 IMPORT_C TInt SetExternalKeyMapL(TPtiEngineInputMode aMode,
00561 TPtiKey aKey,
00562 TDesC& aKeyMap,
00563 TPtiTextCase aCase);
00564
00571 IMPORT_C TPtiKey LastEnteredKey() const;
00572
00580 IMPORT_C TPtrC8 CurrentInputSequence() const;
00581
00592 IMPORT_C TInt GetSpelling(TUint16 aInput, TDes& aOutput, TPtiSpelling aType);
00593
00603 IMPORT_C TInt CancelTimerActivity();
00604
00614 IMPORT_C TPtiKey CharacterToKey(TUint16 aChar);
00615
00624 IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry);
00625
00634 IMPORT_C TInt AddUserDictionaryEntry(MPtiUserDictionaryEntry& aEntry, TInt aId);
00635
00644 IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry);
00645
00654 IMPORT_C TInt RemoveEntryFromUserDictionary(MPtiUserDictionaryEntry& aEntry, TInt aId);
00655
00663 IMPORT_C TInt NumberOfEntriesInUserDictionary();
00664
00673 IMPORT_C TInt GetUserDictionaryEntry(TInt aIndex, MPtiUserDictionaryEntry& aResult);
00674
00682 IMPORT_C MPtiUserDictionary* DefaultUserDictionary(TPtiEngineInputMode aMode);
00683
00690 IMPORT_C void SetObserver(MPtiObserver* aObserver);
00691
00698 IMPORT_C MPtiObserver* Observer();
00699
00710 IMPORT_C TInt HandleCommandL(TPtiEngineCommand aCommand, TAny* aParams = NULL);
00711
00718 IMPORT_C TPtrC CandidatePage();
00719
00727 IMPORT_C TBool NextCandidatePage();
00728
00736 IMPORT_C TBool PreviousCandidatePage();
00737
00746 IMPORT_C TBool MoreCandidatePages();
00747
00754 IMPORT_C void SetCandidatePageLength(TInt aLength);
00755
00763 IMPORT_C TPtrC GetPhoneticSpelling(TInt aIndex) const;
00764
00773 IMPORT_C TInt PhoneticSpellingCount() const;
00774
00781 IMPORT_C TBool SelectPhoneticSpelling(TInt aIndex);
00782
00791 IMPORT_C TInt SelectedPhoneticSpelling() const;
00792
00800 IMPORT_C void EnableToneMarks(TBool aValue);
00801
00807 IMPORT_C void ResetToneMark();
00808
00817 IMPORT_C TBool ToneMark(TText& aToneMark) const;
00818
00827 IMPORT_C TBool IsToneMarkValidForSpelling() const;
00828
00838 IMPORT_C TBool IncrementToneMark(TBool aOverrideInvalid);
00839
00851 IMPORT_C TBool SetPredictiveChineseChar(const TDesC& aChar);
00852
00859 IMPORT_C MPtiEngineCompositionDataInterface* CompositionData();
00860
00867 IMPORT_C TPtrC ReadingTextL();
00868
00876 IMPORT_C void GetModeNameIndexL(TPtiChineseVariant aVariant, RArray<TInt>& aResult);
00877
00887 IMPORT_C TInt GetPhoneticSpellingsL(CDesCArray& aList);
00888
00898 IMPORT_C TInt GetChinesePhraseCandidatesL(CDesCArray& aList);
00899
00910 IMPORT_C TBool SetToneMark(TInt aToneMark);
00911
00920 IMPORT_C TBool IsQwertyBasedMode(TPtiEngineInputMode aMode) const;
00921
00932 IMPORT_C void CreateDefaultUserDictionaryFileL(TUid aCoreUid, TInt aSymbolClass);
00933
00945 IMPORT_C void WriteSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber, HBufC8* aData);
00946
00957 IMPORT_C HBufC8* ReadSecondaryDataFileL(TUid aCoreUid, TInt aIndexNumber);
00958
00968 IMPORT_C void MappingDataForKey(TPtiKey aKey, TDes& aResult, TPtiTextCase aCase);
00969
00994 IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage, RArray<TPtiNumericKeyBinding>& aResult);
00995
00996 IMPORT_C HBufC* GetCandidatesByInputString(const TDesC& aInputString,
00997 RPointerArray<HBufC>& aList,
00998 const TBool aIsPredictive);
01006 IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TLanguage aLanguage);
01007
01015 IMPORT_C MPtiHwrRecognizer* GetHwrRecognizerL(TInt aImpId);
01016
01024 IMPORT_C RArray<TUid>& ListHwrRecognizerL(TLanguage aLanguage);
01025
01033 IMPORT_C void GetHwrAvailableLanguagesL(RArray<TInt>& aResult);
01034
01043 IMPORT_C static void ListAvailablePhysicalKeyboardsL(RArray<TPtiKeyboardType>& aResult);
01044
01064 IMPORT_C const RArray<TPtiNumericKeyBinding>& ExtendedNumericModeKeysForQwertyL(TInt aLanguage);
01065
01075 IMPORT_C TInt SetAutoSubstitution(TBool aStatus);
01076
01086 IMPORT_C TInt AddAutoSubstitutionEntry(const TDesC& aShortcut,
01087 const TDesC& aSubstituition);
01088
01097 IMPORT_C TInt DeleteAutoSubstitutionEntry(const TDesC& aShortcut);
01098
01106 IMPORT_C TInt NumberOfAutoSubstitutionEntries() const;
01107
01117 IMPORT_C TInt GetAutoSubstitutionEntry(TInt aIndex, TDes& aShortcut,
01118 TDes& aSubstitution);
01125 IMPORT_C TPtiKeyboardType KeyboardType() const;
01126
01138 IMPORT_C TInt SetKeyboardType(TPtiKeyboardType aType);
01139
01147 IMPORT_C void KeyboardTypesSupportedByLanguageL(TInt aLanguage,
01148 RArray<TPtiKeyboardType>& aResult);
01159 IMPORT_C void GetNumericModeKeysForQwertyL(TInt aLanguage,
01160 RArray<TPtiNumericKeyBinding>& aResult,
01161 TPtiKeyboardType aKeyboardType);
01172 IMPORT_C const RArray<TPtiNumericKeyBinding>& ExtendedNumericModeKeysForQwertyL(TInt aLanguage,
01173 TPtiKeyboardType aKeyboardType);
01174
01186 IMPORT_C TInt SetNumberCandidateStatus(TBool aStatus);
01187
01197 IMPORT_C TBool IsValidKey(TPtiKey aKey) const;
01198
01211 IMPORT_C TInt SetMaxLengthForAutoCompletedCandidates(TInt aMaxLength);
01212
01223 IMPORT_C void MarkAutoCapitalized();
01224
01235 IMPORT_C TPtrC8 CaseSequence();
01236
01248 IMPORT_C TInt AddPhrase(const TDesC& aNewPhrase);
01249
01250 #ifdef __DUAL_LANGUAGE_SUPPORT__
01251
01258 IMPORT_C TInt SetSecondaryInputL(TInt aEpocLanguageID);
01259 #endif //__DUAL_LANGUAGE_SUPPORT__
01260 private:
01261 CPtiEngine();
01262 void ConstructL(TBool aUseDefaultUserDictionary);
01263 void ConstructL(const TUid aCoreUid, TBool aUseDefaultUserDictionary);
01264
01265 private:
01266 CPtiEngineImpl* iImpl;
01267 };
01268
01269 #endif _PTI_ENGINE_H
01270
01271