vmbx/vmbxengine/tsrc/ut_vmbxengine/src/mpbutil_mock.cpp
changeset 27 7eb70891911c
parent 19 e44a8c097b15
equal deleted inserted replaced
23:427125ac6cb8 27:7eb70891911c
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include <mpbutil.h>
     1 #include <mpbutil.h>
    19 #include <e32base.h>
     2 #include <e32base.h>
    20 #include <e32des8.h>
     3 #include <e32des8.h>
       
     4 
       
     5 TInt time = 0;
    21 
     6 
    22 CPhoneBookBuffer::CPhoneBookBuffer():iMonitor(NULL,0,0)
     7 CPhoneBookBuffer::CPhoneBookBuffer():iMonitor(NULL,0,0)
    23 {
     8 {
    24 }
     9 }
    25 
    10 
    49 TInt CPhoneBookBuffer::RemovePartialEntry()
    34 TInt CPhoneBookBuffer::RemovePartialEntry()
    50 { return 0; }
    35 { return 0; }
    51 
    36 
    52 void CPhoneBookBuffer::StartRead(){}
    37 void CPhoneBookBuffer::StartRead(){}
    53 
    38 
    54 TInt CPhoneBookBuffer::GetTagAndType(TUint8 &/*aTagValue*/, TPhBkTagType &/*aDataType*/)
    39 TInt CPhoneBookBuffer::GetTagAndType(TUint8 &aTagValue, TPhBkTagType &aDataType)
    55 { return 0; }
    40 { 
       
    41 	switch(aDataType)
       
    42 		{
       
    43 		case CPhoneBookBuffer::EPhBkTypeNoData:
       
    44 			{
       
    45 			if(time == 0)
       
    46 				{
       
    47 				aTagValue = RMobilePhoneBookStore::ETagPBNewEntry;
       
    48 				time ++;
       
    49 				}
       
    50 			else if (time == 1)
       
    51 				{
       
    52 				aTagValue = RMobilePhoneBookStore::ETagPBNumber;
       
    53 				time ++;
       
    54 				}
       
    55 			else if (time == 2)
       
    56 				{
       
    57 				aTagValue = RMobilePhoneBookStore::ETagPBText;
       
    58 				time ++;
       
    59 				}
       
    60 			else if (time == 3)
       
    61 				{
       
    62 				aTagValue = RMobilePhoneBookStore::ETagPBTonNpi;
       
    63 				time ++;
       
    64 				}
       
    65 			else
       
    66 				{
       
    67 				time = 0;
       
    68 				return KErrNotFound;
       
    69 				}
       
    70 			break;
       
    71 			}
       
    72 		default:
       
    73 			aTagValue = 0;
       
    74 		}
       
    75 	
       
    76 	return KErrNone; 
       
    77 }
    56 
    78 
    57 TInt CPhoneBookBuffer::GetValue(TUint8 &/*aInteger*/)
    79 TInt CPhoneBookBuffer::GetValue(TUint8 &/*aInteger*/)
    58 { return 0; }
    80 { return 0; }
    59 
    81 
    60 TInt CPhoneBookBuffer::GetValue(TUint16 &/*aInteger*/)
    82 TInt CPhoneBookBuffer::GetValue(TUint16 &/*aInteger*/)