mmsharing/livecommsui/lcui/tsrc/ipvtengine/src/musengsessionmanager.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 
       
    18 #include "musengsessionmanager.h"
       
    19 #include "musengmcesession.h"
       
    20 #include "musengtwowaysession.h"
       
    21 #include "lcsession.h"
       
    22 #include "mccdatasender.h"
       
    23 #include "mccdatareceiver.h"
       
    24 #include "musenglogger.h"
       
    25 #include "mccdatastructures.h"
       
    26 #include <settingsinternalcrkeys.h>
       
    27 #include <centralrepository.h>
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CMusEngSessionManager* CMusEngSessionManager::NewL()
       
    34     {
       
    35     CMusEngSessionManager* self = new( ELeave )CMusEngSessionManager();
       
    36     CleanupStack::PushL( self );
       
    37     self->ConstructL();
       
    38     CleanupStack::Pop( self );
       
    39     return self;
       
    40     }
       
    41         
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 // -----------------------------------------------------------------------------
       
    45 //  
       
    46 CMusEngSessionManager::~CMusEngSessionManager()
       
    47     {
       
    48     delete iSession;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 CMusEngSessionManager::CMusEngSessionManager()
       
    56     {
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 // -----------------------------------------------------------------------------
       
    62 //
       
    63 void CMusEngSessionManager::ConstructL()
       
    64     {
       
    65     MUS_LOG( "mus: [ENGINE]  -> CMusEngSessionManager::ConstructL()" )
       
    66     //iMsgReceiver = CMccDataReceiver::NewL(*this);
       
    67     MUS_LOG( "mus: [ENGINE]  MsgQueue1 setup complete" )
       
    68     //iMsgSender = CMccDataSender::NewL();
       
    69     MUS_LOG( "mus: [ENGINE]  MsgQueue2 setup complete" )
       
    70     iSession = CMusEngTwoWaySession::NewL();
       
    71     iSession->SetRemoteL( _L("Homer Simpson") );
       
    72     MUS_LOG( "mus: [ENGINE]  <- CMusEngSessionManager::ConstructL()" )
       
    73     }
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 MLcSession& CMusEngSessionManager::Session()
       
    80     {
       
    81     return *iSession;
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 //
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CMusEngSessionManager::DataReceived( const TDataMessage& aData )
       
    89     {
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 TBool CMusEngSessionManager::IsFeatureSupported( TLcFeature aLcFeature )
       
    97     {
       
    98     TBool ret = EFalse;
       
    99     if ( ELcSendVideoQuery == aLcFeature )
       
   100         {
       
   101         TInt videoSendingSetting;
       
   102         CRepository* repository = CRepository::NewL( KCRUidTelephonySettings );
       
   103         if ( KErrNone == repository->Get(KSettingsVTVideoSending, videoSendingSetting) )
       
   104             {
       
   105             if ( VTSETTING_ALWAYS_ASK_FIRST == videoSendingSetting ) 
       
   106                 ret = ETrue;
       
   107             }
       
   108         delete repository;
       
   109         }
       
   110     return ret;
       
   111     }
       
   112 
       
   113 // End of File