mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/lcstub/src/lcenginestub.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
child 35 6c57ef9392d2
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
     1 /*
       
     2 * Copyright (c) 2009 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 #include "lcenginestub.h"
       
    18 #include "lcsessionstub.h"
       
    19 #include "mussessionproperties.h"
       
    20 #include "lcsessionobserver.h"
       
    21 #include "lcuiprovider.h"
       
    22 #include "lcvideoplayerstub.h"
       
    23 #include "musmanagercommon.h"
       
    24 
       
    25 static int lcutStub_LcEngine_failureValue = 0;
       
    26 static bool lcutStub_LcEngine_lcFeatureSupported = false;
       
    27 
       
    28 
       
    29 TAny* REComSession::CreateImplementationL( TUid /*aInterfaceUid*/, 
       
    30                                            TInt32 /*aKeyOffset*/, 
       
    31                                            const TEComResolverParams& /*aResolutionParameters*/ )
       
    32 {
       
    33     User::LeaveIfError( lcutStub_LcEngine_failureValue );
       
    34     return CLcEngineStub::NewL();
       
    35 }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 CLcEngineStub* CLcEngineStub::NewL()
       
    42     {
       
    43     
       
    44     CLcEngineStub* self = new( ELeave )CLcEngineStub();
       
    45     CleanupStack::PushL( self );
       
    46     self->ConstructL();
       
    47     CleanupStack::Pop( self );
       
    48     return self;
       
    49     }
       
    50         
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 // -----------------------------------------------------------------------------
       
    54 //  
       
    55 CLcEngineStub::~CLcEngineStub()
       
    56     {
       
    57     delete iSession;
       
    58     }
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 CLcEngineStub::CLcEngineStub( )
       
    65     {
       
    66     }
       
    67 
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 void CLcEngineStub::ConstructL()
       
    73     { 
       
    74     iSession = CLcSession::NewL(); 
       
    75     }
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 MLcSession& CLcEngineStub::Session()
       
    82     {
       
    83     return *iSession;
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 TBool CLcEngineStub::IsFeatureSupported( TLcFeature aLcFeature )
       
    91     {
       
    92     return lcutStub_LcEngine_lcFeatureSupported;
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 //
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 CLcSession* CLcEngineStub::CreateMusSessionL( int aUseCase )
       
   100     {
       
   101     CLcSession* session; 
       
   102     switch ( aUseCase ) 
       
   103         {
       
   104         case MultimediaSharing::EMusReceive:
       
   105             {
       
   106             session = CLcSession::NewL(); 
       
   107             session->iRemotePlayer = CLcVideoPlayer::NewL(); 
       
   108             break;
       
   109             }
       
   110             
       
   111         case MultimediaSharing::EMusLiveVideo:
       
   112             {
       
   113             session = CLcSession::NewL();
       
   114             session->iLocalPlayer = CLcVideoPlayer::NewL(); 
       
   115             break;
       
   116             }
       
   117         case MultimediaSharing::EMusTwoWayVideo:
       
   118         case MultimediaSharing::EMusReceiveTwoWayVideo:
       
   119             {
       
   120             session = CLcSession::NewL();
       
   121             session->iLocalPlayer = CLcVideoPlayer::NewL(); 
       
   122             session->iRemotePlayer = CLcVideoPlayer::NewL(); 
       
   123             break;
       
   124             }
       
   125             
       
   126         default:
       
   127             User::Leave( KErrNotSupported );
       
   128             break;
       
   129         }
       
   130     return session;
       
   131     }
       
   132 
       
   133 
       
   134 //stub control
       
   135 
       
   136     
       
   137 void lcutStub_LcEngine_reset()
       
   138     {
       
   139     lcutStub_LcEngine_failureValue = 0;
       
   140     lcutStub_LcEngine_lcFeatureSupported = false;
       
   141     }
       
   142 
       
   143 void lcutStub_LcEngine_setFailure( int failure )
       
   144     {
       
   145     lcutStub_LcEngine_failureValue = failure;
       
   146     }
       
   147 
       
   148 int lcutStub_LcEngine_failure()
       
   149     {
       
   150     return lcutStub_LcEngine_failureValue;
       
   151     }
       
   152 
       
   153 void lcutStub_LcEngine_setLcFeatureSupported( bool supported )
       
   154     {
       
   155     lcutStub_LcEngine_lcFeatureSupported = supported;
       
   156     }
       
   157 
       
   158 // End of File