phoneapp/phoneuiutils/src/cphonestorage.cpp
changeset 0 5f000ab63145
child 74 d1c62c765e48
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Storage of data
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <eikappui.h>
       
    20 #include <eikenv.h>
       
    21 #include "cphonestorage.h"
       
    22 #include "phonelogger.h"
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // Constructor
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 CPhoneStorage::CPhoneStorage()
       
    31     : iIsScreenLocked( EFalse ),
       
    32     iNeedToEnableKeylock( EFalse )
       
    33     {
       
    34     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::CPhoneStorage()");
       
    35     }
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // Second phase constructor
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 void CPhoneStorage::ConstructL()
       
    42     {
       
    43     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::ConstructL()");
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------------------------
       
    47 // Static constructor
       
    48 // ---------------------------------------------------------------------------
       
    49 //
       
    50 EXPORT_C CPhoneStorage* CPhoneStorage::NewL()
       
    51     {
       
    52     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::NewL()");
       
    53     CPhoneStorage* self = 
       
    54         new (ELeave) CPhoneStorage();
       
    55     CleanupStack::PushL( self );
       
    56     self->ConstructL();
       
    57     CleanupStack::Pop( self );
       
    58     return self;
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // Destructor
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 EXPORT_C CPhoneStorage::~CPhoneStorage()
       
    66     {
       
    67     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::~CPhoneStorage()");
       
    68     iBlockedKeysScanCode.Reset();
       
    69     iBlockedKeysScanCode.Close();
       
    70     }
       
    71 
       
    72 // ---------------------------------------------------------------------------
       
    73 // CPhoneStorage::AppendBlockedKeysListL
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 EXPORT_C void CPhoneStorage::AppendBlockedKeysListL( TStdScanCode aScanCode )
       
    77     {
       
    78     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::AppendBlockedKeysListL()");
       
    79     iBlockedKeysScanCode.AppendL( aScanCode );
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------
       
    83 // CPhoneStorage::GetBlockedKeyList
       
    84 // -----------------------------------------------------------
       
    85 //
       
    86 EXPORT_C const RArray<TInt>& CPhoneStorage::GetBlockedKeyList() const
       
    87     {
       
    88     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::GetBlockedKeyList()");
       
    89     return iBlockedKeysScanCode;
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------
       
    93 // CPhoneStorage::ResetBlockedKeysList
       
    94 // -----------------------------------------------------------
       
    95 //
       
    96 EXPORT_C void CPhoneStorage::ResetBlockedKeysList()
       
    97     {
       
    98     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::ResetBlockedKeysList()");
       
    99     iBlockedKeysScanCode.Reset();
       
   100     }
       
   101 
       
   102 // -----------------------------------------------------------
       
   103 // CPhoneStorage::IsBlockedKeysListSet
       
   104 // -----------------------------------------------------------
       
   105 //
       
   106 EXPORT_C TBool CPhoneStorage::IsBlockedKeysListEmpty()
       
   107     {
       
   108     __LOGMETHODSTARTEND(EPhoneUIUtils, "CPhoneStorage::IsBlockedKeysListSet()");
       
   109     TBool ret = ETrue;
       
   110     if( iBlockedKeysScanCode.Count() )
       
   111         {
       
   112         ret = EFalse;
       
   113         }
       
   114     return ret;
       
   115     }
       
   116 
       
   117 // -----------------------------------------------------------
       
   118 // CPhoneStorage::SetScreenLocked
       
   119 // -----------------------------------------------------------
       
   120 //
       
   121 EXPORT_C void CPhoneStorage::SetScreenLocked( TBool aLocked )
       
   122     {
       
   123     iIsScreenLocked = aLocked;
       
   124     }
       
   125 
       
   126 // -----------------------------------------------------------
       
   127 // CPhoneStorage::IsScreenLocked
       
   128 // -----------------------------------------------------------
       
   129 //
       
   130 EXPORT_C TBool CPhoneStorage::IsScreenLocked()
       
   131     {
       
   132     return iIsScreenLocked;
       
   133     }
       
   134 
       
   135 // -----------------------------------------------------------
       
   136 // CPhoneStorage::NeedToEnableKeylock
       
   137 // -----------------------------------------------------------
       
   138 //
       
   139 EXPORT_C TBool CPhoneStorage::NeedToEnableKeylock()
       
   140     {
       
   141     return iNeedToEnableKeylock;
       
   142     }
       
   143 
       
   144 
       
   145 // -----------------------------------------------------------
       
   146 // CPhoneStorage::NeedToEnableKeylock
       
   147 // -----------------------------------------------------------
       
   148 //
       
   149 EXPORT_C void CPhoneStorage::SetNeedToEnableKeylock( TBool aNeedToEnableKeylock )
       
   150     {
       
   151     iNeedToEnableKeylock = aNeedToEnableKeylock;
       
   152     }
       
   153 
       
   154 // END