convergedcallengine/serviceselector/src/cssconnectionhandler.cpp
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2008 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:  This module contains the implementation of 
       
    15 *              : CSsConnectionHandler class
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 //  INCLUDE FILES
       
    22 #include "cssconnectionhandler.h"
       
    23 #include "csslogger.h"
       
    24 
       
    25 // ================= MEMBER FUNCTIONS =======================================
       
    26 // -----------------------------------------------------------------------------
       
    27 // CSsConnectionHandler::CSsConnectionHandler
       
    28 // C++ default constructor can NOT contain any code, that
       
    29 // might leave.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CSsConnectionHandler::CSsConnectionHandler
       
    33         ( 
       
    34         // None.
       
    35         )
       
    36     {
       
    37     }
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CSsConnectionHandler::NewL
       
    41 // Two-phased constructor.
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CSsConnectionHandler* CSsConnectionHandler::NewL()
       
    45     {
       
    46     CSsConnectionHandler* self = new ( ELeave ) CSsConnectionHandler();
       
    47     CleanupStack::PushL( self );
       
    48     self->ConstructL();
       
    49     CleanupStack::Pop( self );
       
    50     return self;
       
    51     }
       
    52 
       
    53 // -----------------------------------------------------------------------------
       
    54 // CSsConnectionHandler::ConstructL
       
    55 // Symbian 2nd phase constructor can leave.
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 void CSsConnectionHandler::ConstructL()
       
    59     {
       
    60     iCch = CCch::NewL(); 
       
    61     }
       
    62 
       
    63 // Destructor
       
    64 CSsConnectionHandler::~CSsConnectionHandler()
       
    65     {
       
    66     delete iCch;
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CSsServiceUtilities::IsVoipServiceRegistered
       
    71 // Checks is the service registered
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 TBool CSsConnectionHandler::IsVoipServiceRegistered
       
    75         ( 
       
    76         TUint aServiceId 
       
    77         ) const
       
    78     {
       
    79     TCchServiceStatus serviceStatus;
       
    80     TBool registered( EFalse );
       
    81     CCchService* service = iCch->GetService( aServiceId );
       
    82     if ( service )
       
    83         {
       
    84         service->GetStatus( ECCHVoIPSub, serviceStatus );
       
    85         registered = ( KErrNone == serviceStatus.Error() ) && 
       
    86                      ( ECCHEnabled == serviceStatus.State() );
       
    87         }
       
    88     
       
    89     CSSLOGSTRING4("CSSelector::IsRegistered: id:%d ,enabled:%d ,error:%d",
       
    90                 (TInt) aServiceId,
       
    91                 (TInt) ECCHEnabled == serviceStatus.State(),
       
    92                 (TInt) serviceStatus.Error());
       
    93      
       
    94     return registered;        
       
    95     }
       
    96 
       
    97 // ================= OTHER EXPORTED FUNCTIONS ===============================
       
    98 
       
    99 //  End of File