mmsharing/mmshavailability/src/musavasettingsimp.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
    54     delete iTelNumber;
    54     delete iTelNumber;
    55     iTelNumber = NULL ;
    55     iTelNumber = NULL ;
    56 
    56 
    57     delete iContactName;
    57     delete iContactName;
    58     iContactName = NULL;
    58     iContactName = NULL;
       
    59     
       
    60     delete iOptionSentTelNumber;
       
    61     iOptionSentTelNumber = NULL ;
    59 
    62 
    60     delete iSipAddressProposal;
    63     delete iSipAddressProposal;
    61     iSipAddressProposal = NULL ;
    64     iSipAddressProposal = NULL ;
    62 
    65 
    63     if( iSipAddresses )
    66     if( iSipAddresses )
    79         iAudioCodecs->Reset();
    82         iAudioCodecs->Reset();
    80         delete iAudioCodecs;
    83         delete iAudioCodecs;
    81         iAudioCodecs = NULL ;
    84         iAudioCodecs = NULL ;
    82         }
    85         }
    83     
    86     
    84     delete iContactResolvingUri;
    87 
    85     
       
    86     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::~CMusAvaSettingsImp()" )
    88     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::~CMusAvaSettingsImp()" )
    87     }
    89     }
    88 
    90 
    89 // -----------------------------------------------------------------------------
    91 // -----------------------------------------------------------------------------
    90 // C++ Constructor
    92 // C++ Constructor
    91 // -----------------------------------------------------------------------------
    93 // -----------------------------------------------------------------------------
    92 //
    94 //
    93 CMusAvaSettingsImp::CMusAvaSettingsImp() :
    95 CMusAvaSettingsImp::CMusAvaSettingsImp()
    94     iFastMode( MusSettingsKeys::EFastModeOff )
    96     {
    95     {
    97 
    96     }
    98     }
    97 
    99 
    98 // -----------------------------------------------------------------------------
   100 // -----------------------------------------------------------------------------
    99 // Symbian second-phase constructor.
   101 // Symbian second-phase constructor.
   100 // -----------------------------------------------------------------------------
   102 // -----------------------------------------------------------------------------
   101 //
   103 //
   102 void CMusAvaSettingsImp::ConstructL()
   104 void CMusAvaSettingsImp::ConstructL()
   103     {
   105     {
   104     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::ConstructL()" )
   106     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::ConstructL()" )
   105     iTelNumber = HBufC::NewL( 0 );
   107     iTelNumber = HBufC::NewL( 0 );
       
   108     
       
   109     iOptionSentTelNumber = HBufC::NewL( 0 );
   106 
   110 
   107     iContactName = HBufC::NewL( 0 );
   111     iContactName = HBufC::NewL( 0 );
   108 
   112 
   109     iSipAddressProposal = HBufC::NewL( 0 );
   113     iSipAddressProposal = HBufC::NewL( 0 );
   110 
   114 
   117     iVideoCodecs = new( ELeave ) CDesCArrayFlat( 1 );
   121     iVideoCodecs = new( ELeave ) CDesCArrayFlat( 1 );
   118 
   122 
   119     iAudioCodecs = new( ELeave ) CDesCArrayFlat( 1 );
   123     iAudioCodecs = new( ELeave ) CDesCArrayFlat( 1 );
   120 
   124 
   121     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::ConstructL()" )
   125     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::ConstructL()" )
   122     }        
   126     }  
       
   127 
   123 // -----------------------------------------------------------------------------
   128 // -----------------------------------------------------------------------------
   124 // 
   129 // 
   125 // -----------------------------------------------------------------------------
   130 // -----------------------------------------------------------------------------
   126 //
   131 //
   127 MMusAvaSettings::TManualActivation CMusAvaSettingsImp::ManualActivation()
   132 MMusAvaSettings::TManualActivation CMusAvaSettingsImp::ManualActivation()
   128 	{
   133 	{
   129 	return iManualActivation;	
   134 	return iManualActivation;	
   130 	}
   135 	}
       
   136 
   131 // -----------------------------------------------------------------------------
   137 // -----------------------------------------------------------------------------
   132 //
   138 //
   133 // -----------------------------------------------------------------------------
   139 // -----------------------------------------------------------------------------
   134 //
   140 //
   135 const TDesC& CMusAvaSettingsImp::TelNumber() const
   141 const TDesC& CMusAvaSettingsImp::TelNumber() const
   136     {
   142     {
   137     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::TelNumber()" )
   143     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::TelNumber()" )
   138     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::TelNumber()" )
   144     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::TelNumber()" )
   139     return *iTelNumber;
   145     return *iTelNumber;
   140     }
   146     }
       
   147 
       
   148 // -----------------------------------------------------------------------------
       
   149 //
       
   150 // -----------------------------------------------------------------------------
       
   151 //
       
   152 void CMusAvaSettingsImp::SetOptionSentNumber( const TDesC& aTelNumber )
       
   153 	{
       
   154     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::SetOptionSentNumber() " )
       
   155     MUS_LOG_TDESC( "mus: [MUSAVA]	   aTelNumber = ", aTelNumber )
       
   156     delete iOptionSentTelNumber;
       
   157     iOptionSentTelNumber = NULL ;
       
   158     TRAPD ( error , iOptionSentTelNumber = aTelNumber.AllocL() );
       
   159     if ( error )
       
   160     	{
       
   161         MUS_LOG1("CMusAvaSettingsImp::SetOptionSentNumber() leave code: %d ", error);
       
   162     	}
       
   163     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::SetOptionSentNumber() " )
       
   164 	}
       
   165 
       
   166 // -----------------------------------------------------------------------------
       
   167 //
       
   168 // -----------------------------------------------------------------------------
       
   169 //
       
   170 const TDesC& CMusAvaSettingsImp::OptionSentTelNumber() const
       
   171 	{
       
   172     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::OptionSentTelNumber() " )
       
   173 	return *iOptionSentTelNumber;
       
   174 	}
       
   175 
       
   176 // -----------------------------------------------------------------------------
       
   177 //
       
   178 // -----------------------------------------------------------------------------
       
   179 //
       
   180 void CMusAvaSettingsImp::ReleaseOptionSentNumber ()
       
   181 	{
       
   182 	MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::ReleaseOptionSentNumber() " )
       
   183 	delete iOptionSentTelNumber;
       
   184 	iOptionSentTelNumber = NULL;
       
   185 	TRAPD ( err , iOptionSentTelNumber = HBufC::NewL( 0 ) );
       
   186     if ( err )
       
   187     	{
       
   188         MUS_LOG1("CMusAvaSettingsImp::ReleaseOptionSentNumber() leave code: %d ", err);
       
   189     	}
       
   190 	MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::ReleaseOptionSentNumber() " )
       
   191 	}
   141 
   192 
   142 // -----------------------------------------------------------------------------
   193 // -----------------------------------------------------------------------------
   143 //
   194 //
   144 // -----------------------------------------------------------------------------
   195 // -----------------------------------------------------------------------------
   145 //
   196 //
   392 
   443 
   393 // -----------------------------------------------------------------------------
   444 // -----------------------------------------------------------------------------
   394 //
   445 //
   395 // -----------------------------------------------------------------------------
   446 // -----------------------------------------------------------------------------
   396 //
   447 //
   397 MMusAvaSettingsObserver* CMusAvaSettingsImp::Observer()
       
   398     {
       
   399     return iObserver;
       
   400     }
       
   401 
       
   402 // -----------------------------------------------------------------------------
       
   403 //
       
   404 // -----------------------------------------------------------------------------
       
   405 //
       
   406 void CMusAvaSettingsImp::SetManualActivation( TManualActivation aManualActivation )
   448 void CMusAvaSettingsImp::SetManualActivation( TManualActivation aManualActivation )
   407     {
   449     {
   408     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::SetManualActivation" )
   450     MUS_LOG( "mus: [MUSAVA]	-> CMusAvaSettingsImp::SetManualActivation" )
   409     iManualActivation = aManualActivation;
   451     iManualActivation = aManualActivation;
   410     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::SetManualActivation" )
   452     MUS_LOG( "mus: [MUSAVA]	<- CMusAvaSettingsImp::SetManualActivation" )
   427 
   469 
   428     MUS_LOG( "mus: [MUSAVA]  <- CMusAvaSettingsImp::ApplicationState()" )
   470     MUS_LOG( "mus: [MUSAVA]  <- CMusAvaSettingsImp::ApplicationState()" )
   429     return state;
   471     return state;
   430     }
   472     }
   431 
   473 
   432 
       
   433 // -----------------------------------------------------------------------------
   474 // -----------------------------------------------------------------------------
   434 //
   475 //
   435 // -----------------------------------------------------------------------------
   476 // -----------------------------------------------------------------------------
   436 //
   477 //
   437 TInt CMusAvaSettingsImp::CallDirection()
   478 TInt CMusAvaSettingsImp::CallDirection()
   445 //
   486 //
   446 void CMusAvaSettingsImp::SetCallDirection( TInt aDirection )
   487 void CMusAvaSettingsImp::SetCallDirection( TInt aDirection )
   447 	{
   488 	{
   448 	iCallDirection = aDirection;	
   489 	iCallDirection = aDirection;	
   449 	}
   490 	}
   450 
   491     
   451 // -----------------------------------------------------------------------------
   492 // -----------------------------------------------------------------------------
   452 //
   493 //
   453 // -----------------------------------------------------------------------------
   494 // -----------------------------------------------------------------------------
   454 //
   495 //
   455 void CMusAvaSettingsImp::SetFastMode( MusSettingsKeys::TFastMode aMode )
   496 TInt CMusAvaSettingsImp::CallPrivacy()
   456     {
   497 	{
   457     iFastMode = aMode;    
   498 	return iCallPrivacy;	
   458     }
   499 	}
   459 
   500 	
   460 // -----------------------------------------------------------------------------
   501 // -----------------------------------------------------------------------------
   461 //
   502 //
   462 // -----------------------------------------------------------------------------
   503 // -----------------------------------------------------------------------------
   463 //
   504 //
   464 MusSettingsKeys::TFastMode CMusAvaSettingsImp::FastMode() const
   505 void CMusAvaSettingsImp:: SetCallPrivacy( TInt aPrivacy )
   465     {
   506 	{
   466     return iFastMode;
   507 	iCallPrivacy = aPrivacy;	
   467     }
   508 	}
   468 
   509 
   469 // -----------------------------------------------------------------------------
   510 // end of file
   470 // In case of not having tel number, contact for remote end may be searched
       
   471 // based on sip uri
       
   472 // -----------------------------------------------------------------------------
       
   473 //
       
   474 void CMusAvaSettingsImp::SetUriForContactResolvingL( 
       
   475     const TDesC& aRemoteUri )
       
   476     {
       
   477     HBufC* tempResolvingUri = aRemoteUri.AllocL();
       
   478     delete iContactResolvingUri;
       
   479     iContactResolvingUri = tempResolvingUri;
       
   480     }
       
   481 
       
   482 // -----------------------------------------------------------------------------
       
   483 // 
       
   484 // -----------------------------------------------------------------------------
       
   485 //
       
   486 TPtrC CMusAvaSettingsImp::ContactResolvingUri()
       
   487     {
       
   488     TPtrC resolvingUri( KNullDesC );
       
   489     if ( iContactResolvingUri )
       
   490         {
       
   491         resolvingUri.Set( iContactResolvingUri->Des() );
       
   492         }
       
   493     return resolvingUri;
       
   494     }