messagingfw/msgcommonutils/src/MsgVoIPExtension.cpp
changeset 0 8e480a14352b
child 22 d2c4c66342f3
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 /*
       
     2 * Copyright (c) 2005, 2007-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:   Get count of VoIP profiles.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "MsgVoIPExtension.h"
       
    20 
       
    21 #include <spsettings.h>
       
    22 #include <featmgr.h>
       
    23 
       
    24 // ================= MEMBER FUNCTIONS =======================
       
    25 
       
    26 // C++ default constructor can NOT contain any code, that
       
    27 // might leave.
       
    28 //
       
    29 CMsgVoIPExtension::CMsgVoIPExtension()
       
    30     {
       
    31     iVoIPFeatureSupport = EFalse;
       
    32     }
       
    33 
       
    34 // Two-phased constructor.
       
    35 //
       
    36 EXPORT_C CMsgVoIPExtension* CMsgVoIPExtension::NewL()
       
    37     {
       
    38     CMsgVoIPExtension *self =
       
    39         new ( ELeave ) CMsgVoIPExtension();
       
    40     CleanupStack::PushL( self );
       
    41     self->ConstructL();
       
    42     CleanupStack::Pop();
       
    43     return self;
       
    44     }
       
    45 
       
    46 // ConstructL
       
    47 //
       
    48 void CMsgVoIPExtension::ConstructL()
       
    49     {
       
    50     FeatureManager::InitializeLibL();
       
    51     //checking If VOIP is enabled
       
    52     if( FeatureManager::FeatureSupported( KFeatureIdCommonVoip ) )
       
    53         {
       
    54         iVoIPFeatureSupport = ETrue;
       
    55         }
       
    56     FeatureManager::UnInitializeLib();	
       
    57     if(iVoIPFeatureSupport)
       
    58         {
       
    59         // for handling services related data
       
    60         iSPSettings = CSPSettings::NewL();
       
    61         }  
       
    62     }
       
    63 // Destructor
       
    64 //
       
    65 CMsgVoIPExtension::~CMsgVoIPExtension()
       
    66     {
       
    67     if(iVoIPFeatureSupport)
       
    68         {
       
    69         delete iSPSettings;
       
    70         }
       
    71     }
       
    72 // ----------------------------------------------------
       
    73 // CMsgVoIPExtension::VoIPProfilesExistL
       
    74 //
       
    75 // ----------------------------------------------------
       
    76 EXPORT_C TBool CMsgVoIPExtension::VoIPProfilesExistL() const
       
    77     {
       
    78     TBool result = EFalse;
       
    79     
       
    80     if(iVoIPFeatureSupport)
       
    81         {
       
    82         result =  iSPSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
       
    83                iSPSettings->IsFeatureSupported( ESupportInternetCallFeature );
       
    84         }
       
    85     return result;
       
    86     }
       
    87 
       
    88 // ----------------------------------------------------
       
    89 // CMsgVoIPExtension::IsPreferredTelephonyVoIP
       
    90 // 
       
    91 // ----------------------------------------------------
       
    92 EXPORT_C TBool CMsgVoIPExtension::IsPreferredTelephonyVoIP() const
       
    93     {
       
    94     return EFalse;
       
    95     }
       
    96 
       
    97 // ----------------------------------------------------
       
    98 // CMsgVoIPExtension::IsVoIPSupported
       
    99 // 
       
   100 // ----------------------------------------------------
       
   101 EXPORT_C TBool CMsgVoIPExtension::IsVoIPSupported() const
       
   102     {
       
   103     TBool result = EFalse;
       
   104     
       
   105     if(iVoIPFeatureSupport)
       
   106         {
       
   107         return iSPSettings->IsFeatureSupported( ESupportVoIPFeature );
       
   108         }
       
   109     return result;
       
   110     }
       
   111 
       
   112 //  End of File