00001 /* 00002 * ============================================================================ 00003 * Name : akninputlanguageinfo.h 00004 * Part of : AKNINPUTLANGUAGE 00005 * 00006 * Description: 00007 * Interface class providing information on available input languages 00008 * This header is exported 00009 * Version: 00010 * 00011 * Copyright (C) 2002 Nokia Corporation. 00012 * This material, including documentation and any related 00013 * computer programs, is protected by copyright controlled by 00014 * Nokia Corporation. All rights are reserved. Copying, 00015 * including reproducing, storing, adapting or translating, any 00016 * or all of this material requires the prior written consent of 00017 * Nokia Corporation. This material also contains confidential 00018 * information which may not be disclosed to others without the 00019 * prior written consent of Nokia Corporation. 00020 * ============================================================================ 00021 */ 00022 00023 00024 #ifndef __AKNINPUTLANGUAGEINFO_H__ 00025 #define __AKNINPUTLANGUAGEINFO_H__ 00026 00027 // INCLUDES 00028 00029 #include <e32base.h> 00030 00031 // For TBitFlags 00032 #include <eikdef.h> 00033 #include <bamdesca.h> 00034 00035 #include <babitflags.h> 00036 00037 // Typedefs 00038 typedef TBuf<32> TAknLanguageName; 00039 00040 00041 // CLASS DECLARATIONS 00042 00047 class TAknInputLanguageCapabilities 00048 { 00049 public: 00059 enum TAknInputLanguageCapabilityIndex 00060 { 00061 EMultitap = 0x00000000, 00062 EPredictive = 0x00000001 00063 }; 00064 00068 IMPORT_C TAknInputLanguageCapabilities(); 00069 00076 IMPORT_C void AssignCapability( TInt aCapabilityIndex, TBool aSet ); 00077 00084 IMPORT_C TBool HasCapability( TInt aCapabilityIndex ) const; 00085 00089 IMPORT_C void SetAllCapabilities(); 00090 00091 IMPORT_C TAknInputLanguageCapabilities FilteredCapabilities( TAknInputLanguageCapabilities& aFilter) const; 00092 00093 IMPORT_C TBool HasAnySupport() const; 00094 00095 private: 00096 // Holds the internal state 00097 TBitFlags32 iCapabilities; 00098 }; 00099 00100 00109 NONSHARABLE_CLASS(CAknInputLanguageItem) : public CBase 00110 { 00111 public: 00124 static CAknInputLanguageItem* NewL( TLanguage aLanguageCode, const TDesC& aName, TAknInputLanguageCapabilities aCapabilities ); 00125 00130 IMPORT_C ~CAknInputLanguageItem(); 00131 00132 IMPORT_C TLanguage LanguageCode() const; 00133 IMPORT_C TPtrC LanguageName() const; 00134 IMPORT_C TAknInputLanguageCapabilities Capabilities() const; 00135 00136 private: 00140 CAknInputLanguageItem( TLanguage aLanguageCode); 00144 void ConstructL( const TDesC& aName, TAknInputLanguageCapabilities aCapabilities ); 00145 00146 private: 00147 TLanguage iLanguageCode; 00148 HBufC* iLanguageName; // Owned 00149 TAknInputLanguageCapabilities iCapabilities; 00150 TInt iSpare; // for expansion 00151 }; 00152 00158 class CAknInputLanguageList : public CArrayPtrFlat<CAknInputLanguageItem>, public MDesCArray 00159 { 00160 public: 00165 IMPORT_C CAknInputLanguageList(TInt aGranularity); 00166 00171 IMPORT_C ~CAknInputLanguageList(); 00172 00173 public: // from MDesCArray 00174 IMPORT_C TInt MdcaCount() const; 00175 IMPORT_C TPtrC MdcaPoint(TInt aIndex) const; 00176 }; 00177 00184 class CAknInputLanguageInfo : public CBase 00185 { 00186 public: 00194 virtual TAknInputLanguageCapabilities LanguageCapabilitiesFromLanguage(TLanguage aLanguageId) = 0; 00195 00203 virtual TAknLanguageName LanguageName( TLanguage aLanguageCode ) const = 0; 00204 00216 virtual void AppendLanguagesL( 00217 CAknInputLanguageList* aInputLanguageList, 00218 CArrayFix<TInt>* aLanguageCodeList, 00219 TAknInputLanguageCapabilities& aCapabilityFilter ) = 0; 00220 00227 virtual void AppendAvailableLanguagesL( CAknInputLanguageList* aInputLanguageList ) = 0; 00228 00234 virtual TLanguage UrlLanguage() const = 0; 00235 }; 00236 00240 class AknInputLanguageInfoFactory 00241 { 00242 public: 00249 IMPORT_C static CAknInputLanguageInfo* CreateInputLanguageInfoL(); 00250 }; 00251 00252 // __AKNINPUTLANGUAGEINFO_H__ 00253 #endif 00254 00255 // End of File