gssettingsuis/Gs/GSCallPlugin/src/GSCallPluginModel.cpp
branchRCL_3
changeset 24 8ee96d21d9bf
parent 23 8bda91a87a00
child 25 7e0eff37aedb
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
     1 /*
       
     2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *        Model/Engine for Call Settings Plugin
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "GSCallPluginModel.h"
       
    22 #include "GsLogger.h"      //for logging traces
       
    23 #include "SettingsPrivateCRKeys.h"
       
    24 
       
    25 #include <barsc.h>
       
    26 #include <barsread.h>
       
    27 #include <coecntrl.h>
       
    28 #include <f32file.h>
       
    29 #include <AknQueryDialog.h>
       
    30 #include <s32file.h>
       
    31 #include <featmgr.h>
       
    32 #include <PsetCSP.h>
       
    33 #include <generalsettingsvariant.hrh>
       
    34 #include <PSVariables.h>  //PubSub 
       
    35 #include <settingsinternalcrkeys.h>
       
    36 #include <LogsDomainCRKeys.h>
       
    37 
       
    38 #if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
       
    39 #include <spsettings.h>
       
    40 #endif // __VOIP && RD_VOIP_REL_2_2
       
    41 //CONSTANTS
       
    42 // default value for autolock period
       
    43 // default value for Sat operations
       
    44 
       
    45 _LIT( KGSNameOfClass, "CGSCallPluginModel" );
       
    46 
       
    47 // Max int size
       
    48 
       
    49 //for switching values in SwitchValue()
       
    50 const TInt KGSSettingOff = 0;
       
    51 const TInt KGSSettingOn = 1;
       
    52 const TInt KGSIndexOff = 1;
       
    53 const TInt KGSIndexOn = 0;
       
    54 
       
    55 // ================= MEMBER FUNCTIONS =======================
       
    56 
       
    57 // ----------------------------------------------------------------------------
       
    58 // CGSCallPluginModel::NewL
       
    59 // 
       
    60 // Symbian OS two-phased constructor
       
    61 // ----------------------------------------------------------------------------
       
    62 //
       
    63 CGSCallPluginModel* CGSCallPluginModel::NewL()
       
    64     {
       
    65     CGSCallPluginModel* self = new( ELeave ) CGSCallPluginModel;
       
    66     CleanupStack::PushL( self );
       
    67     self->ConstructL();
       
    68 
       
    69     CleanupStack::Pop( self );
       
    70     return self;
       
    71     }
       
    72 
       
    73 
       
    74 // ----------------------------------------------------------------------------
       
    75 // CGSCallPluginModel::CGSCallPluginModel
       
    76 // 
       
    77 // C++ default constructor can NOT contain any code, that
       
    78 // might leave.
       
    79 // ----------------------------------------------------------------------------
       
    80 //
       
    81 CGSCallPluginModel::CGSCallPluginModel()
       
    82     {
       
    83     }
       
    84 
       
    85 
       
    86 // ----------------------------------------------------------------------------
       
    87 // CGSCallPluginModel::ConstructL
       
    88 // 
       
    89 // EPOC default constructor can leave.
       
    90 // ----------------------------------------------------------------------------
       
    91 //
       
    92 void CGSCallPluginModel::ConstructL()
       
    93     {
       
    94     FeatureManager::InitializeLibL();
       
    95 
       
    96     InitializeCentralRepositoryL();
       
    97 
       
    98     iBackgroundApi = CGSBackgroundImage::NewL();
       
    99 
       
   100     SetCSPActiveL( ETrue );
       
   101 
       
   102     User::LeaveIfError( iGSVariationRepository->Get( 
       
   103                         KSettingsVariationFlags, iLocalVariationValues ) );
       
   104 #if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
       
   105 	iSpSettings = CSPSettings::NewL();  
       
   106 #endif // __VOIP && RD_VOIP_REL_2_2
       
   107     }
       
   108 
       
   109 
       
   110 // ----------------------------------------------------------------------------
       
   111 // CGSCallPluginModel::~CGSCallPluginModel
       
   112 // 
       
   113 // Destructor
       
   114 // ----------------------------------------------------------------------------
       
   115 //
       
   116 CGSCallPluginModel::~CGSCallPluginModel()
       
   117     {
       
   118     FeatureManager::UnInitializeLib();
       
   119 	UninitializeCentralRepository();
       
   120     
       
   121     if ( GetCSPStatus() )
       
   122         {
       
   123         TRAP_IGNORE( SetCSPActiveL( EFalse ) );
       
   124         }
       
   125     
       
   126     if ( iBackgroundApi )
       
   127         {
       
   128         delete iBackgroundApi;
       
   129         }
       
   130     
       
   131 #if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
       
   132     delete iSpSettings;
       
   133 #endif // __VOIP && RD_VOIP_REL_2_2
       
   134     }
       
   135 
       
   136 // ----------------------------------------------------------------------------
       
   137 // CGSCallPluginModel::InitializeCentralRepositoryL
       
   138 //
       
   139 // Creating and setting keys for the Central Repository
       
   140 // ----------------------------------------------------------------------------
       
   141 //
       
   142 void CGSCallPluginModel::InitializeCentralRepositoryL()
       
   143     {
       
   144     iTelephonyRepository = CRepository::NewL( KCRUidTelephonySettings );
       
   145     iCommonTelephonyRepository = 
       
   146             CRepository::NewL( KCRUidCommonTelephonySettings );
       
   147     iGSVariationRepository = CRepository::NewL( KCRUidSettingsVariation );
       
   148     iRichCallRepository = CRepository::NewL( KCRUidRichCallSettings );
       
   149     iLogsRepository = CRepository::NewL( KCRUidLogs );
       
   150     }
       
   151 
       
   152 // ----------------------------------------------------------------------------
       
   153 // CGSCallPluginModel::UninitializeCentralRepositoryL
       
   154 //
       
   155 // Removes Central Repository objects
       
   156 // ----------------------------------------------------------------------------
       
   157 //
       
   158 void CGSCallPluginModel::UninitializeCentralRepository()
       
   159     {
       
   160     if ( iTelephonyRepository )
       
   161         {
       
   162         delete iTelephonyRepository;
       
   163         iTelephonyRepository = NULL;
       
   164         }
       
   165     if ( iCommonTelephonyRepository )
       
   166         {
       
   167         delete iCommonTelephonyRepository;
       
   168         iCommonTelephonyRepository = NULL;
       
   169         }
       
   170     if ( iGSVariationRepository )
       
   171         {
       
   172         delete iGSVariationRepository;
       
   173         iGSVariationRepository = NULL;
       
   174         }
       
   175     if ( iRichCallRepository )
       
   176         {
       
   177         delete iRichCallRepository;
       
   178         iRichCallRepository = NULL;
       
   179         }
       
   180     if ( iLogsRepository )
       
   181         {
       
   182         delete iLogsRepository;
       
   183         iLogsRepository = NULL;
       
   184         }
       
   185     }
       
   186 
       
   187 
       
   188 // ----------------------------------------------------------------------------
       
   189 // CGSCallPluginModel::GetCallSettingValue
       
   190 // Gets one of the call related values (anykey answer, automatic redial,
       
   191 // summary after call or one key dialing) from Central Repository (Working OK)
       
   192 // ----------------------------------------------------------------------------
       
   193 //
       
   194 TInt CGSCallPluginModel::GetCallSettingValue( const TCallSettId aCallId,
       
   195                                             TInt& aId )
       
   196     {
       
   197     TInt ret = KErrNone;
       
   198     if ( aCallId == EGSSummaryAfterCall )
       
   199         {
       
   200         ret = 
       
   201             iCommonTelephonyRepository->Get( KSettingsSummaryAfterCall, aId );
       
   202         }
       
   203     else
       
   204         {        
       
   205         switch ( aCallId )
       
   206             {     
       
   207             case EGSOpeningSlideAnswerCall:
       
   208                 ret = iTelephonyRepository->
       
   209                     Get( KSettingsOpeningSlideAnswer, aId );
       
   210                 break;
       
   211             case EGSClosingSlideEndCall:
       
   212                 ret = iTelephonyRepository->
       
   213                     Get( KSettingsClosingSlideEnd, aId );
       
   214                 break;            
       
   215             case EGSSoftRejectDefault:
       
   216                 ret = iTelephonyRepository->
       
   217                    Get( KSettingsSoftRejectDefaultInUse, aId );
       
   218                 break;
       
   219             default:
       
   220                 break;
       
   221             };
       
   222         }
       
   223     return ret;
       
   224     }
       
   225 
       
   226 // ----------------------------------------------------------------------------
       
   227 // CGSCallPluginModel::SetCallSettingValue
       
   228 // Sets one of the call related values (anykey answer, automatic redial,
       
   229 // summary after call or one key dialing) from Central Repository (working OK)
       
   230 // ----------------------------------------------------------------------------
       
   231 //
       
   232 TInt CGSCallPluginModel::SetCallSettingValue( const TCallSettId aCallId,
       
   233                                             TInt aId )
       
   234     {
       
   235     TInt ret = KErrNone;
       
   236     if ( aCallId == EGSSummaryAfterCall )
       
   237         {
       
   238         ret = 
       
   239             iCommonTelephonyRepository->Set( KSettingsSummaryAfterCall, aId );
       
   240         }
       
   241     else
       
   242         {
       
   243         switch ( aCallId )
       
   244             {
       
   245             case EGSOpeningSlideAnswerCall:
       
   246                 ret = iTelephonyRepository->
       
   247                     Set( KSettingsOpeningSlideAnswer, aId );
       
   248                 break;
       
   249             case EGSClosingSlideEndCall:
       
   250                 ret = iTelephonyRepository->
       
   251                     Set( KSettingsClosingSlideEnd, aId );
       
   252                 break;    
       
   253             case EGSSoftRejectDefault:
       
   254                 ret = iTelephonyRepository->
       
   255                     Set( KSettingsSoftRejectDefaultInUse, aId );
       
   256                 break;
       
   257             default:
       
   258                 break;
       
   259             };
       
   260         }
       
   261         
       
   262     return ret;
       
   263     }
       
   264 
       
   265 
       
   266 // ----------------------------------------------------------------------------
       
   267 // CGSCallPluginModel::GetCSPStatus
       
   268 // 
       
   269 // Get Customer Service Profile status
       
   270 // ----------------------------------------------------------------------------
       
   271 //
       
   272 TBool CGSCallPluginModel::GetCSPStatus()
       
   273     {
       
   274     if ( iCSP )
       
   275         {
       
   276         return ETrue;
       
   277         }
       
   278     else
       
   279         {
       
   280         return EFalse;
       
   281         }    
       
   282     }
       
   283 
       
   284 // ----------------------------------------------------------------------------
       
   285 // CGSCallPluginModel::SetCSPActiveL
       
   286 // 
       
   287 // Set Customer Service Profile active
       
   288 // ----------------------------------------------------------------------------
       
   289 //
       
   290 void CGSCallPluginModel::SetCSPActiveL( TBool aValue )
       
   291     {
       
   292     if ( aValue )
       
   293         {
       
   294         iCSP = CPsetCustomerServiceProfile::NewL();
       
   295         User::LeaveIfError( iCSP->OpenCSProfileL() );
       
   296         }
       
   297     else
       
   298         {        
       
   299         delete iCSP;
       
   300         iCSP = NULL;
       
   301         }
       
   302     }
       
   303 
       
   304 // ----------------------------------------------------------------------------
       
   305 // CGSCallPluginModel::IsSettingSupported
       
   306 // 
       
   307 // Check if a given setting is supported
       
   308 // ----------------------------------------------------------------------------
       
   309 //
       
   310 TBool CGSCallPluginModel::IsSettingSupported( TInt aSettingNumber )
       
   311     {
       
   312     __ASSERT_ALWAYS( iCSP != NULL, User::Panic( KGSNameOfClass, 
       
   313                                    EGSCallPluinModelPanicNullPtr ) );
       
   314     TBool settingSupported = EFalse;
       
   315     TInt retVal = KErrNone;
       
   316 
       
   317     switch ( aSettingNumber )
       
   318         {
       
   319         case EGSCSPCallWaiting:
       
   320             retVal = iCSP->IsCWSupported( settingSupported );
       
   321             break;
       
   322         case EGSCSPAlternateLine:
       
   323             retVal = iCSP->IsALSSupported( settingSupported );
       
   324             break;
       
   325         default:
       
   326             break;
       
   327         }
       
   328     if ( retVal != KErrNone )
       
   329         {
       
   330         //if a CSP error occurs, by default service is available
       
   331         settingSupported = ETrue;
       
   332         }
       
   333 
       
   334     return settingSupported;
       
   335     }
       
   336 
       
   337 
       
   338 // ----------------------------------------------------------------------------
       
   339 // CGSCallPluginModel::GetSoftRejectText
       
   340 // Gets soft reject text from shared data.
       
   341 // ----------------------------------------------------------------------------
       
   342 //
       
   343 TBool CGSCallPluginModel::GetSoftRejectText( TDes& aText )
       
   344     {
       
   345     TInt ret = iTelephonyRepository->Get( KSettingsSoftRejectText, aText );
       
   346     return ret;
       
   347     }
       
   348 
       
   349 // ----------------------------------------------------------------------------
       
   350 // CGSCallPluginModel::SetSoftRejectText
       
   351 // Sets user defined text to shared data for soft reject.
       
   352 // ----------------------------------------------------------------------------
       
   353 //
       
   354 TBool CGSCallPluginModel::SetSoftRejectText( TDes& aText )
       
   355     {
       
   356     TInt ret = iTelephonyRepository->Set( KSettingsSoftRejectText, aText );
       
   357     return ret;
       
   358     }
       
   359 
       
   360 
       
   361 // ----------------------------------------------------------------------------
       
   362 // CGSCallPluginModel::VTStillImageL
       
   363 // 
       
   364 // VT Still Image mode.
       
   365 // ----------------------------------------------------------------------------
       
   366 //
       
   367 TInt CGSCallPluginModel::VTStillImageL()
       
   368     {
       
   369     TInt StImg = KGSSettingOff;
       
   370     
       
   371     User::LeaveIfError( iTelephonyRepository->Get( KSettingsVTStillImage, 
       
   372                                                    StImg ) );
       
   373     return StImg;
       
   374     }
       
   375 
       
   376 // ----------------------------------------------------------------------------
       
   377 // CGSCallPluginModel::SetVTStillImageL
       
   378 // 
       
   379 // Sets VT Still Image mode to Shared Data
       
   380 // ----------------------------------------------------------------------------
       
   381 //
       
   382 void CGSCallPluginModel::SetVTStillImageL( const TInt aValue )
       
   383     {
       
   384     User::LeaveIfError( iTelephonyRepository->Set( KSettingsVTStillImage, 
       
   385                                                    aValue ) );
       
   386     }
       
   387 
       
   388 
       
   389 // ----------------------------------------------------------------------------
       
   390 // CGSCallPluginModel::PrefixChangeModeL
       
   391 // 
       
   392 // Get the Japanese prefix change mode value from shared data.
       
   393 // ----------------------------------------------------------------------------
       
   394 //
       
   395 TInt CGSCallPluginModel::PrefixChangeModeL()
       
   396     {
       
   397     TInt mode = KGSSettingOff;
       
   398     User::LeaveIfError( iTelephonyRepository->
       
   399                 Get( KSettingsDialPrefixChangeMode, mode ) );
       
   400     SwitchValue( mode );
       
   401     return mode;
       
   402     }
       
   403 
       
   404 
       
   405 // ----------------------------------------------------------------------------
       
   406 // CGSCallPluginModel::SetPrefixChangeModeL
       
   407 // 
       
   408 // Set the Japanese prefix change mode value to shared data. CenRep OK
       
   409 // ----------------------------------------------------------------------------
       
   410 //
       
   411 void CGSCallPluginModel::SetPrefixChangeModeL( TInt aMode )
       
   412     {
       
   413     SwitchValue( aMode );
       
   414     User::LeaveIfError( iTelephonyRepository->
       
   415                 Set( KSettingsDialPrefixChangeMode, aMode ) );
       
   416     }
       
   417 
       
   418 
       
   419 // ----------------------------------------------------------------------------
       
   420 // CGSCallPluginModel::PrefixChangeDataL
       
   421 // 
       
   422 // Reads prefix change text from shared data and returns it
       
   423 // ----------------------------------------------------------------------------
       
   424 //
       
   425 void CGSCallPluginModel::PrefixChangeDataL( TDes& aText )
       
   426     {
       
   427     User::LeaveIfError( iTelephonyRepository->
       
   428                 Get( KSettingsDialPrefixText, aText ) );
       
   429     }
       
   430 
       
   431 // ----------------------------------------------------------------------------
       
   432 // CGSCallPluginModel::SetPrefixChangeDataL
       
   433 // 
       
   434 // Writes prefix change text to shared data
       
   435 // ----------------------------------------------------------------------------
       
   436 //
       
   437 void CGSCallPluginModel::SetPrefixChangeDataL( const TDesC& aText )
       
   438     {
       
   439     User::LeaveIfError( iTelephonyRepository->
       
   440                 Set( KSettingsDialPrefixText, aText ) );
       
   441     }
       
   442 
       
   443 
       
   444 // ----------------------------------------------------------------------------
       
   445 // CGSCallPluginModel::SwitchValue
       
   446 // 
       
   447 // Switching value from 1 to 0 and back
       
   448 // ----------------------------------------------------------------------------
       
   449 //
       
   450 void CGSCallPluginModel::SwitchValue( TInt& aValue )
       
   451     {
       
   452     switch( aValue )   
       
   453         {
       
   454         case KGSSettingOff: //0
       
   455             aValue = KGSIndexOff; //1
       
   456             break;
       
   457         case KGSSettingOn: //1
       
   458             aValue = KGSIndexOn; //0
       
   459             break;
       
   460         default:
       
   461             aValue = KErrNotFound;
       
   462         };
       
   463     }
       
   464 
       
   465 
       
   466 // ---------------------------------------------------------
       
   467 // CGSCallPluginModel::RestrictedSendCallerIdSupportedL
       
   468 // 
       
   469 // Check if Restricted Send Caller ID is supported.
       
   470 // ---------------------------------------------------------
       
   471 //
       
   472 TBool CGSCallPluginModel::RestrictedSendCallerIdSupportedL()
       
   473     {
       
   474     TBool supported = EFalse;    
       
   475 
       
   476     if ( iLocalVariationValues & EGSConfigRestrictedSendCallerId )
       
   477         {
       
   478         supported = ETrue;
       
   479         }
       
   480 
       
   481     return supported;
       
   482 
       
   483     }
       
   484 
       
   485 // ---------------------------------------------------------
       
   486 // CGSCallPluginModel::SecureSendCallerIdSupportedL
       
   487 // 
       
   488 // Check if Secure Send Caller ID is supported.
       
   489 // ---------------------------------------------------------
       
   490 //
       
   491 TBool CGSCallPluginModel::SecureSendCallerIdSupportedL()
       
   492     {
       
   493     TBool supported = EFalse;    
       
   494 
       
   495     if ( iLocalVariationValues & EGSConfigSecureSendCallerId )
       
   496         {
       
   497         supported = ETrue;
       
   498         }
       
   499 
       
   500     return supported;
       
   501 
       
   502     }
       
   503 
       
   504 // ----------------------------------------------------------------------------
       
   505 // CGSCallPluginModel::GetVoIPCallSettingValue
       
   506 // Gets one of the VoIP call related values (send my Int. call id, 
       
   507 // Internet call waiting, preferred call type, do not disturb or 
       
   508 // Internet call barring) from Central Repository
       
   509 // ----------------------------------------------------------------------------
       
   510 //
       
   511 TInt CGSCallPluginModel::GetVoIPCallSettingValue( 
       
   512     const TGSVoIPSetting aVoipSettingId, TInt& aVoipId ) 
       
   513     {
       
   514     TInt ret( KErrNone );
       
   515    
       
   516     switch ( aVoipSettingId )
       
   517         {
       
   518         case EGSVoIPSendIntCallId:
       
   519             ret = iRichCallRepository->Get( KRCSEClir, aVoipId );
       
   520             break;
       
   521         case EGSVoIPCW:
       
   522             ret = iRichCallRepository->Get( KRCSPSCallWaiting, aVoipId );
       
   523             break;
       
   524         case EGSVoIPPreType:
       
   525             ret = iRichCallRepository->Get( KRCSEPreferredTelephony, aVoipId );
       
   526             break;
       
   527         case EGSVoIPDnd:
       
   528             ret = iRichCallRepository->Get( KRCSEDoNotDisturb, aVoipId );
       
   529             break;
       
   530         case EGSVoIPBarring:
       
   531             ret = iRichCallRepository->Get( KRCSEAnonymousCallBlockRule, aVoipId );
       
   532             break;
       
   533         default:
       
   534             break;
       
   535         }
       
   536     
       
   537     return ret;
       
   538     }
       
   539 
       
   540 // ----------------------------------------------------------------------------
       
   541 // CGSCallPluginModel::SetVoIPCallSettingValue
       
   542 // Sets one of the VoIP call related values (send my Int. call id, 
       
   543 // Internet call waiting, preferred call type, do not disturb or 
       
   544 // Internet call barring) from Central Repository
       
   545 // ----------------------------------------------------------------------------
       
   546 //
       
   547 TInt CGSCallPluginModel::SetVoIPCallSettingValue( 
       
   548     const TGSVoIPSetting aVoipSettingId, TInt aVoipId )
       
   549     {
       
   550     TInt ret( KErrNone );
       
   551     
       
   552     switch( aVoipSettingId )
       
   553         {
       
   554         case EGSVoIPSendIntCallId:
       
   555             ret = iRichCallRepository->Set( KRCSEClir, aVoipId );
       
   556             break;
       
   557         case EGSVoIPCW:
       
   558             ret = iRichCallRepository->Set( KRCSPSCallWaiting, aVoipId );
       
   559             break;
       
   560         case EGSVoIPPreType:
       
   561             ret = iRichCallRepository->Set( KRCSEPreferredTelephony, aVoipId );
       
   562             break;
       
   563         case EGSVoIPDnd:
       
   564             ret = iRichCallRepository->Set( KRCSEDoNotDisturb, aVoipId );
       
   565             break;
       
   566         case EGSVoIPBarring:
       
   567             ret = iRichCallRepository->Set( KRCSEAnonymousCallBlockRule, aVoipId );
       
   568             break;
       
   569         default:
       
   570             break;
       
   571         }
       
   572         
       
   573     return ret;    
       
   574     }
       
   575     
       
   576 // ----------------------------------------------------------------------------
       
   577 // CGSCallPluginModel::GetSCCPStatus
       
   578 // Gets SCCP status from Central Repository
       
   579 // ----------------------------------------------------------------------------
       
   580 //
       
   581 TInt CGSCallPluginModel::GetSCCPStatus( TInt& aStatus )
       
   582     {
       
   583     TInt ret( KErrNone );
       
   584     ret = iTelephonyRepository->Get( KSCCPinstallUpgrade, aStatus );
       
   585     return ret;
       
   586     }
       
   587 
       
   588 
       
   589 // ----------------------------------------------------------------------------
       
   590 // CGSCallPluginModel::CallDurationL
       
   591 // 
       
   592 // Get the Call duration setting value
       
   593 // ----------------------------------------------------------------------------
       
   594 //
       
   595 TInt CGSCallPluginModel::CallDurationL()
       
   596     {
       
   597     TInt value = KGSSettingOff;
       
   598     User::LeaveIfError( iLogsRepository->
       
   599                 Get( KLogsShowCallDuration, value ) );
       
   600     
       
   601 	SwitchValue ( value );
       
   602 
       
   603     return value;
       
   604     }
       
   605 
       
   606 
       
   607 // ----------------------------------------------------------------------------
       
   608 // CGSCallPluginModel::SetCallDurationL
       
   609 // 
       
   610 // Set the Call duration setting value
       
   611 // ----------------------------------------------------------------------------
       
   612 //
       
   613 void CGSCallPluginModel::SetCallDurationL( TInt aValue )
       
   614     {
       
   615     SwitchValue ( aValue );
       
   616     User::LeaveIfError( iLogsRepository->
       
   617                 Set( KLogsShowCallDuration, aValue ) );
       
   618     }
       
   619 
       
   620 // ---------------------------------------------------------
       
   621 // CGSTelPluginModel::VoIPSupported
       
   622 // 
       
   623 // Check if VoIP is supported.
       
   624 // ---------------------------------------------------------
       
   625 //    
       
   626 TBool CGSCallPluginModel::VoIPSupported()
       
   627     {
       
   628     TInt supported( KGSSettingOff );
       
   629 #if defined(__VOIP) && defined(RD_VOIP_REL_2_2)
       
   630     if ( iSpSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
       
   631         iSpSettings->IsFeatureSupported( ESupportVoIPSSFeature ) )
       
   632         {
       
   633         supported = KGSSettingOn;
       
   634         }
       
   635 #else // __VOIP && RD_VOIP_REL_2_2
       
   636     if ( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
       
   637         {
       
   638         iTelephonyRepository->Get( KDynamicVoIP, supported );
       
   639         }
       
   640 #endif // __VOIP && RD_VOIP_REL_2_2
       
   641     return KGSSettingOff != supported;
       
   642     }
       
   643 
       
   644 // ----------------------------------------------------------------------------
       
   645 // CGSCallPluginModel::LongPressCallKeyL
       
   646 // 
       
   647 // Get the Long Press Call Key setting value
       
   648 // 0,1 --> Inactive (Default value is 1 and when RFS Default value is 0) 
       
   649 // 2 --> Video call
       
   650 // ----------------------------------------------------------------------------
       
   651 //
       
   652 TInt CGSCallPluginModel::LongPressCallKeyL()
       
   653     {
       
   654     TInt value = EGSLongPressCallKeyVoiceCall;
       
   655   #ifdef RD_VT_LONG_SEND_KEY
       
   656     User::LeaveIfError( iTelephonyRepository->
       
   657                 Get( KSettingsUiLongCallKeyPress, value ) );
       
   658   #endif
       
   659     return value;
       
   660     }
       
   661 
       
   662 // ----------------------------------------------------------------------------
       
   663 // CGSCallPluginModel::SetLongPressCallKeyL
       
   664 // 
       
   665 // Set the Long Press Call Key setting value
       
   666 // ----------------------------------------------------------------------------
       
   667 //
       
   668 void CGSCallPluginModel::SetLongPressCallKeyL( const TInt aValue )
       
   669     {
       
   670 #ifdef RD_VT_LONG_SEND_KEY
       
   671     User::LeaveIfError( iTelephonyRepository->
       
   672                 Set( KSettingsUiLongCallKeyPress, aValue ) );
       
   673 #endif
       
   674     }
       
   675 
       
   676 // ----------------------------------------------------------------------------
       
   677 // CGSCallPluginModel::MapLongPressKeyCallKeyValue
       
   678 // 
       
   679 // Maps the Long Press Call Key setting value
       
   680 // NOTE : EGSLongPressCallKeyVoiceCall is the default value normally
       
   681 // NOTE: When Restore Factory Settings is done, the default value 
       
   682 //       is set to EGSLongPressCallKeyInActive
       
   683 // Three key values are used for a CenRep key though we have two
       
   684 // two setting items because these values are also been used by
       
   685 // CallUi and Phone Application.
       
   686 // ----------------------------------------------------------------------------
       
   687 //
       
   688 void CGSCallPluginModel::MapLongPressKeyCallKeyValue( TInt &aValue )
       
   689     {
       
   690 #ifdef RD_VT_LONG_SEND_KEY
       
   691   	switch ( aValue )
       
   692   		{
       
   693   		case EGSLongPressCallKeyVoiceCall:
       
   694   			 aValue = EGSLongPressCallKeyNotSet;
       
   695   			 break;
       
   696   		case EGSLongPressCallKeyVideoCall:
       
   697   		     aValue = EGSLongPressCallKeyVoiceCall;
       
   698   			 break;
       
   699   		default:
       
   700   			 break;
       
   701   		}
       
   702 #endif
       
   703     }
       
   704 
       
   705 
       
   706 // ----------------------------------------------------------------------------
       
   707 // CGSCallPluginModel::OwnImageVtCallStatusL
       
   708 // 
       
   709 // Get the Own Image sending during vt call setting value
       
   710 // 0,1 --> Inactive (Default value is 1 and when RFS Default value is 0) 
       
   711 // 2 --> Video call
       
   712 // ----------------------------------------------------------------------------
       
   713 //
       
   714 TInt CGSCallPluginModel::OwnImageVtCallStatusL()
       
   715     {
       
   716     TInt value;
       
   717     User::LeaveIfError( iTelephonyRepository->
       
   718                 Get( KSettingsVTVideoSending, value ) );
       
   719     return value;
       
   720     }
       
   721 
       
   722 // ----------------------------------------------------------------------------
       
   723 // CGSCallPluginModel::SetOwnImageVtCallStatusL
       
   724 // 
       
   725 // Set the Long Press Call Key setting value
       
   726 // ----------------------------------------------------------------------------
       
   727 //
       
   728 void CGSCallPluginModel::SetOwnImageVtCallStatusL( const TInt aValue )
       
   729     {
       
   730     User::LeaveIfError( iTelephonyRepository->
       
   731                 Set( KSettingsVTVideoSending, aValue ) );
       
   732     }
       
   733 
       
   734 
       
   735 // ----------------------------------------------------------------------------
       
   736 // CGSCallPluginModel::SlideSettingsShown
       
   737 // 
       
   738 // Check if slide settings items should be shown
       
   739 // ----------------------------------------------------------------------------
       
   740 //
       
   741 TBool CGSCallPluginModel::SlideSettingsShownL() const
       
   742     {
       
   743     TInt value( EGSNotShowSlideSettings );
       
   744     
       
   745     User::LeaveIfError( 
       
   746             iTelephonyRepository->Get( KSettingsShowSlideSettings,value ) );
       
   747 
       
   748     if ( EGSShowSlideSettings == value )
       
   749         {
       
   750         return ETrue;
       
   751         }
       
   752     else
       
   753         {
       
   754         return EFalse;
       
   755         }
       
   756     }
       
   757 
       
   758 //  End of File