messagingfw/msgcommonutils/src/MsgVoIPExtension.cpp
changeset 60 9f5ae1728557
parent 15 ff168ad79dda
equal deleted inserted replaced
17:d6ba66e59a81 60:9f5ae1728557
     1 /*
     1 /*
     2 * Copyright (c) 2005, 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005, 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:   Stub class for get count of VoIP profiles.
    14 * Description:   Get count of VoIP profiles.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include "MsgVoIPExtension.h"
    19 #include "MsgVoIPExtension.h"
       
    20 
       
    21 #include <spsettings.h>
       
    22 #include <featmgr.h>
    20 
    23 
    21 // ================= MEMBER FUNCTIONS =======================
    24 // ================= MEMBER FUNCTIONS =======================
    22 
    25 
    23 // C++ default constructor can NOT contain any code, that
    26 // C++ default constructor can NOT contain any code, that
    24 // might leave.
    27 // might leave.
    25 //
    28 //
    26 CMsgVoIPExtension::CMsgVoIPExtension()
    29 CMsgVoIPExtension::CMsgVoIPExtension()
    27     {
    30     {
       
    31     iVoIPFeatureSupport = EFalse;
    28     }
    32     }
    29 
    33 
    30 // Two-phased constructor.
    34 // Two-phased constructor.
    31 //
    35 //
    32 EXPORT_C CMsgVoIPExtension* CMsgVoIPExtension::NewL()
    36 EXPORT_C CMsgVoIPExtension* CMsgVoIPExtension::NewL()
    33     {
    37     {
    34     CMsgVoIPExtension *self = 
    38     CMsgVoIPExtension *self =
    35         new ( ELeave ) CMsgVoIPExtension(); 
    39         new ( ELeave ) CMsgVoIPExtension();
    36     CleanupStack::PushL( self );
    40     CleanupStack::PushL( self );
    37     self->ConstructL();
    41     self->ConstructL();
    38     CleanupStack::Pop();
    42     CleanupStack::Pop();
    39     return self;
    43     return self;
    40     }
    44     }
    41 
    45 
    42 // ConstructL
    46 // ConstructL
    43 //
    47 //
    44 void CMsgVoIPExtension::ConstructL()
    48 void CMsgVoIPExtension::ConstructL()
    45     {
    49     {
    46     }        
    50     FeatureManager::InitializeLibL();
    47     
    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     }
    48 // Destructor
    63 // Destructor
    49 //
    64 //
    50 CMsgVoIPExtension::~CMsgVoIPExtension()
    65 CMsgVoIPExtension::~CMsgVoIPExtension()
    51     {
    66     {
       
    67     if(iVoIPFeatureSupport)
       
    68         {
       
    69         delete iSPSettings;
       
    70         }
    52     }
    71     }
    53 // ----------------------------------------------------
    72 // ----------------------------------------------------
    54 // CMsgVoIPExtension::VoIPProfilesExistL
    73 // CMsgVoIPExtension::VoIPProfilesExistL
    55 // 
    74 //
    56 // ----------------------------------------------------
    75 // ----------------------------------------------------
    57 EXPORT_C TBool CMsgVoIPExtension::VoIPProfilesExistL() const
    76 EXPORT_C TBool CMsgVoIPExtension::VoIPProfilesExistL() const
    58     {
    77     {
    59     return EFalse; 
    78     TBool result = EFalse;
       
    79     
       
    80     if(iVoIPFeatureSupport)
       
    81         {
       
    82         result =  iSPSettings->IsFeatureSupported( ESupportVoIPFeature ) &&
       
    83                iSPSettings->IsFeatureSupported( ESupportInternetCallFeature );
       
    84         }
       
    85     return result;
    60     }
    86     }
    61     
    87 
    62 // ----------------------------------------------------
    88 // ----------------------------------------------------
    63 // CMsgVoIPExtension::IsPreferredTelephonyVoIP
    89 // CMsgVoIPExtension::IsPreferredTelephonyVoIP
    64 // 
    90 // 
    65 // ----------------------------------------------------
    91 // ----------------------------------------------------
    66 EXPORT_C TBool CMsgVoIPExtension::IsPreferredTelephonyVoIP() const
    92 EXPORT_C TBool CMsgVoIPExtension::IsPreferredTelephonyVoIP() const
    72 // CMsgVoIPExtension::IsVoIPSupported
    98 // CMsgVoIPExtension::IsVoIPSupported
    73 // 
    99 // 
    74 // ----------------------------------------------------
   100 // ----------------------------------------------------
    75 EXPORT_C TBool CMsgVoIPExtension::IsVoIPSupported() const
   101 EXPORT_C TBool CMsgVoIPExtension::IsVoIPSupported() const
    76     {
   102     {
    77     return EFalse;
   103     TBool result = EFalse;
       
   104     
       
   105     if(iVoIPFeatureSupport)
       
   106         {
       
   107         return iSPSettings->IsFeatureSupported( ESupportVoIPFeature );
       
   108         }
       
   109     return result;
    78     }
   110     }
    79 
   111 
    80 
       
    81 //  End of File
   112 //  End of File
    82