convergedconnectionhandler/cchserver/src/cchfeaturemanager.cpp
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2003-2007 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:  CCchFeatureManager implementation.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 
       
    21 #include <e32svr.h> // RDebug
       
    22 #include <featmgr.h>
       
    23 #include "cchfeaturemanager.h"
       
    24 #include <centralrepository.h>
       
    25 #include "cchprivatecrkeys.h"
       
    26 #include "cchlogger.h"
       
    27 #include <settingsinternalcrkeys.h>
       
    28 #include <CoreApplicationUIsSDKCRKeys.h>
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ==============================
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // CCchFeatureManager::CCchFeatureManager
       
    34 // C++ default constructor can NOT contain any code, that might leave.
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 CCchFeatureManager::CCchFeatureManager()
       
    38     {
       
    39     // No implementation required
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // CCchFeatureManager::ConstructL
       
    44 // Symbian 2nd phase constructor can leave.
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 void CCchFeatureManager::ConstructL()
       
    48     {
       
    49     CCHLOGSTRING( "CCchFeatureManager::ConstructL IN" );
       
    50     
       
    51         // Create Central Repository instance for Offline Mode
       
    52     iOfflineRepository = CRepository::NewL( KCRUidCoreApplicationUIs );
       
    53     
       
    54     TBool iDynamicVoIPSupported( EFalse );
       
    55     FeatureManager::InitializeLibL();
       
    56     
       
    57     iCoverDisplaySupported = FeatureManager::FeatureSupported( 
       
    58         KFeatureIdCoverDisplay );
       
    59     CCHLOGSTRING2( 
       
    60         "CCchFeatureManager::ConstructL: Cover display supported=%d", 
       
    61         iCoverDisplaySupported );
       
    62     
       
    63     iVoIPSupported = FeatureManager::FeatureSupported( KFeatureIdCommonVoip );
       
    64     if( iVoIPSupported )
       
    65         {
       
    66         CRepository* rep = CRepository::NewL( KCRUidTelephonySettings );
       
    67         if( rep->Get( KDynamicVoIP, iDynamicVoIPSupported ) == KErrNone )
       
    68             {
       
    69             iVoIPSupported &= iDynamicVoIPSupported;
       
    70             }
       
    71         
       
    72         delete rep;
       
    73         }
       
    74         
       
    75 #ifdef _DEBUG
       
    76     iVoIPSupported = ETrue;
       
    77 #endif
       
    78     CCHLOGSTRING2( "CCchFeatureManager::ConstructL: VoIP supported=%d", 
       
    79             iVoIPSupported );
       
    80     FeatureManager::UnInitializeLib(); 
       
    81     
       
    82     CCHLOGSTRING( "CCchFeatureManager::ConstructL OUT" );
       
    83     }
       
    84     
       
    85 // ---------------------------------------------------------------------------
       
    86 // CCchFeatureManager::NewL
       
    87 // Two-phased constructor.
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 CCchFeatureManager* CCchFeatureManager::NewL()
       
    91     {
       
    92     CCchFeatureManager* self = new (ELeave) CCchFeatureManager;
       
    93     CleanupStack::PushL( self );
       
    94     self->ConstructL();
       
    95     CleanupStack::Pop( self );
       
    96     return self;
       
    97     }
       
    98 
       
    99 // Destructor
       
   100 CCchFeatureManager::~CCchFeatureManager()
       
   101     {
       
   102     delete iOfflineRepository;
       
   103     iOfflineRepository = NULL;
       
   104     }
       
   105     
       
   106 // ----------------------------------------------------------------------------
       
   107 // CCchFeatureManager::VoIPSupported()
       
   108 // ----------------------------------------------------------------------------
       
   109 //
       
   110 TBool CCchFeatureManager::VoIPSupported() const
       
   111     {
       
   112     return iVoIPSupported;
       
   113     }
       
   114 
       
   115 // ----------------------------------------------------------------------------
       
   116 // CCchFeatureManager::OfflineMode()
       
   117 // ----------------------------------------------------------------------------
       
   118 //
       
   119 TBool CCchFeatureManager::OfflineMode() const
       
   120     {
       
   121     CCHLOGSTRING( "CCchFeatureManager::OfflineMode IN" );
       
   122 
       
   123     TInt offline( 0 );
       
   124     iOfflineRepository->Get( KCoreAppUIsNetworkConnectionAllowed, offline );
       
   125     CCHLOGSTRING2( "CCchFeatureManager::OfflineMode Offline: %d", offline );
       
   126     
       
   127     return ECoreAppUIsNetworkConnectionNotAllowed == offline;
       
   128     }
       
   129     
       
   130 // ----------------------------------------------------------------------------
       
   131 // CCchFeatureManager::CoverDisplaySupported()
       
   132 // ----------------------------------------------------------------------------
       
   133 //
       
   134 TBool CCchFeatureManager::CoverDisplaySupported() const
       
   135     {
       
   136     return iCoverDisplaySupported;
       
   137     }
       
   138     
       
   139 
       
   140 // End of File
       
   141 
       
   142 
       
   143