phoneengine/phonemodel/src/cpeexternaldatahandler.cpp
changeset 21 92ab7f8d0eab
parent 0 5f000ab63145
child 22 6bb1b21d2484
--- a/phoneengine/phonemodel/src/cpeexternaldatahandler.cpp	Tue Feb 02 00:10:04 2010 +0200
+++ b/phoneengine/phonemodel/src/cpeexternaldatahandler.cpp	Fri Mar 19 09:28:42 2010 +0200
@@ -26,14 +26,16 @@
 #include <ctsydomainpskeys.h>
 #include <mpedatastore.h>
 #include <pepanic.pan>
-#include <SettingsInternalCRKeys.h>
+#include <settingsinternalcrkeys.h>
 #include <talogger.h>
 #include <telephonyvariant.hrh>
 #include <telinternalcrkeys.h>
 
 
 // CONSTANTS
-const TInt KPrefixLength = 10;
+// <-- QT PHONE START -->
+//const TInt KPrefixLength = 10;
+// <-- QT PHONE END -->
 
 CPEExternalDataHandler* CPEExternalDataHandler::NewL( MPEPhoneModelInternal& aModel )
     {
@@ -86,18 +88,24 @@
 
     // Instantiate monitor objects
     iAudioOutputPreferenceMonitor = CPEAudioOutputPreferenceMonitor::NewL( aModel );
-    iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL();
+    // <-- QT PHONE START -->
     iEarVolumeSetting = CPEIncallEarVolumeSettingMonitor::NewL( aModel );
     iLoudspeakerVolumeSetting = CPEIncallLoudspeakerVolumeSettingMonitor::NewL( aModel );
+    iCallDurationDisplay = CPECallDurationDisplaySettingMonitor::NewL(); 
+    iProfileSettings = CPEProfileSettingMonitor::NewL( aModel );
+    
+    //TODO
+    /*
     iNetworkRegistrationStatus = CPENetworkRegistrationStatusMonitor::NewL( aModel );
-    iProfileSettings = CPEProfileSettingMonitor::NewL( aModel );
     iAccessoryModeMonitor = CPEAccessoryModeMonitor::NewL(); 
 
     // Instantiate repository objects for later use
-    iAccessorySettingsRepository = CRepository::NewL( KCRUidAccessorySettings );
-    iTelephonySettingsRepository = CRepository::NewL( KCRUidTelephonySettings );
+    iAccessorySettingsRepository = CRepository::NewL( KCRUidAccessorySettings );*/
+    //iTelephonySettingsRepository = CRepository::NewL( KCRUidTelephonySettings );
     iTelephonyVariationRepository = CRepository::NewL( KCRUidTelVariation );
-    iCoreApplicationRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); 
+    //iCoreApplicationRepository = CRepository::NewL( KCRUidCoreApplicationUIs ); 
+    TEFLOGSTRING( KTAOBJECT, "PE CPEExternalDataHandler::BaseConstructL 2" );
+    // <-- QT PHONE END -->
     }
 
 // -----------------------------------------------------------------------------
@@ -112,8 +120,42 @@
     {
     TInt errorCode( KErrNotFound );
 
+    // <-- QT PHONE START -->
+    //TODO
+
+    if ( EPETelephonyVariationFlags == aSetting )
+        {
+        errorCode = iTelephonyVariationRepository->Get( KTelVariationFlags, aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPETelephonyVariationFlags, error code: %d", errorCode );
+        }
+    else if ( EPEAudioOutputPreference == aSetting )
+        {
+        errorCode = iAudioOutputPreferenceMonitor->Get( aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode );
+        }
+    else if ( EPEIncallEarVolumeSetting == aSetting )
+        {
+        errorCode = iEarVolumeSetting->Get( aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallEarVolumeSetting, error code: %d", errorCode );
+        }
+    else if ( EPEIncallLoudspeakerVolumeSetting == aSetting )
+        {
+        errorCode = iLoudspeakerVolumeSetting->Get( aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEIncallLoudspeakerVolumeSetting, error code: %d", errorCode );
+        }
+    else if ( EPECallDurationDisplaySetting == aSetting )
+        {
+        errorCode = iCallDurationDisplay->Get( aValue );
+        TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode );
+        }
+    else
+        {
+        errorCode = KErrNone;
+        aValue = 0;        
+        }
+    
     // Process Common id
-    switch ( aSetting )
+    /*switch ( aSetting )
         {
         case EPEAutomaticAnswerHeadsetSetting:
             {
@@ -151,12 +193,6 @@
             TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPEAudioOutputPreference, error code: %d", errorCode );
             break;
             }
-        case EPECallDurationDisplaySetting:
-            {
-            errorCode = iCallDurationDisplay->Get( aValue );
-            TEFLOGSTRING2( KTAINT, "CPEExternalDataHandler::Get EPECallDurationDisplaySetting, error code: %d", errorCode );
-            break;
-            }
         case EPEDialPrefixChangeSetting:
             {
             errorCode = iTelephonySettingsRepository->Get( KSettingsDialPrefixChangeMode, aValue );
@@ -210,8 +246,8 @@
                 "PE CPEEXTERNALDATAHANDLER::GET UNKNOWN SETTING ID ! %d", aSetting );
             break;
             }
-        }
-
+        }*/
+    // <-- QT PHONE END -->
     return errorCode;
     }
 
@@ -222,13 +258,16 @@
 // -----------------------------------------------------------------------------
 //
 TInt CPEExternalDataHandler::GetText(
-        const TPEExternalDataId aSetting,
+        const TPEExternalDataId /*aSetting*/,
         TDesC& aValue ) const
     {
     TInt errorCode( KErrNotFound );
-
+    // <-- QT PHONE START -->
+    //TODO
+    aValue = KNullDesC;
+    errorCode = KErrNone;
     // Process Common id
-    switch ( aSetting )
+    /*switch ( aSetting )
         {
         case EPEDialPrefixTextSetting:
             {
@@ -249,8 +288,8 @@
                 "PE CPEEXTERNALDATAHANDLER::GETTEXT UNKNOWN SETTING ID ! %d", aSetting );
             break;
             }
-        }
-
+        }*/
+    // <-- QT PHONE END -->
     return errorCode;
     }
 
@@ -260,15 +299,17 @@
 // -----------------------------------------------------------------------------
 //
 TInt CPEExternalDataHandler::GetAutomaticAnswer(
-        TUint32 aSetting,
+        TUint32 /*aSetting*/,
         TInt& aValue ) const
     {
     TInt errorCode( KErrNotFound );
     
     TEFLOGSTRING( KTAINT, "CPEExternalDataHandler::GetAutomaticAnswer" );
-   
-    errorCode = iAccessorySettingsRepository->Get( aSetting, aValue );
-     
+    // <-- QT PHONE START -->
+    //errorCode = iAccessorySettingsRepository->Get( aSetting, aValue );
+    errorCode = KErrNone;
+    aValue = 0;
+    // <-- QT PHONE END -->
     return errorCode;
     }
 
@@ -285,6 +326,7 @@
 
     switch ( aSetting )
         {
+        // <-- QT PHONE START -->
         case EPEIncallEarVolumeSetting:
             {
             errorCode = iEarVolumeSetting->Set( aValue );
@@ -295,6 +337,7 @@
             errorCode = iLoudspeakerVolumeSetting->Set( aValue );
             break;
             }
+        // <-- QT PHONE END -->
         case EPEEmergencyCallInfo:
             {
             errorCode = RProperty::Set( KPSUidCtsyEmergencyCallInfo,