00001 /* 00002 * ============================================================================ 00003 * Name : PtiLanguageDatabase.h 00004 * Part of : PtiEngine 00005 * Description: Language database class declaration. 00006 * Version: 00007 * 00008 * Copyright © 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_DATABASE_H 00020 #define _PTI_LANGUAGE_DATABASE_H 00021 00022 // INCLUDES 00023 #include <badesca.h> 00024 #include "PtiDefs.h" 00025 00026 class TPtiLangDatabaseMapping 00027 { 00028 public: 00029 TInt iUid; 00030 TInt iLangCode; 00031 }; 00032 00033 00034 class MPtiLanguageDatabase 00035 { 00036 public: 00037 virtual TInt CoreUID() const = 0; 00038 virtual TInt NumLanguages() const = 0; 00039 virtual TInt LanguageCode(TInt aIndex) const = 0; 00040 virtual TInt SubLanguageCode(TInt aIndex) const = 0; 00041 virtual TInt8* LangData(TInt aIndex) const = 0; 00042 virtual TInt8* LangData(TInt aIndex, TAny* aNativeParams) const = 0; 00043 virtual TInt8* PinyinPhraseData() const = 0; 00044 virtual TInt8* ZhuyinPhraseData() const = 0; 00045 virtual TInt NativeId(TInt aIndex) const = 0; 00046 }; 00047 00048 00049 class CPtiLanguageDatabase : public CBase, public MPtiLanguageDatabase 00050 { 00051 public: 00052 IMPORT_C static CPtiLanguageDatabase* CreateDatabaseL(TUid aImplUid); 00053 IMPORT_C static CArrayFix<TInt>* ListDatabasesLC(TInt aCoreUid); 00054 IMPORT_C static TInt LanguageCodeForUid(TInt aUid); 00055 IMPORT_C static TInt CreateMappingTableL(TInt aCoreUid, RArray<TPtiLangDatabaseMapping>& aResult); 00056 00057 public: 00058 IMPORT_C ~CPtiLanguageDatabase(); 00059 00060 public: // Empty default implementations. 00061 IMPORT_C TInt CoreUID() const; 00062 IMPORT_C TInt NumLanguages() const; 00063 IMPORT_C TInt LanguageCode(TInt aIndex) const; 00064 IMPORT_C TInt SubLanguageCode(TInt aIndex) const; 00065 IMPORT_C TInt8* LangData(TInt aIndex) const; 00066 IMPORT_C TInt8* LangData(TInt aIndex, TAny* aNativeParams) const; 00067 IMPORT_C TInt8* PinyinPhraseData() const; 00068 IMPORT_C TInt8* ZhuyinPhraseData() const; 00069 IMPORT_C TInt NativeId(TInt aIndex) const; 00070 00071 public: 00072 inline void SetDestructorKeyId(TInt aDtorKeyId); 00073 00074 private: 00075 TInt iDtorKeyId; 00076 TInt Reserved_1; 00077 }; 00078 00079 00080 inline void CPtiLanguageDatabase::SetDestructorKeyId(TInt aDtorKeyId) 00081 { 00082 iDtorKeyId = aDtorKeyId; 00083 } 00084 00085 // _PTI_LANGUAGE_DATABASE_H 00086 #endif 00087 00088 // End of file 00089 00090