phonebookengines/VirtualPhonebook/VPbkSimStore/src/CContactStoreInfo.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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:  A store info implementation for the sim stores
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "CContactStoreInfo.h"
       
    22 
       
    23 #include "CContactStore.h"
       
    24 #include "CFieldTypeMappings.h"
       
    25 #include <MVPbkSimCntStore.h>
       
    26 #include <TVPbkSimStoreProperty.h>
       
    27 
       
    28 namespace VPbkSimStore {
       
    29 
       
    30 
       
    31 // ============================ MEMBER FUNCTIONS ===============================
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CContactStoreInfo::CContactStoreInfo
       
    35 // C++ default constructor can NOT contain any code, that
       
    36 // might leave.
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CContactStoreInfo::CContactStoreInfo(CContactStore& aStore)
       
    40 :   iStore(aStore)
       
    41     {
       
    42     }
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CContactStoreInfo::NewL
       
    46 // Two-phased constructor.
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 CContactStoreInfo* CContactStoreInfo::NewL(CContactStore& aStore)
       
    50     {
       
    51     return new(ELeave) CContactStoreInfo(aStore);
       
    52     }
       
    53     
       
    54 // Destructor
       
    55 CContactStoreInfo::~CContactStoreInfo()
       
    56     {
       
    57     }
       
    58 
       
    59 // -----------------------------------------------------------------------------
       
    60 // CContactStoreInfo::MaxNumberOfContactsL
       
    61 // -----------------------------------------------------------------------------
       
    62 //        
       
    63 TInt CContactStoreInfo::MaxNumberOfContactsL() const
       
    64     {
       
    65     TVPbkGsmStoreProperty prop;
       
    66     User::LeaveIfError(
       
    67         iStore.NativeStore().GetGsmStoreProperties(prop));
       
    68     return prop.iTotalEntries;
       
    69     }
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // CContactStoreInfo::NumberOfContactsL
       
    73 // -----------------------------------------------------------------------------
       
    74 //                
       
    75 TInt CContactStoreInfo::NumberOfContactsL() const
       
    76     {
       
    77     TVPbkGsmStoreProperty prop;
       
    78     User::LeaveIfError(
       
    79         iStore.NativeStore().GetGsmStoreProperties(prop));
       
    80     return prop.iUsedEntries;
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CContactStoreInfo::ReservedMemoryL
       
    85 // -----------------------------------------------------------------------------
       
    86 //        
       
    87 TInt64 CContactStoreInfo::ReservedMemoryL() const
       
    88     {
       
    89     return 0;
       
    90     }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CContactStoreInfo::FreeMemoryL
       
    94 // -----------------------------------------------------------------------------
       
    95 //        
       
    96 TInt64 CContactStoreInfo::FreeMemoryL() const
       
    97     {
       
    98     return 0;
       
    99     }
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CContactStoreInfo::MaxNumberOfGroupsL
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 TInt CContactStoreInfo::MaxNumberOfGroupsL() const
       
   106     {
       
   107     // USIM groups not yet supported
       
   108     return 0;
       
   109     }
       
   110 
       
   111 // -----------------------------------------------------------------------------
       
   112 // CContactStoreInfo::NumberOfGroupsL
       
   113 // -----------------------------------------------------------------------------
       
   114 //
       
   115 TInt CContactStoreInfo::NumberOfGroupsL() const
       
   116     {
       
   117     // USIM groups not yet supported
       
   118     return 0;
       
   119     }
       
   120 } // namespace VPbkSimStore
       
   121 //  End of File