mmsharing/mmshengine/tsrc/ut_engine/src/musengstubs.cpp
changeset 0 f0cf47e981f9
child 11 ff8a573c0e2e
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     1 /*
       
     2 * Copyright (c) 2005 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "musengstubs.h"
       
    21 #include <sipprofilealrcontroller.h>
       
    22 
       
    23 
       
    24 // ---- MEMBER FUNCTIONS OF CMusEngObserverStub --------------------------------
       
    25 
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // 
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CMusEngObserverStub::CMusEngObserverStub()
       
    32     {
       
    33     Reset();
       
    34     }
       
    35         
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // 
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 CMusEngObserverStub::~CMusEngObserverStub()
       
    42     {
       
    43     delete iIncomingSessionOriginator;
       
    44     }
       
    45 
       
    46 
       
    47 // -------- Functions from MMusEngSessionDurationTimerObserver -----------------
       
    48 
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // 
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 void CMusEngObserverStub::UpdateTimerEvent()
       
    55     {
       
    56     iUpdateTimerEventCalled = ETrue;
       
    57     }
       
    58 
       
    59 
       
    60 // ----------- Functions from MusEngSessionObserver ----------------------------
       
    61 
       
    62 
       
    63 
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // 
       
    67 // -----------------------------------------------------------------------------
       
    68 //	
       
    69 void CMusEngObserverStub::SessionEstablished()
       
    70     {
       
    71     iSessionEstablishedCalled = ETrue;
       
    72     }
       
    73 
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 void CMusEngObserverStub::SessionTerminated()
       
    80     {
       
    81     iSessionTerminatedCalled = ETrue;
       
    82     }
       
    83     
       
    84     
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 void CMusEngObserverStub::SessionConnectionLost()
       
    90     {
       
    91     iSessionConnectionLostCalled = ETrue;
       
    92     }
       
    93     
       
    94     
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 void CMusEngObserverStub::SessionFailed()
       
   100     {
       
   101     iSessionFailedCalled = ETrue;
       
   102     }
       
   103     
       
   104             
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 void CMusEngObserverStub::StreamIdle()
       
   110     {
       
   111     iStreamIdleCalled = ETrue;
       
   112     }
       
   113 
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 // -----------------------------------------------------------------------------
       
   118 //
       
   119 void CMusEngObserverStub::StreamStreaming()
       
   120     {
       
   121     iStreamStreamingCalled = ETrue;
       
   122     }
       
   123     
       
   124 
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 void CMusEngObserverStub::SessionTimeChanged( 
       
   130                         const TTimeIntervalSeconds& /*aSeconds*/ )
       
   131     {
       
   132     iSessionTimeChangedCalled = ETrue;
       
   133     }
       
   134 
       
   135 
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 // -----------------------------------------------------------------------------
       
   139 //
       
   140 void CMusEngObserverStub::InactivityTimeout()
       
   141     {
       
   142     iInactivityTimeoutCalled = ETrue;
       
   143     }
       
   144 
       
   145 
       
   146 
       
   147 
       
   148 
       
   149 
       
   150 // ---- FUNCTIONS OF MMusEngOutSessionObserver --------------------------------
       
   151 
       
   152 
       
   153 // -----------------------------------------------------------------------------
       
   154 // 
       
   155 // -----------------------------------------------------------------------------
       
   156 //
       
   157 void CMusEngObserverStub::SessionRejected()
       
   158     {
       
   159     iSessionRejectedCalled = ETrue;
       
   160     }
       
   161 
       
   162 
       
   163 // -----------------------------------------------------------------------------
       
   164 // 
       
   165 // -----------------------------------------------------------------------------
       
   166 //  
       
   167 void CMusEngObserverStub::SessionBadRequest()
       
   168     {
       
   169     iSessionBadRequestCalled = ETrue;
       
   170     }
       
   171 
       
   172 
       
   173 // -----------------------------------------------------------------------------
       
   174 // 
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 void CMusEngObserverStub::SessionUnauthorized()
       
   178     {
       
   179     iSessionUnauthorizedCalled = ETrue;
       
   180     }
       
   181     
       
   182 
       
   183 // -----------------------------------------------------------------------------
       
   184 // 
       
   185 // -----------------------------------------------------------------------------
       
   186 //
       
   187 void CMusEngObserverStub::SessionPaymentRequired()
       
   188     {
       
   189     iSessionPaymentRequiredCalled = ETrue;
       
   190     }
       
   191     
       
   192 
       
   193 // -----------------------------------------------------------------------------
       
   194 // 
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 void CMusEngObserverStub::SessionRecipientNotFound()
       
   198     {
       
   199     iSessionRecipientNotFoundCalled = ETrue;
       
   200     }
       
   201     
       
   202 
       
   203 // -----------------------------------------------------------------------------
       
   204 // 
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207 void CMusEngObserverStub::SessionProxyAuthenticationRequired()
       
   208     {
       
   209     iSessionProxyAuthenticationRequiredCalled = ETrue;
       
   210     }
       
   211     
       
   212 
       
   213 // -----------------------------------------------------------------------------
       
   214 // 
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 void CMusEngObserverStub::SessionRequestTimeOut()
       
   218     {
       
   219     iSessionRequestTimeOutCalled = ETrue;
       
   220     }
       
   221     
       
   222 
       
   223 // -----------------------------------------------------------------------------
       
   224 // 
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 void CMusEngObserverStub::SessionUnsupportedMediaType()
       
   228     {
       
   229     iSessionUnsupportedMediaTypeCalled = ETrue;
       
   230     }
       
   231 
       
   232 
       
   233 // -----------------------------------------------------------------------------
       
   234 // 
       
   235 // -----------------------------------------------------------------------------
       
   236 //    
       
   237 void CMusEngObserverStub::SessionBusyHere()
       
   238     {
       
   239     iSessionBusyHereCalled = ETrue;
       
   240     }
       
   241     
       
   242 
       
   243 // -----------------------------------------------------------------------------
       
   244 // 
       
   245 // -----------------------------------------------------------------------------
       
   246 //
       
   247 void CMusEngObserverStub::SessionRequestCancelled()
       
   248     {
       
   249     iSessionRequestCancelledCalled = ETrue;
       
   250     }
       
   251 
       
   252 
       
   253 void CMusEngObserverStub::SessionTemporarilyNotAvailable()
       
   254     {
       
   255     iSessionTemporarilyNotAvailable = ETrue;
       
   256     }
       
   257 
       
   258 
       
   259 
       
   260 // ---- FUNCTIONS OF MMusEngLiveSessionObserver ----------------------------------
       
   261 
       
   262 
       
   263 
       
   264 // -----------------------------------------------------------------------------
       
   265 // 
       
   266 // -----------------------------------------------------------------------------
       
   267 //
       
   268 void CMusEngObserverStub::DiskFull()
       
   269     {
       
   270     iDiskFullCalled = ETrue;
       
   271     }
       
   272 
       
   273 
       
   274 
       
   275 
       
   276 // ---- FUNCTIONS OF MMusEngClipSessionObserver ----------------------------------
       
   277 
       
   278 
       
   279 // -----------------------------------------------------------------------------
       
   280 // 
       
   281 // -----------------------------------------------------------------------------
       
   282 //
       
   283 void CMusEngObserverStub::EndOfClip()
       
   284     {
       
   285     iEndOfClipCalled = ETrue;
       
   286     }
       
   287 
       
   288 
       
   289 // -----------------------------------------------------------------------------
       
   290 // 
       
   291 // -----------------------------------------------------------------------------
       
   292 //
       
   293 void CMusEngObserverStub::TranscodingNeeded()
       
   294     {
       
   295     iTranscodingNeededCalled = ETrue;
       
   296     }
       
   297 
       
   298 
       
   299 // -----------------------------------------------------------------------------
       
   300 // 
       
   301 // -----------------------------------------------------------------------------
       
   302 //        
       
   303 void CMusEngObserverStub::TranscodingProgressed( TInt aPercentage )
       
   304     {
       
   305     iTranscodingProgressedPercentage = aPercentage;
       
   306     }
       
   307 
       
   308 
       
   309 // -----------------------------------------------------------------------------
       
   310 // 
       
   311 // -----------------------------------------------------------------------------
       
   312 //  
       
   313 void CMusEngObserverStub::TranscodingCompletedInit()
       
   314     {
       
   315     iTranscodingCompletedInitCalled = ETrue;
       
   316     }
       
   317 
       
   318 
       
   319 // -----------------------------------------------------------------------------
       
   320 // 
       
   321 // -----------------------------------------------------------------------------
       
   322 //  
       
   323 void CMusEngObserverStub::TranscodingCompletedFinalize()
       
   324     {
       
   325     iTranscodingCompletedFinalizeCalled = ETrue;
       
   326     }    
       
   327     
       
   328 
       
   329 // -----------------------------------------------------------------------------
       
   330 // 
       
   331 // -----------------------------------------------------------------------------
       
   332 //  
       
   333 void CMusEngObserverStub::TranscodingFailed()
       
   334     {
       
   335     iTranscodingFailedCalled = ETrue;
       
   336     }
       
   337  
       
   338 
       
   339 // ---- FUNCTIONS OF MMusEngInSessionObserver ----------------------------------
       
   340 
       
   341 
       
   342 // -----------------------------------------------------------------------------
       
   343 // 
       
   344 // -----------------------------------------------------------------------------
       
   345 //	
       
   346 void CMusEngObserverStub::IncomingSessionPreNotification()
       
   347     {
       
   348     iIncomingSessionPreNotificationCalled = ETrue;
       
   349     }
       
   350     
       
   351 
       
   352 // -----------------------------------------------------------------------------
       
   353 // 
       
   354 // -----------------------------------------------------------------------------
       
   355 //	
       
   356 void CMusEngObserverStub::IncomingSession( const TDesC& aOriginator,
       
   357                                            const TDesC& /*aOriginatorIdentity*/ )
       
   358     {
       
   359     iIncomingSessionCalled = ETrue;
       
   360     iIncomingSessionOriginator = aOriginator.Alloc();
       
   361     
       
   362     if ( !iIncomingSessionOriginator )
       
   363         {
       
   364         // TODO: Handle out of memory.
       
   365         }
       
   366     }
       
   367 
       
   368 
       
   369 // -----------------------------------------------------------------------------
       
   370 // 
       
   371 // -----------------------------------------------------------------------------
       
   372 //	
       
   373 void CMusEngObserverStub::StreamBuffering()
       
   374     {
       
   375     iStreamBufferingCalled = ETrue;
       
   376     }
       
   377 
       
   378 
       
   379 // -----------------------------------------------------------------------------
       
   380 // 
       
   381 // -----------------------------------------------------------------------------
       
   382 //	
       
   383 void CMusEngObserverStub::AudioRoutingChanged( TBool aShowNote )
       
   384     {
       
   385     iAudioRoutingChangedCalled = ETrue;
       
   386     iShowNote = aShowNote;
       
   387     }
       
   388 
       
   389 // -----------------------------------------------------------------------------
       
   390 // 
       
   391 // -----------------------------------------------------------------------------
       
   392 //    
       
   393 TBool CMusEngObserverStub::AudioRouteChangeAllowed() const
       
   394     {
       
   395     return iAudioRouteChangeAllowed;
       
   396     }
       
   397     
       
   398     
       
   399 
       
   400 // ----- HELPERS ---------------------------------------------------------------
       
   401 
       
   402 
       
   403 // -----------------------------------------------------------------------------
       
   404 // 
       
   405 // -----------------------------------------------------------------------------
       
   406 //	
       
   407 TBool CMusEngObserverStub::IsReseted()
       
   408     {
       
   409     return ( !iUpdateTimerEventCalled &&
       
   410              !iSessionEstablishedCalled &&
       
   411              !iSessionTerminatedCalled &&
       
   412              !iSessionConnectionLostCalled &&
       
   413              !iSessionFailedCalled &&
       
   414              !iStreamIdleCalled &&
       
   415              !iStreamStreamingCalled &&
       
   416              !iSessionTimeChangedCalled &&
       
   417              !iInactivityTimeoutCalled &&
       
   418              !iSessionRejectedCalled &&
       
   419              !iSessionBadRequestCalled &&
       
   420         	 !iSessionUnauthorizedCalled &&
       
   421         	 !iSessionPaymentRequiredCalled &&
       
   422         	 !iSessionRecipientNotFoundCalled &&
       
   423         	 !iSessionProxyAuthenticationRequiredCalled &&
       
   424         	 !iSessionRequestTimeOutCalled &&
       
   425         	 !iSessionUnsupportedMediaTypeCalled &&
       
   426         	 !iSessionBusyHereCalled  &&
       
   427         	 !iSessionRequestCancelledCalled &&
       
   428         	 !iDiskFullCalled &&
       
   429         	 !iEndOfClipCalled &&
       
   430         	 !iTranscodingNeededCalled &&
       
   431         	 !iTranscodingCompletedInitCalled &&
       
   432         	 !iTranscodingCompletedFinalizeCalled &&
       
   433         	 !iTranscodingFailedCalled &&
       
   434         	 !iIncomingSessionPreNotificationCalled &&
       
   435              !iIncomingSessionCalled &&
       
   436              !iStreamBufferingCalled &&
       
   437              !iAudioRoutingChangedCalled &&
       
   438              iTranscodingProgressedPercentage == 0 &&
       
   439              !iSessionTemporarilyNotAvailable &&
       
   440              !iIncomingSessionOriginator &&
       
   441              !iShowNote &&
       
   442              iAudioRouteChangeAllowed );
       
   443     }
       
   444 
       
   445 // -----------------------------------------------------------------------------
       
   446 // 
       
   447 // -----------------------------------------------------------------------------
       
   448 //	
       
   449 void CMusEngObserverStub::Reset()
       
   450     {
       
   451     iUpdateTimerEventCalled = EFalse;
       
   452     iSessionEstablishedCalled = EFalse;
       
   453     iSessionTerminatedCalled = EFalse;
       
   454     iSessionConnectionLostCalled = EFalse;
       
   455     iSessionFailedCalled = EFalse;
       
   456     iStreamIdleCalled = EFalse;
       
   457     iStreamStreamingCalled = EFalse;
       
   458     iSessionTimeChangedCalled = EFalse;
       
   459     iInactivityTimeoutCalled = EFalse;
       
   460     iSessionRejectedCalled = EFalse;
       
   461 	iSessionBadRequestCalled = EFalse;
       
   462 	iSessionUnauthorizedCalled = EFalse;
       
   463 	iSessionPaymentRequiredCalled = EFalse;
       
   464 	iSessionRecipientNotFoundCalled = EFalse;
       
   465 	iSessionProxyAuthenticationRequiredCalled = EFalse;
       
   466 	iSessionRequestTimeOutCalled = EFalse;
       
   467 	iSessionUnsupportedMediaTypeCalled = EFalse;
       
   468 	iSessionBusyHereCalled = EFalse;
       
   469 	iSessionRequestCancelledCalled = EFalse;
       
   470 	iDiskFullCalled = EFalse;
       
   471 	iEndOfClipCalled = EFalse;
       
   472 	iTranscodingNeededCalled = EFalse;
       
   473     iTranscodingCompletedInitCalled = EFalse;
       
   474     iTranscodingCompletedFinalizeCalled = EFalse;
       
   475 	iTranscodingFailedCalled = EFalse;
       
   476 	iIncomingSessionPreNotificationCalled = EFalse;
       
   477     iIncomingSessionCalled = EFalse;
       
   478     iStreamBufferingCalled = EFalse;
       
   479     iAudioRoutingChangedCalled = EFalse;
       
   480     iTranscodingProgressedPercentage = 0;
       
   481     delete iIncomingSessionOriginator;
       
   482     iSessionTemporarilyNotAvailable = EFalse;   
       
   483     iIncomingSessionOriginator = NULL;
       
   484     iShowNote = EFalse;
       
   485     iAudioRouteChangeAllowed = ETrue;
       
   486     }
       
   487 
       
   488 
       
   489 // CSipProfileAlrController STUB
       
   490 CSipProfileAlrController* CSipProfileAlrController::NewL( 
       
   491     CSIPProfileRegistryBase& aRegistry, 
       
   492     MSipProfileAlrObserver& /*aObserver*/ )
       
   493     {
       
   494     return new( ELeave )CSipProfileAlrController( aRegistry );
       
   495     }
       
   496 
       
   497 CSipProfileAlrController::~CSipProfileAlrController()
       
   498     {
       
   499     }
       
   500 
       
   501 void CSipProfileAlrController::AllowMigrationL(
       
   502     TUint32 /*aProfileId*/,
       
   503     TUint32 aIapId )
       
   504     {
       
   505     delete HBufC::NewL( 1 );
       
   506     iAllowMigrationCalled = ETrue;
       
   507     iLastUsedIap = aIapId;
       
   508     }
       
   509 
       
   510 void CSipProfileAlrController::DisallowMigrationL(
       
   511     TUint32 /*aProfileId*/,
       
   512     TUint32 aIapId )
       
   513     {
       
   514     delete HBufC::NewL( 1 );
       
   515     iDisallowMigrationCalled = ETrue;
       
   516     iLastUsedIap = aIapId;
       
   517     }
       
   518 
       
   519 void CSipProfileAlrController::RefreshIapAvailabilityL( 
       
   520     TUint32 /*aProfileId*/ )
       
   521     {
       
   522     delete HBufC::NewL( 1 );
       
   523     }
       
   524 
       
   525 CSipProfileAlrController::CSipProfileAlrController( 
       
   526     CSIPProfileRegistryBase& aRegistry )
       
   527     : iRegistry( aRegistry )
       
   528     {
       
   529     }