imstutils/imconversationview/imcvuiapp/src/imcvuiapputils.cpp
branchRCL_3
changeset 29 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
28:3104fc151679 29:9a48e301e94b
       
     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:  utils helper class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "imcvuiapputils.h"
       
    20 #include  <centralrepository.h>
       
    21 #include <AknUtils.h>
       
    22 
       
    23 
       
    24 // ---------------------------------------------------------
       
    25 // IMCVUiAppUtils::GetCRKeyL
       
    26 // (other items were commented in a header).
       
    27 // ---------------------------------------------------------
       
    28 //
       
    29 TUint32 IMCVUiAppUtils::CRKeyL( TUid aUid, TUint32 aKey )
       
    30     {
       
    31     TInt val( 0 );
       
    32 
       
    33     TRAPD( err,
       
    34             CRepository* rep = CRepository::NewL( aUid );
       
    35             rep->Get( aKey, val );
       
    36             delete rep;
       
    37          );
       
    38 
       
    39     if( err != KErrNotFound && err != KErrPathNotFound )
       
    40         {
       
    41         // "Not found" errors are ignored, because it's ok to 
       
    42         // return zero if key is not found
       
    43         User::LeaveIfError( err );
       
    44         }
       
    45 
       
    46     return val;    
       
    47     }
       
    48     	
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // IMCVUiAppUtils::PenEnabled
       
    52 // ---------------------------------------------------------------------------
       
    53 //
       
    54 TBool IMCVUiAppUtils::PenEnabled()
       
    55     {
       
    56 #ifndef RD_30_DISABLE_TOUCH
       
    57     return AknLayoutUtils::PenEnabled();
       
    58 
       
    59 #else
       
    60     // In 3.0 mode we don't have pen support
       
    61     return EFalse;
       
    62 
       
    63 #endif //RD_30_DISABLE_TOUCH  
       
    64     }
       
    65     	
       
    66 // End of file
       
    67