mmsharing/mmshengine/tsrc/ut_engine/src/musengstubs.cpp
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     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 "musengtestdefs.h"
       
    22 #include <sipprofilealrcontroller.h>
       
    23 
       
    24 
       
    25 // ---- MEMBER FUNCTIONS OF CMusEngObserverStub --------------------------------
       
    26 
       
    27 
       
    28 // -----------------------------------------------------------------------------
       
    29 // 
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CMusEngObserverStub::CMusEngObserverStub()
       
    33     {
       
    34     Reset();
       
    35     }
       
    36         
       
    37 // -----------------------------------------------------------------------------
       
    38 // 
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 CMusEngObserverStub::~CMusEngObserverStub()
       
    42     {
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // From MMusEngSessionDurationTimerObserver
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 void CMusEngObserverStub::UpdateTimerEvent()
       
    50     {
       
    51     iUpdateTimerEventCalled = ETrue;
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // From MMusEngAudioRoutingObserver
       
    56 // -----------------------------------------------------------------------------
       
    57 //	
       
    58 void CMusEngObserverStub::AudioRoutingChanged()
       
    59     {
       
    60     iAudioRoutingChangedCalled = ETrue;
       
    61     }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // From MMusSipProfileUser
       
    65 // -----------------------------------------------------------------------------
       
    66 //   
       
    67 TBool CMusEngObserverStub::IsRoamingBetweenAPsAllowed()
       
    68     {
       
    69     return iRoamingBetweenAPsAllowed;
       
    70     }
       
    71     
       
    72 // -----------------------------------------------------------------------------
       
    73 // From MMusSipProfileUser
       
    74 // -----------------------------------------------------------------------------
       
    75 //   
       
    76 void CMusEngObserverStub::ProfileRegistered()
       
    77     {
       
    78     iProfileRegisteredCalled = ETrue;
       
    79     }
       
    80 
       
    81 // ----- HELPERS ---------------------------------------------------------------
       
    82 
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // 
       
    86 // -----------------------------------------------------------------------------
       
    87 //	
       
    88 TBool CMusEngObserverStub::IsReseted()
       
    89     {
       
    90     return ( iUpdateTimerEventCalled == EFalse &&
       
    91              iAudioRoutingChangedCalled == EFalse &&
       
    92              iRoamingBetweenAPsAllowed == EFalse &&
       
    93              iProfileRegisteredCalled == EFalse );
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // 
       
    98 // -----------------------------------------------------------------------------
       
    99 //	
       
   100 void CMusEngObserverStub::Reset()
       
   101     {
       
   102     iUpdateTimerEventCalled = EFalse;
       
   103     iAudioRoutingChangedCalled = EFalse;
       
   104     iRoamingBetweenAPsAllowed = EFalse;
       
   105     iProfileRegisteredCalled = EFalse;
       
   106     }
       
   107 
       
   108 // -----------------------------------------------------------------------------
       
   109 // 
       
   110 // -----------------------------------------------------------------------------
       
   111 //  
       
   112 TMusEngDisplayHandlerStub::TMusEngDisplayHandlerStub()
       
   113     {
       
   114     Reset();
       
   115     }
       
   116 
       
   117 void TMusEngDisplayHandlerStub::Reset()
       
   118     {
       
   119     iRect = TRect( 0, 0, 0, 0 );
       
   120     iSecondaryRect = TRect( 0, 0, 0, 0 );
       
   121     iIsEnabled = EFalse;
       
   122     iOrientation = EPortrait;
       
   123     iIsActive = ETrue;
       
   124     }
       
   125 
       
   126 TRect TMusEngDisplayHandlerStub::Rect() const
       
   127     {
       
   128     return iRect;
       
   129     }
       
   130 
       
   131 void TMusEngDisplayHandlerStub::SetRectL( const TRect& aRect )
       
   132     {
       
   133     iRect = aRect;
       
   134     }
       
   135             
       
   136 void TMusEngDisplayHandlerStub::SetSecondaryRectL( const TRect& aSecondaryRect )
       
   137     {
       
   138     iSecondaryRect = aSecondaryRect;
       
   139     }
       
   140             
       
   141 TRect TMusEngDisplayHandlerStub::SecondaryRect() const
       
   142     {
       
   143     return iSecondaryRect;
       
   144     }
       
   145             
       
   146 void TMusEngDisplayHandlerStub::EnableDisplayL( TBool aEnable )
       
   147     {
       
   148     iIsEnabled = aEnable;
       
   149     }
       
   150             
       
   151 TBool TMusEngDisplayHandlerStub::IsDisplayEnabled()
       
   152     {
       
   153     return iIsEnabled;
       
   154     }
       
   155             
       
   156 MMusEngDisplayHandler::TDisplayOrientation TMusEngDisplayHandlerStub::OrientationL()
       
   157     {
       
   158     return iOrientation;
       
   159     }
       
   160             
       
   161 void TMusEngDisplayHandlerStub::SetOrientationL( TDisplayOrientation aOrientation )
       
   162     {
       
   163     iOrientation = aOrientation;
       
   164     }
       
   165             
       
   166 TBool TMusEngDisplayHandlerStub::IsDisplayActive()
       
   167     {
       
   168     return iIsActive;
       
   169     }
       
   170     
       
   171 
       
   172 // -----------------------------------------------------------------------------
       
   173 // 
       
   174 // -----------------------------------------------------------------------------
       
   175 //        
       
   176 CLcSessionObserverStub::CLcSessionObserverStub()
       
   177     {
       
   178     } 
       
   179 
       
   180 // -----------------------------------------------------------------------------
       
   181 // 
       
   182 // -----------------------------------------------------------------------------
       
   183 //
       
   184 CLcSessionObserverStub::~CLcSessionObserverStub()
       
   185     {
       
   186     }
       
   187         
       
   188 // -----------------------------------------------------------------------------
       
   189 // 
       
   190 // -----------------------------------------------------------------------------
       
   191 //     
       
   192 void CLcSessionObserverStub::StateChanged( MLcSession& aSession )
       
   193     {
       
   194     iCalledFunction = ESessionStateChanged;
       
   195     iCurrentSession = &aSession;
       
   196     }
       
   197 
       
   198 // -----------------------------------------------------------------------------
       
   199 // 
       
   200 // -----------------------------------------------------------------------------
       
   201 //
       
   202 void CLcSessionObserverStub::StateChanged( MLcVideoPlayer& aPlayer )
       
   203     {
       
   204     iCalledFunction = EPlayerStateChanged;
       
   205     iCurrentPlayer = &aPlayer;
       
   206     }
       
   207 
       
   208 // -----------------------------------------------------------------------------
       
   209 // 
       
   210 // -----------------------------------------------------------------------------
       
   211 //
       
   212 void CLcSessionObserverStub::Updated( MLcSession& aSession )
       
   213     {
       
   214     iCalledFunction = ESessionUpdated;
       
   215     iCurrentSession = &aSession;
       
   216     }
       
   217 
       
   218 // -----------------------------------------------------------------------------
       
   219 // 
       
   220 // -----------------------------------------------------------------------------
       
   221 //
       
   222 void CLcSessionObserverStub::Updated( MLcVideoPlayer& aPlayer )
       
   223     {
       
   224     iCalledFunction = EPlayerUpdated;
       
   225     iCurrentPlayer = &aPlayer;
       
   226     }
       
   227 
       
   228 // -----------------------------------------------------------------------------
       
   229 // 
       
   230 // -----------------------------------------------------------------------------
       
   231 //
       
   232 void CLcSessionObserverStub::Failed( MLcSession& aSession, TInt aError )
       
   233     {
       
   234     iCalledFunction = ESessionFailed;
       
   235     iCurrentSession = &aSession;
       
   236     iError = aError;
       
   237     }
       
   238 
       
   239 // -----------------------------------------------------------------------------
       
   240 // 
       
   241 // -----------------------------------------------------------------------------
       
   242 //
       
   243 void CLcSessionObserverStub::Failed( MLcVideoPlayer& aPlayer, TInt aError )
       
   244     {
       
   245     iCalledFunction = EPlayerFailed;
       
   246     iCurrentPlayer = &aPlayer;
       
   247     iError = aError;
       
   248     }
       
   249 
       
   250 // -----------------------------------------------------------------------------
       
   251 // 
       
   252 // -----------------------------------------------------------------------------
       
   253 //
       
   254 void CLcSessionObserverStub::SessionTimeChanged(
       
   255     MLcSession& aSession,
       
   256     const TTimeIntervalSeconds& aSeconds )
       
   257     {
       
   258     iCalledFunction = ESessionTimeChanged;
       
   259     iCurrentSession = &aSession;
       
   260     iSessionTime = aSeconds.Int();
       
   261     }
       
   262 
       
   263 // -----------------------------------------------------------------------------
       
   264 // 
       
   265 // -----------------------------------------------------------------------------
       
   266 //
       
   267 void CLcSessionObserverStub::Reset()
       
   268     {
       
   269     iCalledFunction = EUnknown;
       
   270     iCurrentSession = NULL;
       
   271     iCurrentPlayer = NULL;
       
   272     iSessionTime = 0;
       
   273     iError = KErrNone;
       
   274     }
       
   275 
       
   276 // -----------------------------------------------------------------------------
       
   277 // 
       
   278 // -----------------------------------------------------------------------------
       
   279 //
       
   280 TBool CLcSessionObserverStub::IsReseted()
       
   281     {
       
   282     return ( iCalledFunction == EUnknown && 
       
   283              iCurrentSession == NULL &&
       
   284              iCurrentPlayer == NULL &&
       
   285              iSessionTime == 0 &&
       
   286              iError == KErrNone );
       
   287     }
       
   288 
       
   289 // -----------------------------------------------------------------------------
       
   290 // 
       
   291 // -----------------------------------------------------------------------------
       
   292 //
       
   293 CLcUiProviderStub::CLcUiProviderStub()
       
   294     {
       
   295     
       
   296     }
       
   297 
       
   298 // -----------------------------------------------------------------------------
       
   299 // 
       
   300 // -----------------------------------------------------------------------------
       
   301 //
       
   302 CLcUiProviderStub::~CLcUiProviderStub()
       
   303     {
       
   304     }
       
   305 
       
   306 // -----------------------------------------------------------------------------
       
   307 // 
       
   308 // -----------------------------------------------------------------------------
       
   309 //
       
   310 TBool CLcUiProviderStub::SelectRecipient( 
       
   311     MDesCArray& aRecipientAddresses, 
       
   312     TDes& aSelectedRecipientAddress )
       
   313     {
       
   314     iCalledFunction = ESelectRecipient;
       
   315     if ( aRecipientAddresses.MdcaCount() > 0 )
       
   316         {
       
   317         aSelectedRecipientAddress = aRecipientAddresses.MdcaPoint( 0 );
       
   318         }
       
   319     return iSimulatedReturnValue;
       
   320     }
       
   321 
       
   322 // -----------------------------------------------------------------------------
       
   323 // 
       
   324 // -----------------------------------------------------------------------------
       
   325 //
       
   326 TBool CLcUiProviderStub::InputRecipient( TDes& aRecipientAddress )
       
   327     {
       
   328     iCalledFunction = EInputRecipient;
       
   329     aRecipientAddress = iRecipient;
       
   330     return iSimulatedReturnValue;
       
   331     }
       
   332 
       
   333 // -----------------------------------------------------------------------------
       
   334 // 
       
   335 // -----------------------------------------------------------------------------
       
   336 //
       
   337 void CLcUiProviderStub::HandleForegroundStatus( TBool aForeground )
       
   338     {
       
   339     iCalledFunction = EHandleForegroundStatus;
       
   340     iForeground = aForeground;
       
   341     }
       
   342 
       
   343 // -----------------------------------------------------------------------------
       
   344 // 
       
   345 // -----------------------------------------------------------------------------
       
   346 //
       
   347 void CLcUiProviderStub::BlockUi( TBool /*aBlocked*/ )
       
   348     {
       
   349     }
       
   350     
       
   351 // -----------------------------------------------------------------------------
       
   352 // 
       
   353 // -----------------------------------------------------------------------------
       
   354 //
       
   355 void CLcUiProviderStub::Reset()
       
   356     {
       
   357     iCalledFunction = EUnknown;
       
   358     iRecipient.Set( KNullDesC );
       
   359     iSimulatedReturnValue = EFalse;
       
   360     }
       
   361 
       
   362 // -----------------------------------------------------------------------------
       
   363 // 
       
   364 // -----------------------------------------------------------------------------
       
   365 //
       
   366 TLcWindowStub::TLcWindowStub() :
       
   367     iEnabled( EFalse ),
       
   368     iRect(),
       
   369     iOrientation( MLcWindow::EPortrait )
       
   370     {
       
   371     }
       
   372 
       
   373 // -----------------------------------------------------------------------------
       
   374 // 
       
   375 // -----------------------------------------------------------------------------
       
   376 //
       
   377 void TLcWindowStub::EnableLcWindowL( TBool aEnable )
       
   378     {
       
   379     iEnabled = aEnable;
       
   380     }
       
   381 
       
   382 // -----------------------------------------------------------------------------
       
   383 // 
       
   384 // -----------------------------------------------------------------------------
       
   385 //
       
   386 TBool TLcWindowStub::IsLcWindowEnabled()
       
   387     {
       
   388     return iEnabled;
       
   389     }
       
   390 
       
   391 // -----------------------------------------------------------------------------
       
   392 // 
       
   393 // -----------------------------------------------------------------------------
       
   394 //
       
   395 void TLcWindowStub::SetLcWindowRectL( TRect aRect )
       
   396     {
       
   397     iRect = aRect;
       
   398     }
       
   399 
       
   400 // -----------------------------------------------------------------------------
       
   401 // 
       
   402 // -----------------------------------------------------------------------------
       
   403 //
       
   404 TRect TLcWindowStub::LcWindowRect()
       
   405     {
       
   406     delete HBufC::NewL( 1 );
       
   407     return iRect;
       
   408     }
       
   409 
       
   410 // -----------------------------------------------------------------------------
       
   411 // 
       
   412 // -----------------------------------------------------------------------------
       
   413 //
       
   414 void TLcWindowStub::SetLcWindowOrientationL( TLcWindowOrientation aOrientation )
       
   415     {
       
   416     delete HBufC::NewL( 1 );
       
   417     iOrientation = aOrientation;
       
   418     }
       
   419 
       
   420 // -----------------------------------------------------------------------------
       
   421 // 
       
   422 // -----------------------------------------------------------------------------
       
   423 //
       
   424 void TLcWindowStub::Reset()
       
   425     {
       
   426     iEnabled = EFalse;
       
   427     iOrientation = MLcWindow::EPortrait;
       
   428     iRect.SetSize( TSize() );
       
   429     }
       
   430 
       
   431 // -----------------------------------------------------------------------------
       
   432 // 
       
   433 // -----------------------------------------------------------------------------
       
   434 //
       
   435 MLcWindow::TLcWindowOrientation TLcWindowStub::LcWindowOrientationL()
       
   436     {
       
   437     delete HBufC::NewL( 1 );
       
   438     return iOrientation;
       
   439     }
       
   440 
       
   441 // -----------------------------------------------------------------------------
       
   442 // 
       
   443 // -----------------------------------------------------------------------------
       
   444 //
       
   445 TLcAudioControlStub::TLcAudioControlStub()
       
   446     {
       
   447     Reset();
       
   448     }
       
   449     
       
   450 // -----------------------------------------------------------------------------
       
   451 // 
       
   452 // -----------------------------------------------------------------------------
       
   453 //
       
   454 TBool TLcAudioControlStub::IsLcAudioMutedL()
       
   455     {
       
   456     delete HBufC::NewL( 1 );
       
   457     return iAudioMuted;
       
   458     }
       
   459 
       
   460 // -----------------------------------------------------------------------------
       
   461 // 
       
   462 // -----------------------------------------------------------------------------
       
   463 //
       
   464 void TLcAudioControlStub::MuteLcAudioL( TBool aMute )
       
   465     {
       
   466     delete HBufC::NewL( 1 );
       
   467     iAudioMuted = aMute;
       
   468     }
       
   469 
       
   470 // -----------------------------------------------------------------------------
       
   471 // 
       
   472 // -----------------------------------------------------------------------------
       
   473 //
       
   474 TBool TLcAudioControlStub::IsLcMicMutedL()
       
   475     {
       
   476     delete HBufC::NewL( 1 );
       
   477     return iMicMuted;
       
   478     }
       
   479 
       
   480 // -----------------------------------------------------------------------------
       
   481 // 
       
   482 // -----------------------------------------------------------------------------
       
   483 //
       
   484 void TLcAudioControlStub::MuteLcMicL( TBool aMute )
       
   485     {
       
   486     delete HBufC::NewL( 1 );
       
   487     iMicMuted = aMute;
       
   488     }
       
   489 
       
   490 // -----------------------------------------------------------------------------
       
   491 // 
       
   492 // -----------------------------------------------------------------------------
       
   493 //
       
   494 TBool TLcAudioControlStub::IsEnablingLcLoudspeakerAllowed()
       
   495     {
       
   496     return iEnablingLoudspeakerAllowed;
       
   497     }
       
   498 
       
   499 // -----------------------------------------------------------------------------
       
   500 // 
       
   501 // -----------------------------------------------------------------------------
       
   502 //
       
   503 void TLcAudioControlStub::EnableLcLoudspeakerL( TBool aEnabled )
       
   504     {
       
   505     delete HBufC::NewL( 1 );
       
   506     iLoudspeakerEnabled = aEnabled;
       
   507     }
       
   508 
       
   509 // -----------------------------------------------------------------------------
       
   510 // 
       
   511 // -----------------------------------------------------------------------------
       
   512 //
       
   513 TBool TLcAudioControlStub::IsLcLoudspeakerEnabled()
       
   514     {
       
   515     return iLoudspeakerEnabled;
       
   516     }
       
   517 
       
   518 // -----------------------------------------------------------------------------
       
   519 // 
       
   520 // -----------------------------------------------------------------------------
       
   521 //
       
   522 TInt TLcAudioControlStub::LcVolumeL()
       
   523     {
       
   524     delete HBufC::NewL( 1 );
       
   525     return iVolume;
       
   526     }
       
   527 
       
   528 // -----------------------------------------------------------------------------
       
   529 // 
       
   530 // -----------------------------------------------------------------------------
       
   531 //
       
   532 void TLcAudioControlStub::SetLcVolumeL( TInt aValue )
       
   533     {
       
   534     delete HBufC::NewL( 1 );
       
   535     iVolume = aValue;
       
   536     }
       
   537 
       
   538 // -----------------------------------------------------------------------------
       
   539 // 
       
   540 // -----------------------------------------------------------------------------
       
   541 //
       
   542 void TLcAudioControlStub::IncreaseLcVolumeL()
       
   543     {
       
   544     delete HBufC::NewL( 1 );
       
   545     iVolume++;
       
   546     }
       
   547 
       
   548 // -----------------------------------------------------------------------------
       
   549 // 
       
   550 // -----------------------------------------------------------------------------
       
   551 //
       
   552 void TLcAudioControlStub::DecreaseLcVolumeL()
       
   553     {
       
   554     delete HBufC::NewL( 1 );
       
   555     iVolume--;
       
   556     }
       
   557 
       
   558 // -----------------------------------------------------------------------------
       
   559 // 
       
   560 // -----------------------------------------------------------------------------
       
   561 //
       
   562 void TLcAudioControlStub::Reset()
       
   563     {
       
   564     iAudioMuted = EFalse;
       
   565     iMicMuted = EFalse;
       
   566     iEnablingLoudspeakerAllowed = EFalse;
       
   567     iLoudspeakerEnabled = ETrue;
       
   568     iVolume = 0;
       
   569     }
       
   570 
       
   571 
       
   572 // CSipProfileAlrController STUB
       
   573 CSipProfileAlrController* CSipProfileAlrController::NewL( 
       
   574     CSIPProfileRegistryBase& aRegistry, 
       
   575     MSipProfileAlrObserver& /*aObserver*/ )
       
   576     {
       
   577     return new( ELeave )CSipProfileAlrController( aRegistry );
       
   578     }
       
   579 
       
   580 CSipProfileAlrController::~CSipProfileAlrController()
       
   581     {
       
   582     }
       
   583 
       
   584 void CSipProfileAlrController::AllowMigrationL(
       
   585     TUint32 /*aProfileId*/,
       
   586     TUint32 aIapId )
       
   587     {
       
   588     delete HBufC::NewL( 1 );
       
   589     iAllowMigrationCalled = ETrue;
       
   590     iLastUsedIap = aIapId;
       
   591     }
       
   592 
       
   593 void CSipProfileAlrController::DisallowMigrationL(
       
   594     TUint32 /*aProfileId*/,
       
   595     TUint32 aIapId )
       
   596     {
       
   597     delete HBufC::NewL( 1 );
       
   598     iDisallowMigrationCalled = ETrue;
       
   599     iLastUsedIap = aIapId;
       
   600     }
       
   601 
       
   602 void CSipProfileAlrController::RefreshIapAvailabilityL( 
       
   603     TUint32 /*aProfileId*/ )
       
   604     {
       
   605     delete HBufC::NewL( 1 );
       
   606     }
       
   607 
       
   608 CSipProfileAlrController::CSipProfileAlrController( 
       
   609     CSIPProfileRegistryBase& aRegistry )
       
   610     : iRegistry( aRegistry )
       
   611     {
       
   612     }
       
   613 
       
   614 void REComSession::DestroyedImplementation(TUid /*aDtorIDKey*/)
       
   615     {
       
   616     }
       
   617