1.1 --- a/epoc32/include/mw/akninputlanguageinfo.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/akninputlanguageinfo.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,265 @@
1.4 -akninputlanguageinfo.h
1.5 +/*
1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Interface class providing information on available input languages
1.20 +* This header is exported
1.21 +*
1.22 +*/
1.23 +
1.24 +
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +
1.30 +
1.31 +
1.32 +
1.33 +
1.34 +
1.35 +
1.36 +
1.37 +
1.38 +
1.39 +#ifndef __AKNINPUTLANGUAGEINFO_H__
1.40 +#define __AKNINPUTLANGUAGEINFO_H__
1.41 +
1.42 +// INCLUDES
1.43 +
1.44 +#include <e32base.h>
1.45 +
1.46 +// For TBitFlags
1.47 +#include <eikdef.h>
1.48 +#include <bamdesca.h>
1.49 +
1.50 +#include <babitflags.h>
1.51 +
1.52 +// Typedefs
1.53 +typedef TBuf<32> TAknLanguageName;
1.54 +
1.55 +
1.56 +// CLASS DECLARATIONS
1.57 +
1.58 +/**
1.59 +* Input language capabilities
1.60 +*
1.61 +*/
1.62 +class TAknInputLanguageCapabilities
1.63 + {
1.64 + public:
1.65 + /**
1.66 + * These indices are used to set/clear capabilities.
1.67 + * Terms:
1.68 + * - multitap refers to capability to enter alphabetic chars by pressing the same key repeatedly
1.69 + * - predictive refers to the device matching (non-multitap) keypresses with potential words
1.70 + * in a dictionary. That is, what words would map to the current set of keypad presses
1.71 + *
1.72 + *
1.73 + */
1.74 + enum TAknInputLanguageCapabilityIndex
1.75 + {
1.76 + EMultitap = 0x00000000,
1.77 + EPredictive = 0x00000001
1.78 + };
1.79 +
1.80 + /**
1.81 + * C++ Constructor. Initializes the internal state to "no capabilities"
1.82 + */
1.83 + IMPORT_C TAknInputLanguageCapabilities();
1.84 +
1.85 + /**
1.86 + * Sets the capability at a given index index to the logical value passed
1.87 + *
1.88 + * @param aCapability which capability to set
1.89 + * @param aSet ETrue - enable the capability; EFalse - disable the capability
1.90 + */
1.91 + IMPORT_C void AssignCapability( TInt aCapabilityIndex, TBool aSet );
1.92 +
1.93 + /**
1.94 + * Tests a capability
1.95 + *
1.96 + * @param aCapability which capability to test
1.97 + * @return EFalse if the capability is not present; not EFalse otherwise
1.98 + */
1.99 + IMPORT_C TBool HasCapability( TInt aCapabilityIndex ) const;
1.100 +
1.101 + /**
1.102 + * Sets all capabilities (existing and potential)
1.103 + */
1.104 + IMPORT_C void SetAllCapabilities();
1.105 +
1.106 + IMPORT_C TAknInputLanguageCapabilities FilteredCapabilities( TAknInputLanguageCapabilities& aFilter) const;
1.107 +
1.108 + IMPORT_C TBool HasAnySupport() const;
1.109 +
1.110 + private:
1.111 + // Holds the internal state
1.112 + TBitFlags32 iCapabilities;
1.113 + };
1.114 +
1.115 +
1.116 +/**
1.117 +* Input Language Item class.
1.118 +*
1.119 +* This object bring together Symbian language code, a language name, and its capabilities
1.120 +*
1.121 +* This method is not meant to be derived from.
1.122 +*
1.123 +*/
1.124 +NONSHARABLE_CLASS(CAknInputLanguageItem) : public CBase
1.125 + {
1.126 + public:
1.127 + /**
1.128 + * static 2-stage construction of the object. The language name descriptor is copied
1.129 + * by the time the method returns.
1.130 + *
1.131 + * Normally this is constructed by the class that supplies the language information. It would
1.132 + * not normally be called by clients who want to find out about system input languages
1.133 + *
1.134 + * @param aLanguageCode Symbian OS language code
1.135 + * @param aName Language name to be attached to code
1.136 + * @param aCapabilities Sets the capabilities
1.137 + * @return Fully constructed input language item
1.138 + */
1.139 + static CAknInputLanguageItem* NewL( TLanguage aLanguageCode, const TDesC& aName, TAknInputLanguageCapabilities aCapabilities );
1.140 +
1.141 + /**
1.142 + * C++ destructor
1.143 + *
1.144 + */
1.145 + IMPORT_C ~CAknInputLanguageItem();
1.146 +
1.147 + IMPORT_C TLanguage LanguageCode() const;
1.148 + IMPORT_C TPtrC LanguageName() const;
1.149 + IMPORT_C TAknInputLanguageCapabilities Capabilities() const;
1.150 +
1.151 + private:
1.152 + /**
1.153 + * Sets only the langauge code
1.154 + */
1.155 + CAknInputLanguageItem( TLanguage aLanguageCode);
1.156 + /**
1.157 + * 2nd stage construction. This sets the name and the capabilies
1.158 + */
1.159 + void ConstructL( const TDesC& aName, TAknInputLanguageCapabilities aCapabilities );
1.160 +
1.161 + private:
1.162 + TLanguage iLanguageCode;
1.163 + HBufC* iLanguageName; // Owned
1.164 + TAknInputLanguageCapabilities iCapabilities;
1.165 + TInt iSpare; // for expansion
1.166 + };
1.167 +
1.168 +/**
1.169 +*
1.170 +* Class to hold a list of CAknInputLanguageItem objects
1.171 +*
1.172 +*/
1.173 +class CAknInputLanguageList : public CArrayPtrFlat<CAknInputLanguageItem>, public MDesCArray
1.174 + {
1.175 + public:
1.176 + /**
1.177 + * C++ Constructor
1.178 + *
1.179 + */
1.180 + IMPORT_C CAknInputLanguageList(TInt aGranularity);
1.181 +
1.182 + /**
1.183 + * Destructor
1.184 + *
1.185 + */
1.186 + IMPORT_C ~CAknInputLanguageList();
1.187 +
1.188 + public: // from MDesCArray
1.189 + IMPORT_C TInt MdcaCount() const;
1.190 + IMPORT_C TPtrC MdcaPoint(TInt aIndex) const;
1.191 + };
1.192 +
1.193 +/**
1.194 +*
1.195 +* Input Language information interface. This object is instantiated to create a standard interface
1.196 +* to the native input language services.
1.197 +*
1.198 +*/
1.199 +class CAknInputLanguageInfo : public CBase
1.200 + {
1.201 + public:
1.202 + /**
1.203 + * This method returns the input capabilities of a language. The capability object can then
1.204 + * be queried to see what it is capable of.
1.205 + *
1.206 + * @param aLanguageId Symbian language code
1.207 + * @return a structure indicating what the language is capable of
1.208 + */
1.209 + virtual TAknInputLanguageCapabilities LanguageCapabilitiesFromLanguage(TLanguage aLanguageId) = 0;
1.210 +
1.211 + /**
1.212 + * Get the language name that corresponds to the passed-in Symbian OS language code.
1.213 + * This name should be localized, or not, depending upon the policy decided for the product
1.214 + *
1.215 + * @param aLanguageCode - language code for the language whose name is required
1.216 + * @return TAknLanguageName - buffer containing
1.217 + */
1.218 + virtual TAknLanguageName LanguageName( TLanguage aLanguageCode ) const = 0;
1.219 +
1.220 + /**
1.221 + * Provide a language list corresponding to the input list of SymbianOS language codes.
1.222 + * The order of the languages in the output list is that order implemented in the
1.223 + * interface object, and the order of the input list of language codes is ignored.
1.224 + *
1.225 + * @param aInputLanguageList Append to this list;
1.226 + * @param aLanguageCodeList Append only languages whose code is in this list. If Null is passed, then no language code filtering is done
1.227 + * @param aCapabilityFilter Append only languages with capabilities set in this filter.
1.228 + * If a filter with no capabilities whatsoever is passed, then all capabilities are included
1.229 + *
1.230 + */
1.231 + virtual void AppendLanguagesL(
1.232 + CAknInputLanguageList* aInputLanguageList,
1.233 + CArrayFix<TInt>* aLanguageCodeList,
1.234 + TAknInputLanguageCapabilities& aCapabilityFilter ) = 0;
1.235 +
1.236 + /**
1.237 + * Appends to an externally owned array of CAknInputLanguageItem-s. These can be interrogated to provide
1.238 + * information upon return.
1.239 + *
1.240 + * @param aInputLanguageList Passed-in array is appended to by this method
1.241 + */
1.242 + virtual void AppendAvailableLanguagesL( CAknInputLanguageList* aInputLanguageList ) = 0;
1.243 +
1.244 + /**
1.245 + * Return a langauge that is suitable in the product for a URL input language
1.246 + *
1.247 + * @return TLanguage A language code for the designated URL language
1.248 + */
1.249 + virtual TLanguage UrlLanguage() const = 0;
1.250 + };
1.251 +
1.252 +/**
1.253 +* This factory class exists to supply an available input language interface
1.254 +*/
1.255 +class AknInputLanguageInfoFactory
1.256 + {
1.257 + public:
1.258 + /**
1.259 + * Factory method to return a generic object from which information on available
1.260 + * languages can be obtained.
1.261 + *
1.262 + * @return a pointer to a fully constructed object conformant to CAknInputLanguageInfo
1.263 + */
1.264 + IMPORT_C static CAknInputLanguageInfo* CreateInputLanguageInfoL();
1.265 + };
1.266 +
1.267 +#endif // __AKNINPUTLANGUAGEINFO_H__
1.268 +
1.269 +// End of File