00001 /* 00002 * ============================================================================ 00003 * Name : PtiLanguage.h 00004 * Part of : PtiEngine 00005 * Description: PtiLanguage class definitions. 00006 * Version: 00007 * 00008 * Copyright © 2003-2005 Nokia Corporation. 00009 * This material, including documentation and any related 00010 * computer programs, is protected by copyright controlled by 00011 * Nokia Corporation. All rights are reserved. Copying, 00012 * including reproducing, storing, adapting or translating, any 00013 * or all of this material requires the prior written consent of 00014 * Nokia Corporation. This material also contains confidential 00015 * information which may not be disclosed to others without the 00016 * prior written consent of Nokia Corporation. 00017 * ============================================================================ 00018 */ 00019 #ifndef _PTI_LANGUAGE_H 00020 #define _PTI_LANGUAGE_H 00021 00022 // INCLUDES 00023 #include <e32base.h> 00024 #include <f32file.h> 00025 #include <barsc.h> 00026 #include <barsread.h> 00027 #include "PtiDefs.h" 00028 00029 const TInt KMaxMultitapResourceFileName = 20; 00030 const TInt KMaxQwertyResourceFileName = 32; 00031 00032 // FORWARD DECLARATIONS 00033 class MPtiKeyMappings; 00034 class MPtiCore; 00035 00036 class TPtiCoreBinding 00037 { 00038 public: 00039 TInt iInputMode; 00040 MPtiCore* iCore; 00041 }; 00042 00043 00049 class MPtiLanguage 00050 { 00051 public: 00060 virtual TBool HasInputMode(TPtiEngineInputMode aMode) const = 0; 00061 00067 virtual void GetAvailableInputModesL(CArrayFix<TInt>* aResult) = 0; 00068 00074 virtual TInt LanguageCode() const = 0; 00075 00081 virtual TPtrC LocalizedName() const = 0; 00082 }; 00083 00084 00085 00093 NONSHARABLE_CLASS(CPtiCoreLanguage) : public CBase, public MPtiLanguage 00094 { 00095 public: 00096 IMPORT_C static CPtiCoreLanguage* NewL(); 00097 IMPORT_C ~CPtiCoreLanguage(); 00098 00104 IMPORT_C void SetKeyMappings(MPtiKeyMappings* aMappings); 00105 00111 IMPORT_C void SetQwertyKeyMappings(MPtiKeyMappings* aMappings); 00112 00118 IMPORT_C void SetLanguageCode(TInt aCode); 00119 00126 IMPORT_C MPtiKeyMappings* GetKeymappings() const; 00127 00134 IMPORT_C MPtiKeyMappings* GetQwertyKeymappings() const; 00135 00139 IMPORT_C void ClearMultitapping(); 00140 00144 IMPORT_C void ClearQwerty(); 00145 00151 IMPORT_C void SetLocalizedName(const TDesC& aName); 00152 00158 IMPORT_C TDes& LocalizedNameDes(); 00159 00167 IMPORT_C MPtiCore* GetCore(TPtiEngineInputMode aMode); 00168 00176 IMPORT_C void SetCore(MPtiCore *aCore, TPtiEngineInputMode aMode); 00177 00183 IMPORT_C void GetAvailableInputModesL(CArrayFix<TInt>* aResult); 00184 00191 IMPORT_C void GetAvailableInputModesL(RArray<TInt>& aResult); 00192 00201 IMPORT_C TBool HasInputMode(TPtiEngineInputMode aMode) const; 00202 00208 inline TInt LanguageCode() const; 00209 00216 inline TPtrC LocalizedName() const; 00217 00226 IMPORT_C TBool HasCore(MPtiCore* aCore) const; 00227 00233 IMPORT_C void RemoveCore(MPtiCore* aCore); 00234 00235 void SetKeymappingFileIndex(TUint16 aIndex); 00236 void SetQwertyKeymappingFileIndex(TUint16 aIndex); 00237 00238 private: 00239 CPtiCoreLanguage(); 00240 void ConstructL(); 00241 void Clear(); 00242 void LoadKeymappingsL() const; 00243 void LoadQwertyKeymappingsL() const; 00244 inline TInt KeymappingFileIndex() const; 00245 inline TInt QwertyKeymappingFileIndex() const; 00246 00247 private: 00248 TInt iLanguageCode; 00249 mutable MPtiKeyMappings* iKeyMappings; 00250 mutable MPtiKeyMappings* iQwertyKeyMappings; 00251 TBuf<KMaxLanguageNameLength> iLocalizedName; 00252 RArray<TPtiCoreBinding> iCores; 00253 TInt iIndices; // Indices for keymapping resource files inside directory. 00254 // Both ITU-T and qwerty are stored in this same variable. 00255 }; 00256 00257 #include <PtiLanguage.inl> 00258 00259 // _PTI_LANGUAGE_H 00260 #endif 00261 00262 // End of file 00263