43 #include <PtiDefs.h> |
43 #include <PtiDefs.h> |
44 #endif |
44 #endif |
45 #include <AvkonInternalCRKeys.h> // KAknQwertyInputModeActive |
45 #include <AvkonInternalCRKeys.h> // KAknQwertyInputModeActive |
46 #include <settingsinternalcrkeys.h> //Pen related settings |
46 #include <settingsinternalcrkeys.h> //Pen related settings |
47 #include <sensorplugindomaincrkeys.h> // KCRUidSensorSettings |
47 #include <sensorplugindomaincrkeys.h> // KCRUidSensorSettings |
|
48 #include <featmgr.h> // Feature Manager |
48 |
49 |
49 // TODO: include CommonengineInternalCRKeys.h |
50 // TODO: include CommonengineInternalCRKeys.h |
50 const TUid KCRUidCommonEngineKeys = {0x1020503B}; |
51 const TUid KCRUidCommonEngineKeys = {0x1020503B}; |
51 const TUint32 KGSDisplayTxtLang = 0x00000001; |
52 const TUint32 KGSDisplayTxtLang = 0x00000001; |
52 |
53 |
357 return value; |
358 return value; |
358 } |
359 } |
359 |
360 |
360 void CAknFepSharedDataInterface::SetPluginInputMode(TInt aDevice) |
361 void CAknFepSharedDataInterface::SetPluginInputMode(TInt aDevice) |
361 { |
362 { |
|
363 // Check validity of the input mode to be set. |
|
364 if ( aDevice == EPluginInputModeItut ) |
|
365 { |
|
366 __ASSERT_DEBUG( FeatureManager::FeatureSupported( |
|
367 KFeatureIdVirtualItutInput ), |
|
368 User::Panic( _L( "Wrong input mode - ITU-T" ), __LINE__ ) ); |
|
369 } |
|
370 else if ( aDevice == EPluginInputModeFSQ ) |
|
371 { |
|
372 __ASSERT_DEBUG( FeatureManager::FeatureSupported( |
|
373 KFeatureIdVirtualFullscrQwertyInput ), |
|
374 User::Panic( _L( "Wrong input mode - Landscape FSQ" ), |
|
375 __LINE__ ) ); |
|
376 } |
|
377 else if ( aDevice == EPluginInputModePortraitFSQ ) |
|
378 { |
|
379 __ASSERT_DEBUG( FeatureManager::FeatureSupported( |
|
380 KFeatureIdFfVirtualFullscrPortraitQwertyInput ), |
|
381 User::Panic( _L( "Wrong input mode - Portrait FSQ" ), |
|
382 __LINE__ ) ); |
|
383 } |
|
384 else |
|
385 { |
|
386 // Do nothing. |
|
387 } |
|
388 |
362 if (iAknFepRepository) |
389 if (iAknFepRepository) |
363 { |
390 { |
364 iAknFepRepository->Set(KAknFepLastUsedInput, aDevice); |
391 iAknFepRepository->Set(KAknFepLastUsedInput, aDevice); |
365 } |
392 } |
366 } |
393 } |
1889 iAknFepRepository->Set(KAknFepDefaultArabicNumberMode, aValue); |
1916 iAknFepRepository->Set(KAknFepDefaultArabicNumberMode, aValue); |
1890 } |
1917 } |
1891 } |
1918 } |
1892 #endif |
1919 #endif |
1893 |
1920 |
|
1921 /** |
|
1922 * Get the last used plugin input mode for portrait orientation |
|
1923 * |
|
1924 * @since 5.2 |
|
1925 * @return Value of KAknFepLastUsedPortraitInput setting. |
|
1926 */ |
|
1927 TPluginInputMode CAknFepSharedDataInterface::PluginPortraitInputMode() const |
|
1928 { |
|
1929 TInt cenRepValue( 0 ); |
|
1930 if ( iAknFepRepository ) |
|
1931 { |
|
1932 iAknFepRepository->Get( KAknFepLastUsedPortraitInput, cenRepValue ); |
|
1933 } |
|
1934 |
|
1935 TPluginInputMode lastUsedPortraitInputMode = |
|
1936 static_cast<TPluginInputMode>( cenRepValue ); |
|
1937 |
|
1938 // Check portrait FSQ and ITU-T feature are enabled. |
|
1939 TBool isPortraitFSQEnabled = FeatureManager::FeatureSupported( |
|
1940 KFeatureIdFfVirtualFullscrPortraitQwertyInput ); |
|
1941 TBool isITUTEnabled = FeatureManager::FeatureSupported( |
|
1942 KFeatureIdVirtualItutInput ); |
|
1943 |
|
1944 // If both ITU-T and portrait FSQ features are enabled, use the saved |
|
1945 // portrait input mode. |
|
1946 if ( isITUTEnabled && isPortraitFSQEnabled ) |
|
1947 { |
|
1948 // If the saved portrait input mode is not valid, use the default |
|
1949 // value, EPluginInputModeItut. |
|
1950 if ( ! ( lastUsedPortraitInputMode == EPluginInputModeItut || |
|
1951 lastUsedPortraitInputMode == EPluginInputModePortraitFSQ ) ) |
|
1952 { |
|
1953 lastUsedPortraitInputMode = EPluginInputModeItut; |
|
1954 } |
|
1955 } |
|
1956 // If only ITU-T feature is enabled, use the mode. |
|
1957 else if ( isITUTEnabled ) |
|
1958 { |
|
1959 lastUsedPortraitInputMode = EPluginInputModeItut; |
|
1960 } |
|
1961 // If only portrait FSQ feature is enabled, use the mode. |
|
1962 else if ( isPortraitFSQEnabled ) |
|
1963 { |
|
1964 lastUsedPortraitInputMode = EPluginInputModePortraitFSQ; |
|
1965 } |
|
1966 // If none of the features are enabled, EPluginInputModeNone is assigned |
|
1967 // for exception handling. |
|
1968 else |
|
1969 { |
|
1970 lastUsedPortraitInputMode = EPluginInputModeNone; |
|
1971 } |
|
1972 |
|
1973 return lastUsedPortraitInputMode; |
|
1974 } |
|
1975 |
|
1976 /** |
|
1977 * Replaces the last used plugin input mode for portrait orientation |
|
1978 * |
|
1979 * @since 5.2 |
|
1980 * @return Replace value of KAknFepLastUsedPortraitInput setting. |
|
1981 */ |
|
1982 void CAknFepSharedDataInterface::SetPluginPortraitInputMode( |
|
1983 TPluginInputMode aLastUsedPortraitInputMode ) |
|
1984 { |
|
1985 // Check validity of the input mode to be set. The input mode is not |
|
1986 // valid if, |
|
1987 // i) The input mode is not neither ITU-T nor portrait FSQ. |
|
1988 if ( !( aLastUsedPortraitInputMode == EPluginInputModeItut || |
|
1989 aLastUsedPortraitInputMode == EPluginInputModePortraitFSQ ) || |
|
1990 // ii) The input mode is ITU-T but the feature is disabled. |
|
1991 ( aLastUsedPortraitInputMode == EPluginInputModeItut && |
|
1992 !FeatureManager::FeatureSupported( KFeatureIdVirtualItutInput ) ) || |
|
1993 // iii) The input mode is portrait FSQ but the feature is disabled. |
|
1994 ( aLastUsedPortraitInputMode == EPluginInputModePortraitFSQ && |
|
1995 !FeatureManager::FeatureSupported( |
|
1996 KFeatureIdFfVirtualFullscrPortraitQwertyInput ) ) ) |
|
1997 { |
|
1998 __ASSERT_DEBUG( 0, |
|
1999 User::Panic( _L( "Wrong portrait input mode" ), __LINE__ ) ); |
|
2000 // Return without saving the value if the portrait input is invalid. |
|
2001 return; |
|
2002 } |
|
2003 |
|
2004 if ( iAknFepRepository ) |
|
2005 { |
|
2006 TInt err = iAknFepRepository->Set( KAknFepLastUsedPortraitInput, |
|
2007 static_cast<TInt>( aLastUsedPortraitInputMode ) ); |
|
2008 } |
|
2009 } |
|
2010 |
1894 // End of File |
2011 // End of File |