omads/omadsextensions/adapters/contacts/src/NSmlContactsDataStore.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 23 Nov 2009 14:46:41 +0200
changeset 0 dab8a81a92de
child 8 ad0f53516d84
permissions -rw-r--r--
Revision: 200948
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  DS contacts dataprovider
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
// INCLUDE FILES
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include <barsc.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <bautils.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <e32base.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <s32strm.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#include <e32cmn.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <e32des16.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <s32mem.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#include <implementationproxy.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <vtoken.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include <sysutil.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include <NSmlContactsDataStoreFormat_1_1_2.rsg>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include <NSmlContactsDataStoreFormat_1_2.rsg>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#include <data_caging_path_literals.hrh>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#include <SmlDataFormat.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
#include <SmlDataProvider.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
#include <e32property.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
#include <DataSyncInternalPSKeys.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
#include <e32hashtab.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
#include <CVPbkContactStoreUriArray.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
#include <VPbkContactStoreUris.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
#include <TVPbkContactStoreUriPtr.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
#include <MVPbkContactStoreList.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
#include <MVPbkContactStoreProperties.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
#include <MVPbkStoreContactProperties.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
#include <MVPbkViewContact.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
#include <MVPbkStoreContact.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
#include <MVPbkStoreContact2.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
#include <MVPbkFieldType.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
#include <MVPbkContactFieldTextData.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
#include <CVPbkContactFieldIterator.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
#include <CVPbkContactViewDefinition.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
#include <MVPbkContactLink.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
#include <s32mem.h>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
#include "NSmlContactsDataStore.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
#include "NSmlContactsModsFetcher.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
#include "nsmldebug.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    59
#include "nsmlconstants.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    60
#include "NSmlDataModBase.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
#include "nsmlcontactsdefs.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    62
#include "nsmldsimpluids.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
#include "nsmlsnapshotitem.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
#include "nsmlchangefinder.h"
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
#include <VPbkEng.rsg>
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
#ifndef __WINS__
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
// This lowers the unnecessary compiler warning (armv5) to remark.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
// "Warning:  #174-D: expression has no effect..." is caused by 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
// DBG_ARGS8 macro in no-debug builds.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
#pragma diag_remark 174
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
#endif
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
// CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
CNSmlContactsDataStore::CNSmlContactsBufferItem::~CNSmlContactsBufferItem()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
	delete iItemData;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
	delete iMimeType;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
	delete iMimeVersion;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
// CNSmlContactsDataStore::NewL
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
CNSmlContactsDataStore* CNSmlContactsDataStore::NewL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
	_DBG_FILE("CNSmlContactsDataStore::NewL: BEGIN");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
	CNSmlContactsDataStore* self = new ( ELeave ) CNSmlContactsDataStore();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
	CleanupStack::PushL(self);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
	self->ConstructL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
	CleanupStack::Pop(self); // self
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
	_DBG_FILE("CNSmlContactsDataStore::NewL: END");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
	return self;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
// CNSmlContactsDataStore::CNSmlContactsDataStore() 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
CNSmlContactsDataStore::CNSmlContactsDataStore() : 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
	iKey( TKeyArrayFix( _FOFF( TNSmlSnapshotItem,ItemId() ),ECmpTInt )),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
	iContactManager(NULL),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
	iStore(NULL),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
	iVCardEngine(NULL),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
	iIdConverter(NULL),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
	iContactLnks(NULL),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
	iContactViewBase(NULL),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
	iSize(NULL),	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
	iBuf(NULL)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
	iSyncHistory = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
	iSnapshotRegistered = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
	iServerMaxObjectSize = 0; // Maximum size default value 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
	iItemPos = -1;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
	iModificationCount = KNSmlCompactAfterChanges;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
	iState = ENSmlClosed;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
	iStoreName = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
	iRetCommand = KErrNone;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
	iLastOperation = ENSmlNone;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
// CNSmlContactsDataStore::ConstructL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
void CNSmlContactsDataStore::ConstructL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
	_DBG_FILE("CNSmlContactsDataStore::CNSmlContactsDataStore(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
	User::LeaveIfError( iRfs.Connect() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
	iUsedMimeType.Set( KNSmlvCard21Name() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
	iUsedMimeVersion.Set( KNSmlvCard21Ver() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
	iStringPool.OpenL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
	// Uid Sets
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
	iNewUids = new (ELeave) CNSmlDataItemUidSet();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   147
	iDeletedUids = new (ELeave) CNSmlDataItemUidSet();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   148
	iSoftDeletedUids = new (ELeave) CNSmlDataItemUidSet();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   149
	iMovedUids = new (ELeave) CNSmlDataItemUidSet();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
	iReplacedUids = new (ELeave) CNSmlDataItemUidSet();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   151
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
	// Create iDataMod
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
	// This should be done after OpenL if there are more than one database
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   154
	iDataMod = new (ELeave) CNSmlVCardMod();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   155
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   156
	SetOwnStoreFormatL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   157
	// open  contact database
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   158
	CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   159
	uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri()));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   160
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   161
	iContactManager = CVPbkContactManager::NewL(*uriArray);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   162
	CleanupStack::PopAndDestroy(uriArray);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   163
	//Default store name
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   164
	iDefaultStoreName = (VPbkContactStoreUris::DefaultCntDbUri()).AllocL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   165
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
	//Fill iPacketStoreName buffer with KLegacySymbianDatabase
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   167
    TBuf<KOldSymbianDBLength> dataBase(KLegacySymbianDatabase);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   168
	iPacketStoreName = HBufC::NewL(dataBase.Length());        
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   169
	TPtr pktStorePtr(iPacketStoreName->Des());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
	pktStorePtr.Copy(dataBase);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
	_DBG_FILE("CNSmlContactsDataStore::ConstructL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
// CNSmlContactsDataStore::~CNSmlContactsDataStore()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
CNSmlContactsDataStore::~CNSmlContactsDataStore()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
	_DBG_FILE("CNSmlContactsDataStore::~CNSmlContactsDataStore(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
	delete iStoreFormat; // SetOwnStoreFormatL creates
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
	iStringPool.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
	iRfs.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
	iWriteStream.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
	iReadStream.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
	delete iBuf;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
	if ( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
		TRAP_IGNORE( iChangeFinder->CloseL() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
		delete iChangeFinder;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
	if(iIdConverter)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
		delete iIdConverter;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
	if(iContactLnks)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
		delete iContactLnks;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
	if(iContactLink)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
		delete iContactLink;	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
	delete iContactViewBase;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
	if ( iContactsModsFetcher )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
		iContactsModsFetcher->Cancel(); 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
		delete iContactsModsFetcher;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
	if ( iContactManager )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
			if(iStore)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
			iStore->Close( *this );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
	    delete iContactManager;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
	delete iVCardEngine;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
	//  Delete UidSets		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
	delete iNewUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
	delete iDeletedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
	delete iSoftDeletedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
	delete iMovedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
	delete iReplacedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
	//	Empty BufferItemList if any
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
	if ( iContactsBufferItemList.Count() > 0 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
		if ( iContactsBufferItemList[iContactsBufferItemList.Count() - 1]->iItemData == iItemData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
			iItemData = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
	iContactsBufferItemList.ResetAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
	delete iDataMod;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
	delete iMergeItem;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
	if(iItemData)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
    	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
	    if(iItemData->Size() > 0 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
	        {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
		    delete iItemData;       
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
	        }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
	if(iItemDataAddBatch != iItemData)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
		delete iItemDataAddBatch;	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   259
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   260
	delete iDefaultStoreName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   261
	delete iPacketStoreName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   262
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   263
	delete iStoreName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   264
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   265
	iAddResultArray.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   266
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   267
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   269
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   270
// void CNSmlContactsDataStore::DoOpenL(const TDesC& 		  aStoreName, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   271
//									    MSmlSyncRelationship& aContext,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   272
//									    TRequestStatus& 	  aStatus)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   274
void CNSmlContactsDataStore::DoOpenL( const TDesC& aStoreName, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   275
									MSmlSyncRelationship& aContext, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   276
									TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   277
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   278
	DBG_ARGS(_S("CNSmlContactsDataStore::DoOpenL(): '%S' begin"), &aStoreName);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   281
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   282
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   283
	if( iState != ENSmlClosed )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
		User::RequestComplete( iCallerStatus, KErrInUse );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   286
		return;	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   287
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   288
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   289
	if( RFs::CharToDrive(aStoreName[0], iDrive) != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   290
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   291
		RFs::CharToDrive( KNSmlDriveC()[0], iDrive );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   292
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   293
	iOpened = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   294
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   295
	if( iStoreName )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   296
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   297
		delete iStoreName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   298
		iStoreName = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   299
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   300
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   301
		if ( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   302
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   303
		iChangeFinder->CloseL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   304
		delete iChangeFinder;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   305
		iChangeFinder = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   306
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   307
	// The Change finder maintains a list of all changes to the database.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
	iChangeFinder = CNSmlChangeFinder::NewL(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   309
					 aContext, iKey, iSyncHistory, KNSmlContactsAdapterImplUid );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   310
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   311
	iState = ENSmlOpenAndWaiting;			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   312
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
	//find and open the store
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   314
	if ( aStoreName == KNSmlContactStoreNameForDefaultDB )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   315
	    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   316
	iStore = iContactManager->ContactStoresL().Find(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   317
	TVPbkContactStoreUriPtr(*iDefaultStoreName));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   319
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   320
	   {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   321
	    iStore = iContactManager->ContactStoresL().Find(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   322
	TVPbkContactStoreUriPtr(aStoreName));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   323
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   324
	iStore->OpenL(*this);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   325
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   326
	iStoreName = aStoreName.AllocL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   327
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   328
	iVCardEngine = CVPbkVCardEng::NewL( *iContactManager );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   329
	iIdConverter = CVPbkContactIdConverter::NewL(*iStore );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   330
	if ( iContactsModsFetcher )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   331
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   332
		iContactsModsFetcher->Cancel();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   333
		delete iContactsModsFetcher;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   334
		iContactsModsFetcher = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   335
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   336
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   337
	iContactsModsFetcher = new (ELeave) CNSmlContactsModsFetcher( 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   338
							iSnapshotRegistered, *iContactManager,*iStore, iKey, *iChangeFinder );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   339
	iContactsModsFetcher->ConstructL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   340
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   341
#ifdef __NSML_MODULETEST__
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   342
	CActiveScheduler::Start();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   343
#endif
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   344
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   345
	_DBG_FILE("CNSmlContactsDataStore::DoOpenL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   346
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   348
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
// void CNSmlContactsDataStore::DoCancelRequest()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
void CNSmlContactsDataStore::DoCancelRequest()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
	_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
		if(iContactsModsFetcher)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
		iContactsModsFetcher->Cancel();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   357
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   358
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   359
	_DBG_FILE("CNSmlContactsDataStore::DoCancelRequest(): NOT NEEDED end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   360
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   361
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   362
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   363
// void CNSmlContactsDataStore::DoStoreName()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
const TDesC& CNSmlContactsDataStore::DoStoreName() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   367
	_DBG_FILE("CNSmlContactsDataStore::DoStoreName(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   368
	_DBG_FILE("CNSmlContactsDataStore::DoStoreName(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   369
	return *iStoreName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
// void CNSmlContactsDataStore::DefaultStoreNameL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
const TDesC& CNSmlContactsDataStore::DefaultStoreNameL() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   376
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
	_DBG_FILE("CNSmlContactsDataStore::DefaultStoreNameL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
	if ( !iDefaultStoreName )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
		return KNullDesC;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
	_DBG_FILE("CNSmlContactsDataStore::DefaultStoreNameL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
	//The engine methods that create syncml packet, use this information in Database fields
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
	return *iPacketStoreName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
// void CNSmlContactsDataStore::DoBeginTransactionL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
void CNSmlContactsDataStore::DoBeginTransactionL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
	_DBG_FILE("CNSmlContactsDataStore::DoBeginTransactionL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
	User::Leave( KErrNotSupported );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
	_DBG_FILE("CNSmlContactsDataStore::DoBeginTransactionL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
// void CNSmlContactsDataStore::DoCommitTransactionL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
void CNSmlContactsDataStore::DoCommitTransactionL(TRequestStatus& aStatus)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
	_DBG_FILE("CNSmlContactsDataStore::DoCommitTransactionL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
	User::RequestComplete( iCallerStatus, KErrNotSupported );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
	_DBG_FILE("CNSmlContactsDataStore::DoCommitTransactionL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
// void CNSmlContactsDataStore::DoRevertTransaction()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
void CNSmlContactsDataStore::DoRevertTransaction(TRequestStatus& aStatus)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
	_DBG_FILE("CNSmlContactsDataStore::DoRevertTransaction(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
	User::RequestComplete( iCallerStatus, KErrNotSupported );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
	_DBG_FILE("CNSmlContactsDataStore::DoRevertTransaction(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
// void CNSmlContactsDataStore::DoBeginBatchL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
void CNSmlContactsDataStore::DoBeginBatchL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
	_DBG_FILE("CNSmlContactsDataStore::DoBeginBatchL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
	iBatchMode = ETrue;			// SUPPORTED on Contacts
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
	_DBG_FILE("CNSmlContactsDataStore::DoBeginBatchL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
// void CNSmlContactsDataStore::DoCommitBatchL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
void CNSmlContactsDataStore::DoCommitBatchL( RArray<TInt>& aResultArray, TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
	_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
	if( !iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
		User::RequestComplete( iCallerStatus, KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
		_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): NOT ON BATCH MODE end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
//		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
// Go through Buffer and execute all commands return aResultArray
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
	iResultArray = &aResultArray;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
	iIndex = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
	TRAPD( leavecode,ExecuteBufferL() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
	if( leavecode != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
		User::RequestComplete( iCallerStatus, leavecode );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
	_DBG_FILE("CNSmlContactsDataStore::DoCommitBatchL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
// void CNSmlContactsDataStore::ExecuteBufferL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
void CNSmlContactsDataStore::ExecuteBufferL() 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
	_DBG_FILE("CNSmlContactsDataStore::ExecuteBufferL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
	TInt  retCommand( KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
	// Loop through buffered commands
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
		if( iIndex < iContactsBufferItemList.Count())
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
		if( iContactsBufferItemList[iIndex]->iStatus!= KNSmlNoError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
			retCommand = iContactsBufferItemList[iIndex]->iStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemAdd )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
			retCommand = ExecuteAddL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemReplace )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
			ExecuteUpdateL();		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemMove )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
			ExecuteMoveL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
		else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete ||
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
				 iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemSoftDelete )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
			ExecuteDeleteL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
		//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   509
		//	Set allready set commands from iContactsBufferItemList
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   510
		//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   511
		if( ( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemAdd     ||
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   512
		      iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemReplace ||
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   513
		      iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete  ||
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   514
		      iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemSoftDelete ) &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   515
		      iContactsBufferItemList[iIndex]->iStatus  != KNSmlNoError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   516
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   517
			retCommand = iContactsBufferItemList[iIndex]->iStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   518
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   519
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   520
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   521
		//if an error occurs when performing any operation
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   522
		//return the error status 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   523
			else if(retCommand!=KErrNone)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   524
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   525
			User::RequestComplete( iCallerStatus, retCommand );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   526
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   527
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   528
			iRetCommand = retCommand;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   529
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   530
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   531
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   532
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   533
// void CNSmlContactsDataStore::ExecuteAddL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   534
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   535
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   536
TInt CNSmlContactsDataStore::ExecuteAddL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   537
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   538
	TInt  retCommand( KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   539
	StripPropertyL( iItemDataAddBatch, KVersitTokenUID() ); // Remove UID's from data
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   540
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   541
	TInt err( KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   542
	if(iBatchMode)			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   543
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   544
		TRAP( err,LdoAddItemsL( iItemDataAddBatch,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   545
		                   iItemDataAddBatch->Ptr(0).Length()) );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   546
		if(err!=KErrNone)			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   547
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   548
			retCommand = err;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   549
			TInt j = iIndex;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   550
			while( j < iContactsBufferItemList.Count() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   551
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   552
				if( iContactsBufferItemList[j]->iModType == ENSmlCntItemAdd &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   553
				iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   554
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   555
					iContactsBufferItemList[j]->iStatus = KErrNotSupported;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   556
					iResultArray->AppendL(KErrNotSupported);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   557
					}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   558
				j++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   559
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   560
			}			                          
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   561
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   562
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   563
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   564
		const TPtr8 dataPtr = iItemDataAddBatch->Ptr(0);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   565
		TRAP( err, LdoAddItemL( dataPtr,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   566
					iContactsBufferItemList[iIndex]->iSize));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   567
		if(err!=KErrNone)			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   568
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   569
			retCommand = err;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   570
			}	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   571
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   572
	return retCommand; 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   573
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   574
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   575
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   576
// void CNSmlContactsDataStore::ExecuteDeleteL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   577
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   578
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   579
void CNSmlContactsDataStore:: ExecuteDeleteL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   580
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   581
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   582
	if(iBatchMode)			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   583
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   584
		iContactLnks = CVPbkContactLinkArray::NewL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   585
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   586
		TInt j=iIndex;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
		while( j < iContactsBufferItemList.Count() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   588
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
			if( (iContactsBufferItemList[j]->iModType == ENSmlCntItemDelete ||
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
			iContactsBufferItemList[j]->iModType == ENSmlCntItemSoftDelete) &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
			iContactsBufferItemList[j]->iStatus  == KNSmlNoError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
				TContactItemId id = iContactsBufferItemList[j]->iUid; 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
				if( id != 0 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
					MVPbkContactLink* contactLink = iIdConverter->IdentifierToLinkLC(id);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
					//check if the contact link is valid
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
					TInt index = iContactViewBase->IndexOfLinkL(*contactLink);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
					if(index != KErrNotFound)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
						{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
						iContactLnks->AppendL(contactLink);	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
						}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
						else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
						{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
						iContactsBufferItemList[j]->iStatus  = KErrNotFound;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
						}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
					CleanupStack::Pop();//contactLink				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
					}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
					else 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   612
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
					iContactsBufferItemList[j]->iStatus  = KErrNotFound;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
					}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
			j++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
		delete iContactViewBase;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
		iContactViewBase = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   621
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   622
		iContactManager->DeleteContactsL( *iContactLnks, *this );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
		iLastOperation = ENSmlDeleteOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   624
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   625
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   627
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
// void CNSmlContactsDataStore::ExecuteUpdateL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
void CNSmlContactsDataStore::ExecuteUpdateL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
	iUid  = iContactsBufferItemList[iIndex]->iUid;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
	iDataMod->SetUsedMimeType( iServerMimeType, iServerMimeVersion );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   638
	// Check whether merging is needed or not.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   639
	if( iDataMod->NeedsMerge() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   640
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   641
		iMergeItem = CBufFlat::NewL(64);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   642
		iWriteStream.Open(*iMergeItem);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   643
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   644
		MVPbkContactLink* contactLink = iIdConverter->IdentifierToLinkLC(iUid);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   645
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   646
		iVCardEngine->ExportVCardForSyncL(iWriteStream,*contactLink,*this);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   647
		CleanupStack::PopAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   648
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   649
		iLastOperation = ENSMLUpdateExportOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   650
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   651
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   652
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   653
			LdoUpdateItemL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   654
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   655
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   656
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   657
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   658
// void CNSmlContactsDataStore::ExecuteMoveL
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   659
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   660
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   661
void CNSmlContactsDataStore::ExecuteMoveL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   662
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   663
	// move command is not supported
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   664
	if(!iBatchMode)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   665
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   666
		ResetBuffer();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   667
		User::RequestComplete( iCallerStatus, KErrNotSupported );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   668
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   669
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   670
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   671
		iResultArray->AppendL(KErrNotSupported);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   672
		iIndex++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   673
		if(iIndex == iContactsBufferItemList.Count() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   674
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   675
			ResetBuffer();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   676
			User::RequestComplete( iCallerStatus, KErrNone );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   677
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   678
		else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   679
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   680
				ExecuteBufferL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   681
			}		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   682
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   683
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   684
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   685
// void CNSmlContactsDataStore::DoCancelBatch()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   686
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   687
void CNSmlContactsDataStore::DoCancelBatch()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   688
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   689
	_DBG_FILE("CNSmlContactsDataStore::DoCancelBatch(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   690
	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   691
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   692
		iBatchMode = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   693
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   694
	//	Empty BufferItemList if any
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   695
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   696
		iContactsBufferItemList.ResetAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   697
		iItemData = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   698
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   699
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   700
	_DBG_FILE("CNSmlContactsDataStore::DoCancelBatch(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   701
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   702
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   703
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   704
// void CNSmlContactsDataStore::DoSetRemoteStoreFormatL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   705
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   706
void CNSmlContactsDataStore::DoSetRemoteStoreFormatL( const CSmlDataStoreFormat& aServerDataStoreFormat )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   707
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   708
	_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteStoreFormatL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   709
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   710
	TBool foundMime = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   711
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   712
	//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   713
	// KErrNotSupported is returned if server does not support same mime type 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   714
	// and same mime type version as Data Provider.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   715
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   716
	TInt i=0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
	while( i< aServerDataStoreFormat.MimeFormatCount() && !foundMime )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
		if( iUsedMimeType.MatchF(aServerDataStoreFormat.MimeFormat(i).MimeType().DesC())      ==0 &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
		    iUsedMimeVersion.MatchF(aServerDataStoreFormat.MimeFormat(i).MimeVersion().DesC())==0 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
			foundMime = ETrue;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
			iServerMimeType    = aServerDataStoreFormat.MimeFormat(i).MimeType();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   724
			iServerMimeVersion = aServerDataStoreFormat.MimeFormat(i).MimeVersion();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   725
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   726
		i++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   727
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   728
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   729
	if( !foundMime )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   730
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   731
		_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteStoreFormatL(): SERVER MIMETYPE NOTSUPPORTED end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   732
		User::Leave( KErrNotSupported );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   733
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   734
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   735
	iDataMod->SetPartnerStoreFormat( (CSmlDataStoreFormat&) aServerDataStoreFormat );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   736
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   737
	SetOwnStoreFormatL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   738
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   739
	TInt error = iDataMod->SetUsedMimeType( iServerMimeType, iServerMimeVersion );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   740
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   741
	User::LeaveIfError( error );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   742
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   743
	_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteStoreFormatL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   744
	return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   745
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   746
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   747
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   748
// void CNSmlContactsDataStore::SetOwnStoreFormatL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   749
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   750
void CNSmlContactsDataStore::SetOwnStoreFormatL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   751
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   752
	_DBG_FILE("CNSmlContactsDataStore::SetOwnStoreFormatL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   753
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   754
	if( !iStoreFormat )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   755
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   756
		TFileName fileName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   757
		TParse parse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759
		// Check correct Data Sync protocol
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   760
        TInt value( EDataSyncNotRunning );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   761
        TInt error = RProperty::Get( KPSUidDataSynchronizationInternalKeys,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   762
                                     KDataSyncStatus,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   763
                                     value );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   764
        if ( error == KErrNone &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   765
             value == EDataSyncRunning )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   766
            {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   767
            parse.Set( KNSmlContactsStoreFormatRsc_1_1_2, &KDC_RESOURCE_FILES_DIR, NULL );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   768
            }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   769
        else // error or protocol version 1.2 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   770
            {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   771
            parse.Set( KNSmlContactsStoreFormatRsc_1_2, &KDC_RESOURCE_FILES_DIR, NULL );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   772
            }		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   773
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   774
		fileName = parse.FullName();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   775
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   776
		RResourceFile resourceFile; 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   777
		BaflUtils::NearestLanguageFile( iRfs, fileName );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   778
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   779
		resourceFile.OpenL( iRfs, fileName );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   780
		CleanupClosePushL( resourceFile );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   781
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   782
		HBufC8* contactsDataFormat = resourceFile.AllocReadLC( NSML_CONTACTS_DATA_STORE_FORMAT );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   783
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   784
		TResourceReader reader;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   785
		reader.SetBuffer( contactsDataFormat );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   786
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   787
		iStoreFormat = CSmlDataStoreFormat::NewLC( iStringPool, reader );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   788
		CleanupStack::Pop(iStoreFormat); // iStoreFormat
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   789
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   790
		CleanupStack::PopAndDestroy(2); // contactsDataFormat, resourceFile  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   791
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   792
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   793
	iDataMod->SetOwnStoreFormat( *iStoreFormat );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   794
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   795
	_DBG_FILE("CNSmlContactsDataStore::SetOwnStoreFormatL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   796
	return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   797
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   798
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   799
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   800
// void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   801
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   802
void CNSmlContactsDataStore::DoSetRemoteMaxObjectSize( TInt aServerMaxObjectSize )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   803
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   804
	_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   805
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   806
	iServerMaxObjectSize = aServerMaxObjectSize;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   807
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   808
	_DBG_FILE("CNSmlContactsDataStore::DoSetRemoteMaxObjectSize(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   809
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   810
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   811
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   812
// void CNSmlContactsDataStore::DoMaxObjectSize()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   813
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   814
TInt CNSmlContactsDataStore::DoMaxObjectSize() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   815
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   816
	_DBG_FILE("CNSmlContactsDataStore::DoMaxObjectSize(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   817
	_DBG_FILE("CNSmlContactsDataStore::DoMaxObjectSize() 100 k: end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   818
	return KNSmlDataStoreMaxSize;  // 100 k
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   819
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   820
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   821
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   822
// void CNSmlContactsDataStore::DoOpenItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   823
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   824
void CNSmlContactsDataStore::DoOpenItemL( TSmlDbItemUid aUid, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   825
										  TBool& aFieldChange, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   826
										  TInt& aSize, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   827
										  TSmlDbItemUid& aParent, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   828
										  TDes8& aMimeType, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   829
										  TDes8& aMimeVer, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   830
										  TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   831
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   832
	_DBG_FILE("CNSmlContactsDataStore::DoOpenItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   833
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   834
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   835
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   836
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   837
	if ( iState != ENSmlOpenAndWaiting )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   838
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   839
		User::RequestComplete( iCallerStatus, KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   840
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   841
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   842
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   843
	iItemPos = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   844
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   845
	aFieldChange = EFalse; // Whole item sent NOT SUPPORT ON FIELDCHANGE
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   846
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   847
	aMimeType    = iStoreFormat->MimeFormat( 0 ).MimeType().DesC();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   848
	aMimeVer	 = iStoreFormat->MimeFormat( 0 ).MimeVersion().DesC();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   849
	aParent      = KNullDataItemId;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   850
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   851
	iModType = ENSmlCntItemRead;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   852
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   853
	if( !iItemData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   854
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   855
		iItemData= CBufFlat::NewL( KNSmlItemDataExpandSize );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   856
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   857
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   858
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   859
		iItemData->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   860
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   861
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   862
	 LdoFetchItemL( aUid, *iItemData );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   863
	 iSize = &aSize;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   864
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   865
	_DBG_FILE("CNSmlContactsDataStore::DoOpenItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   866
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   867
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   868
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   869
// void CNSmlContactsDataStore::DoCreateItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   870
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   871
void CNSmlContactsDataStore::DoCreateItemL( TSmlDbItemUid& aUid, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   872
											TInt aSize, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   873
											TSmlDbItemUid /*aParent*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   874
											const TDesC8& aMimeType, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   875
											const TDesC8& aMimeVer, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   876
											TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   877
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   878
	_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   879
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   880
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   881
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   882
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   883
	TInt err = KErrNone;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   884
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   885
	if ( iState != ENSmlOpenAndWaiting )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   886
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   887
		User::RequestComplete( iCallerStatus, KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   888
		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotReady: END");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   889
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   890
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   891
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   892
	iItemSize = aSize; // Size sent from server
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   893
	iModType  = ENSmlCntItemAdd;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   894
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   895
	iMimeTypeItem.Set( aMimeType );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   896
	iMimeVersionItem.Set( aMimeVer );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   897
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   898
	if ( iItemPos == -1 || !iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   899
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   900
		iItemPos = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   901
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   902
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   903
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   904
	if( iItemData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   905
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   906
		iItemData->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   907
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   908
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   909
	if( !iItemDataAddBatch )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   910
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   911
		iItemDataAddBatch= CBufFlat::NewL( KNSmlItemDataExpandSize );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   912
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   913
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   914
	// Check MimeType and MimeVersion
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   915
	if( ( aMimeType.MatchF( KNSmlvCard21Name ) < 0 ) &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   916
	    ( aMimeType.MatchF( KNSmlvCard30Name ) < 0 ))
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   917
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   918
		User::RequestComplete( iCallerStatus, KErrNotSupported );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   919
		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL - KErrNotSupported: END");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   920
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   921
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   922
    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   923
    // Is there enough space on drive 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   924
	if( DriveBelowCriticalLevelL( aSize ) )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   925
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   926
		err = KErrDiskFull;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   927
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   928
				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   929
	iItemData = AddBufferListL( aUid,aSize, err );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   930
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   931
	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   932
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   933
		iState = ENSmlItemCreating;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   934
		User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   935
		_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL(): begin BATCH");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   936
		return ; // Put into buffer
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   937
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   938
				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   939
	if ( err == KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   940
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   941
		iState = ENSmlItemCreating;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   942
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   943
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   944
	User::RequestComplete( iCallerStatus, err );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   945
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   946
	_DBG_FILE("CNSmlContactsDataStore::DoCreateItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   947
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   948
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   949
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   950
// void CNSmlContactsDataStore::DoReplaceItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   951
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   952
void CNSmlContactsDataStore::DoReplaceItemL( TSmlDbItemUid aUid, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   953
											 TInt aSize, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   954
											 TSmlDbItemUid /*aParent*/,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   955
											 TBool aFieldChange, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   956
											 TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   957
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   958
	_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   959
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   960
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   961
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   962
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   963
	TInt err = KErrNone;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   964
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   965
	iUid      = aUid;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   966
	iItemSize = aSize;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   967
	iModType  = ENSmlCntItemReplace;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   968
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   969
	if ( iItemPos == -1 || !iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   970
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   971
		iItemPos = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   972
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   973
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   974
	if ( iItemData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   975
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   976
		iItemData->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   977
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   978
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   979
	// Field change not supported
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   980
	if( aFieldChange )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   981
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   982
		err = KErrNotSupported;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   983
		if( !iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   984
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   985
			User::RequestComplete( iCallerStatus, err );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   986
			return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   987
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   988
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   989
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   990
	iItemData = AddBufferListL( aUid, aSize, err );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   991
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   992
	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   993
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   994
		iState = ENSmlItemUpdating;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   995
		_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): BATCHMODE end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   996
		User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   997
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   998
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   999
	if ( err == KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1000
	    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1001
	    iState = ENSmlItemUpdating;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1002
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1003
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1004
	User::RequestComplete( iCallerStatus, err );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1005
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1006
	_DBG_FILE("CNSmlContactsDataStore::DoReplaceItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1007
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1008
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1009
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1010
// void CNSmlContactsDataStore::DoReadItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1011
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1012
void CNSmlContactsDataStore::DoReadItemL( TDes8& aBuffer )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1013
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1014
	_DBG_FILE("CNSmlContactsDataStore::DoReadItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1015
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1016
    if ( iState != ENSmlItemOpen || !iItemData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1017
        {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1018
        iItemPos = -1;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1019
        User::Leave( KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1020
        }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1021
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1022
    if ( iItemPos == -1 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1023
        {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1024
        User::Leave( KErrEof );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1025
        }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1026
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1027
    if ( aBuffer.Size() < iItemData->Size() - iItemPos )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1028
        {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1029
        iItemData->Read( iItemPos, aBuffer );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1030
        iItemPos += aBuffer.Size();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1031
        }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1032
    else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1033
        {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1034
        iItemData->Read( iItemPos, aBuffer, iItemData->Size() - iItemPos );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1035
        iItemPos = -1;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1036
        }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1037
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1038
	_DBG_FILE("CNSmlContactsDataStore::DoReadItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1039
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1040
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1041
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1042
// void CNSmlContactsDataStore::DoWriteItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1043
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1044
void CNSmlContactsDataStore::DoWriteItemL( const TDesC8& aData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1045
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1046
	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1047
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1048
	/* Data must be accumulated from pieces of information */
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1049
	if ( iState == ENSmlItemCreating || iState == ENSmlItemUpdating )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1050
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1051
		if ( iItemData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1052
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1053
			if ( iItemPos == -1 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1054
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1055
            	iStateItem = KErrEof;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1056
            	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1057
            		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1058
            		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1059
            		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1060
				User::Leave( KErrEof );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1061
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1062
			iItemData->InsertL( iItemData->Size(), aData );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1063
			iItemPos += aData.Size();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1064
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1065
			if ( aData.Size() > iItemSize )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1066
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1067
				iState =     ENSmlItemOverflow;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1068
            	iStateItem = KErrOverflow;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1069
            	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): KErrOverflow End");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1070
        		DBG_ARGS(_S("CNSmlContactsDataStore::DoWriteItemL(): Server sent=(%d) Item=(%d)"),
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1071
        		            iItemSize, aData.Size()); 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1072
            	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1073
            		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1074
            		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1075
            		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1076
				User::Leave( KErrOverflow );				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1077
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1078
			if ( aData.Size() == iItemSize )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1079
			    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1080
            	iStateItem = KErrNone;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1081
			    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1082
			return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1083
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1084
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1085
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1086
	iStateItem = KErrNotReady;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1087
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1088
	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1089
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1090
       	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): KErrNotReady End");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1091
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1092
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1093
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1094
	User::Leave( KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1095
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1096
	_DBG_FILE("CNSmlContactsDataStore::DoWriteItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1097
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1098
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1099
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1100
// void CNSmlContactsDataStore::DoCommitItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1101
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1102
void CNSmlContactsDataStore::DoCommitItemL( TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1103
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1104
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1105
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1106
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1107
	_DBG_FILE("CNSmlContactsDataStore::DoCommitItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1108
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1109
	// Data OK => insert to total buffer
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1110
	if (iModType   == ENSmlCntItemAdd && 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1111
      	iStateItem == KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1112
	    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1113
	    iItemDataAddBatch->InsertL( iItemDataAddBatch->Size(),iItemData->Ptr(0), iItemData->Size() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1114
	    iItemDataAddBatch->InsertL( iItemDataAddBatch->Size(), KVersitTokenCRLF() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1115
      	if( iContactsBufferItemList.Count() > 0 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1116
      	    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1117
            iContactsBufferItemList[iContactsBufferItemList.Count()-1]->iStatus  = KNSmlNoError; 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1118
      	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1119
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1120
	 else if ((iModType   == ENSmlCntItemAdd ||         // If some write problems
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1121
      	       iModType   == ENSmlCntItemReplace) && 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1122
      	       iStateItem != KErrNone &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1123
      	       iContactsBufferItemList.Count() > 0) 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1124
	    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1125
        iContactsBufferItemList[iContactsBufferItemList.Count()-1]->iStatus  = iStateItem; 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1126
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1127
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1128
	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1129
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1130
		iItemData = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1131
		iState = ENSmlOpenAndWaiting;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1132
		User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1133
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1134
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1135
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1136
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1137
	iIndex = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1138
	ExecuteBufferL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1139
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1140
	iItemData = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1141
	iState = ENSmlOpenAndWaiting;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1142
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1143
	_DBG_FILE("CNSmlContactsDataStore::DoCommitItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1144
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1145
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1146
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1147
// void CNSmlContactsDataStore::DoCloseItem()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1148
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1149
void CNSmlContactsDataStore::DoCloseItem()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1150
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1151
	_DBG_FILE("CNSmlContactsDataStore::DoCloseItem(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1152
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1153
	if ( iState == ENSmlItemOpen )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1154
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1155
		iItemPos = -1;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1156
		if ( iItemData )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1157
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1158
			delete iItemData;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1159
			iItemData = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1160
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1161
		iState = ENSmlOpenAndWaiting;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1162
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1163
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1164
	_DBG_FILE("CNSmlContactsDataStore::DoCloseItem(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1165
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1166
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1167
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1168
// void CNSmlContactsDataStore::DoMoveItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1169
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1170
void CNSmlContactsDataStore::DoMoveItemL( TSmlDbItemUid aUid, TSmlDbItemUid /*aNewParent*/, TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1171
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1172
	_DBG_FILE("CNSmlContactsDataStore::DoMoveItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1173
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1174
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1175
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1176
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1177
	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1178
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1179
		iModType = ENSmlCntItemMove;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1180
		TInt fSize = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1181
		AddBufferListL( aUid, fSize, KErrNotSupported );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1182
		User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1183
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1184
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1185
	User::RequestComplete( iCallerStatus, KErrNotSupported );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1186
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1187
	_DBG_FILE("CNSmlContactsDataStore::DoMoveItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1188
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1189
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1190
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1191
// void CNSmlContactsDataStore::DoDeleteItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1192
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1193
void CNSmlContactsDataStore::DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1194
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1195
	_DBG_FILE("CNSmlContactsDataStore::DoDeleteItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1196
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1197
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1198
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1199
	if( iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1200
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1201
		if(iContactViewBase ==NULL)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1202
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1203
		CreateViewL();	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1204
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1205
	if( iModType != ENSmlCntItemSoftDelete ) // Treated like deletes
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1206
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1207
		iModType  = ENSmlCntItemDelete;	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1208
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1209
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1210
	TInt fSize = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1211
	AddBufferListL( aUid, fSize, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1212
	User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1213
	return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1214
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1215
	iUid = aUid;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1216
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1217
	//add the contactlink to CVPbkContactLinkArray
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1218
	MVPbkContactLink* contactLink  = iIdConverter->IdentifierToLinkLC(aUid);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1219
	CleanupStack::Pop();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1220
	CVPbkContactLinkArray* contactLnks = CVPbkContactLinkArray::NewLC();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1221
	contactLnks->AppendL( contactLink );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1222
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1223
 	iContactManager->DeleteContactsL( *contactLnks, *this );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1224
	CleanupStack::PopAndDestroy(); 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1225
	iLastOperation = ENSmlDeleteOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1226
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1227
	_DBG_FILE("CNSmlContactsDataStore::DoDeleteItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1228
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1229
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1230
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1231
// void CNSmlContactsDataStore::DoSoftDeleteItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1232
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1233
void CNSmlContactsDataStore::DoSoftDeleteItemL( TSmlDbItemUid /*aUid*/, TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1234
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1235
	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeleteItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1236
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1237
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1238
	User::RequestComplete( iCallerStatus, KErrNotSupported );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1239
	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeleteItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1240
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1241
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1242
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1243
// void CNSmlContactsDataStore::DoDeleteAllItemsL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1244
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1245
void CNSmlContactsDataStore::DoDeleteAllItemsL( TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1246
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1247
	_DBG_FILE("CNSmlContactsDataStore::DoDeleteAllItemsL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1248
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1249
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1250
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1251
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1252
	//create view to get all the contactlinks to delete
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1253
	if(iContactViewBase ==NULL)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1254
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1255
		CreateViewL();	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1256
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1257
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1258
	iLastOperation = ENSMLDeleteAllOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1259
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1260
	_DBG_FILE("CNSmlContactsDataStore::DoDeleteAllItemsL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1261
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1262
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1263
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1264
// TBool CNSmlContactsDataStore::DoHasSyncHistory()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1265
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1266
TBool CNSmlContactsDataStore::DoHasSyncHistory() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1267
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1268
	_DBG_FILE("CNSmlContactsDataStore::DoHasSyncHistory(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1269
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1270
	TBool doHasSyncHistory = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1271
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1272
	if( !iOpened ) 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1273
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1274
		_DBG_FILE("CNSmlContactsDataStore::DoHasSyncHistory(): NOT OPEN end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1275
		return doHasSyncHistory;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1276
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1277
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1278
	if( iSyncHistory )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1279
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1280
		if ( iOpenedStoreId != iChangeFinder->DataStoreUid() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1281
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1282
			iChangeFinder->SetDataStoreUid( iOpenedStoreId );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1283
			doHasSyncHistory = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1284
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1285
		else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1286
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1287
			doHasSyncHistory = ETrue;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1288
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1289
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1290
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1291
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1292
		iChangeFinder->SetDataStoreUid( iOpenedStoreId );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1293
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1294
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1295
	_DBG_FILE("CNSmlContactsDataStore::DoHasSyncHistory(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1296
	return doHasSyncHistory;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1297
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1298
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1299
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1300
// void CNSmlContactsDataStore::DoAddedItems()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1301
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1302
const MSmlDataItemUidSet& CNSmlContactsDataStore::DoAddedItems() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1303
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1304
	_DBG_FILE("CNSmlContactsDataStore::DoAddedItems(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1305
	if ( iState == ENSmlOpenAndWaiting )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1306
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1307
		iNewUids->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1308
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1309
		if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1310
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1311
			TRAPD( err,iChangeFinder->FindNewItemsL( *iNewUids ) );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1312
			if( err != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1313
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1314
				_DBG_FILE("CNSmlContactsDataStore::DoAddedItems(): LEAVE end");				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1315
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1316
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1317
		}	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1318
	_DBG_FILE("CNSmlContactsDataStore::DoAddedItems(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1319
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1320
	return *iNewUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1321
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1322
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1323
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1324
// void CNSmlContactsDataStore::DoDeletedItems()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1325
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1326
const MSmlDataItemUidSet& CNSmlContactsDataStore::DoDeletedItems() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1327
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1328
	_DBG_FILE("CNSmlContactsDataStore::DoDeletedItems(): begin");	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1329
	if ( iState == ENSmlOpenAndWaiting )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1330
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1331
		iDeletedUids->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1332
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1333
		if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1334
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1335
			TRAPD(err,iChangeFinder->FindDeletedItemsL( *iDeletedUids ) );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1336
			if( err != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1337
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1338
				_DBG_FILE("CNSmlContactsDataStore::DoDeletedItems(): LEAVE end");				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1339
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1340
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1341
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1342
	_DBG_FILE("CNSmlContactsDataStore::DoDeletedItems(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1343
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1344
	return *iDeletedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1345
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1346
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1347
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1348
// void CNSmlContactsDataStore::DoSoftDeletedItems()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1349
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1350
const MSmlDataItemUidSet& CNSmlContactsDataStore::DoSoftDeletedItems() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1351
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1352
	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeletedItems(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1353
	if ( iState == ENSmlOpenAndWaiting )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1354
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1355
		iSoftDeletedUids->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1356
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1357
		if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1358
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1359
			TRAPD( err, iChangeFinder->FindSoftDeletedItemsL( *iSoftDeletedUids ) );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1360
			if( err != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1361
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1362
				_DBG_FILE("CNSmlContactsDataStore::DoSoftDeletedItems(): LEAVE end");				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1363
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1364
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1365
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1366
	_DBG_FILE("CNSmlContactsDataStore::DoSoftDeletedItems: END");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1367
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1368
	return *iSoftDeletedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1369
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1370
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1371
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1372
// void CNSmlContactsDataStore::DoModifiedItems()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1373
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1374
const MSmlDataItemUidSet& CNSmlContactsDataStore::DoModifiedItems() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1375
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1376
	_DBG_FILE("CNSmlContactsDataStore::DoModifiedItems(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1377
	if ( iState == ENSmlOpenAndWaiting )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1378
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1379
		iReplacedUids->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1380
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1381
		if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1382
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1383
			TRAPD( err, iChangeFinder->FindChangedItemsL( *iReplacedUids ) );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1384
			if( err != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1385
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1386
				_DBG_FILE("CNSmlContactsDataStore::DoModifiedItems(): LEAVE end");				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1387
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1388
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1389
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1390
	_DBG_FILE("CNSmlContactsDataStore::DoModifiedItems: END");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1391
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1392
	return *iReplacedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1393
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1394
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1395
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1396
// void CNSmlContactsDataStore::DoMovedItems()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1397
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1398
const MSmlDataItemUidSet& CNSmlContactsDataStore::DoMovedItems() const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1399
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1400
	_DBG_FILE("CNSmlContactsDataStore::DoMovedItems(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1401
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1402
	if ( iState == ENSmlOpenAndWaiting )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1403
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1404
		iMovedUids->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1405
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1406
		if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1407
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1408
			TRAPD( err, iChangeFinder->FindMovedItemsL( *iMovedUids ) );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1409
			if( err != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1410
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1411
				_DBG_FILE("CNSmlContactsDataStore::DoMovedItems(): LEAVE end");				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1412
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1413
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1414
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1415
	_DBG_FILE("CNSmlContactsDataStore::DoMovedItems: END");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1416
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1417
	return *iMovedUids;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1418
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1419
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1420
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1421
// void CNSmlContactsDataStore::DoResetChangeInfoL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1422
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1423
void CNSmlContactsDataStore::DoResetChangeInfoL( TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1424
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1425
	_DBG_FILE("CNSmlContactsDataStore::DoResetChangeInfoL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1426
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1427
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1428
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1429
	if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1430
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1431
		iChangeFinder->ResetL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1432
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1433
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1434
	iSnapshotRegistered = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1435
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1436
		if ( iContactsModsFetcher )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1437
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1438
		iContactsModsFetcher->FetchModificationsL( aStatus );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1439
#ifdef __NSML_MODULETEST__
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1440
		CActiveScheduler::Start();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1441
#endif
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1442
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1443
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1444
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1445
		User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1446
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1447
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1448
	_DBG_FILE("CNSmlContactsDataStore::DoResetChangeInfoL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1449
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1450
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1451
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1452
// void CNSmlContactsDataStore::DoCommitChangeInfoL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1453
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1454
void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1455
												  const MSmlDataItemUidSet& aItems )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1456
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1457
	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(aItems): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1458
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1459
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1460
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1461
	if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1462
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1463
		iChangeFinder->CommitChangesL( aItems );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1464
		User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1465
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1466
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1467
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1468
	User::RequestComplete( iCallerStatus, KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1469
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1470
	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(aItems): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1471
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1472
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1473
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1474
// void CNSmlContactsDataStore::DoCommitChangeInfoL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1475
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1476
void CNSmlContactsDataStore::DoCommitChangeInfoL( TRequestStatus& aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1477
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1478
	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1479
	iCallerStatus = &aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1480
	*iCallerStatus = KRequestPending;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1481
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1482
	if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1483
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1484
		iChangeFinder->CommitChangesL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1485
		User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1486
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1487
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1488
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1489
	User::RequestComplete( iCallerStatus, KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1490
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1491
	_DBG_FILE("CNSmlContactsDataStore::DoCommitChangeInfoL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1492
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1493
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1494
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1495
// CDesCArray* CNSmlContactsDataStore::DoListStoresLC()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1496
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1497
CDesCArray* CNSmlContactsDataStore::DoListStoresLC()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1498
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1499
	_DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1500
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1501
	MVPbkContactStoreList& storeList = iContactManager->ContactStoresL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1502
	CDesCArrayFlat* stores = new (ELeave) CDesCArrayFlat(storeList.Count());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1503
	CleanupStack::PushL( stores );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1504
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1505
  TBuf<KVPbhkPrefixLength> phoneDataBasePrefix(KVPbhkSymbianDBPrefix);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1506
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1507
	for(TInt i=0 ; i< storeList.Count(); i++)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1508
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1509
	    TBuf<KNSmlDefaultStoreNameMaxSize>  currentStore(storeList.At(i).StoreProperties().Uri().UriDes());	    	   
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1510
	    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1511
	    if(currentStore.Find(phoneDataBasePrefix) == 0)//Check if Symbian Database
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1512
	    {	    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1513
	    		//For backward compatability with local and remote servers
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1514
        	    //The Symbian Db name remains unchanged	   
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1515
        	    //The engine methods that create syncml packet, use this information in Database fields
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1516
	            stores->AppendL(*iPacketStoreName);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1517
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1518
	    else//End Symbian Database check
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1519
	    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1520
		     stores->AppendL(storeList.At(i).StoreProperties().Uri().UriDes());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1521
	    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1522
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1523
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1524
	_DBG_FILE("CNSmlContactsDataStore::DoListStoresLC(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1525
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1526
	return stores;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1527
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1528
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1529
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1530
// TInt CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1531
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1532
void CNSmlContactsDataStore::LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1533
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1534
	_DBG_FILE("CNSmlContactsDataStore::LdoFetchItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1535
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1536
	 iWriteStream.Open(aItem);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1537
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1538
	 MVPbkContactLink* contactLink  = iIdConverter->IdentifierToLinkLC(aUid);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1539
	 iVCardEngine->ExportVCardForSyncL(iWriteStream,*contactLink,*this);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1540
	 CleanupStack::PopAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1541
	 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1542
	 iLastOperation = ENSMLFetchOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1543
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1544
	_DBG_FILE("CNSmlContactsDataStore::LdoFetchItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1545
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1546
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1547
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1548
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1549
// TInt CNSmlContactsDataStore::LdoAddItemL( TSmlDbItemUid& aUid,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1550
//                                           const TDesC8& aItem,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1551
//                                           TInt aSize,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1552
//                                           TTime& aLastModified,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1553
//                                           TBool& aConfidential )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1554
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1555
void CNSmlContactsDataStore::LdoAddItemL( const TDesC8& aItem,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1556
                                          TInt aSize)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1557
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1558
	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1559
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1560
	if( !iOpened )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1561
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1562
		User::Leave( KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1563
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1564
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1565
	// Is there enough space on drive 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1566
	if( DriveBelowCriticalLevelL( aSize ) )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1567
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1568
		User::Leave( KErrDiskFull );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1569
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1570
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1571
	 iBuf = aItem.AllocLC();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1572
	StripPropertyL( iBuf, KVersitTokenUID() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1573
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1574
	 iReadStream.Open( *iBuf );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1575
	// import a vcard without checking for duplicates
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1576
	iVCardEngine->ImportVCardForSyncL(*iStore,iReadStream,*this);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1577
	iLastOperation = ENSmlAddOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1578
	CleanupStack::Pop(iBuf);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1579
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1580
	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1581
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1582
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1583
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1584
// TInt CNSmlContactsDataStore::LdoAddItemsL( CBufBase*& aItems,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1585
//                                           TInt aSize)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1586
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1587
void CNSmlContactsDataStore::LdoAddItemsL( CBufBase*& aItems,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1588
                                          TInt aSize)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1589
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1590
	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1591
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1592
	if( !iOpened )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1593
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1594
		User::Leave( KErrNotReady );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1595
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1596
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1597
	// Is there enough space on drive 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1598
	if( DriveBelowCriticalLevelL( aSize ) )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1599
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1600
		User::Leave( KErrDiskFull );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1601
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1602
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1603
	iReadStream.Open( aItems->Ptr(0) );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1604
	 // import vcards without checking for duplicates
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1605
	iVCardEngine->ImportVCardForSyncL(*iStore,iReadStream,*this);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1606
	iLastOperation = ENSmlAddOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1607
	_DBG_FILE("CNSmlContactsDataStore::LdoAddItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1608
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1609
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1610
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1611
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1612
// TInt CNSmlContactsDataStore::LdoUpdateItemL(TSmlDbItemUid aUid,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1613
//                                             const TDesC8& aItem,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1614
//                                             TInt aSize,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1615
//                                             TTime& aLastModified )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1616
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1617
void CNSmlContactsDataStore::LdoUpdateItemL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1618
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1619
	_DBG_FILE("CNSmlContactsDataStore::LdoUpdateItemL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1620
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1621
	iBuf = iContactsBufferItemList[iIndex]->iItemData->Ptr(0).AllocLC();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1622
	// Remove UID's from data
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1623
	StripPropertyL( iBuf, KVersitTokenUID() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1624
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1625
	iReadStream.Open( *iBuf );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1626
	MVPbkContactLink* contactLink = iIdConverter->IdentifierToLinkLC(iUid);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1627
	  iVCardEngine->ImportVCardMergeL(*contactLink,*iStore,iReadStream,*this);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1628
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1629
	CleanupStack::Pop();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1630
	iLastOperation = ENSMLUpdateImportOp;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1631
	CleanupStack::Pop(iBuf);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1632
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1633
	_DBG_FILE("CNSmlContactsDataStore::LdoUpdateItemL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1634
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1635
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1636
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1637
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1638
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1639
// CNSmlContactsDataStore::DriveBelowCriticalLevelL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1640
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1641
TBool CNSmlContactsDataStore::DriveBelowCriticalLevelL( TInt aSize )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1642
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1643
	return SysUtil::DiskSpaceBelowCriticalLevelL( &iRfs, aSize, iDrive );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1644
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1645
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1646
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1647
// CBufBase* CNSmlContactsDataStore::AddBufferListL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1648
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1649
CBufBase* CNSmlContactsDataStore::AddBufferListL( TSmlDbItemUid& aUid, TInt aSize, TInt aStatus )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1650
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1651
	_DBG_FILE("CNSmlContactsDataStore::AddBufferListL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1652
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1653
	CNSmlContactsBufferItem* newBufferItem = new (ELeave) CNSmlContactsBufferItem;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1654
	CleanupStack::PushL( newBufferItem );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1655
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1656
	if( iModType == ENSmlCntItemAdd )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1657
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1658
		newBufferItem->iPUid     = &aUid;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1659
		newBufferItem->iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1660
    	newBufferItem->iStatus   = KErrGeneral; // Default for add
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1661
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1662
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1663
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1664
		newBufferItem->iPUid = &aUid;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1665
		newBufferItem->iUid = aUid;		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1666
		newBufferItem->iItemData = CBufFlat::NewL( KNSmlItemDataExpandSize );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1667
    	newBufferItem->iStatus = KNSmlNoError; // Default if not handled
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1668
		}		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1669
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1670
	newBufferItem->iModType = iModType;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1671
	newBufferItem->iMimeType = iMimeTypeItem.AllocL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1672
	newBufferItem->iMimeVersion = iMimeVersionItem.AllocL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1673
	newBufferItem->iSize = aSize;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1674
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1675
	if( aStatus != KErrNone )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1676
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1677
		newBufferItem->iStatus  = aStatus;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1678
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1679
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1680
	iContactsBufferItemList.AppendL( newBufferItem );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1681
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1682
	iMimeTypeItem.Set( KNullDesC8 ); 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1683
	iMimeVersionItem.Set( KNullDesC8 );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1684
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1685
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1686
	CleanupStack::Pop();	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1687
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1688
	if( iModType == ENSmlCntItemAdd && 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1689
	    aStatus  == KErrNotSupported )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1690
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1691
		iStateItem = KErrNotSupported;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1692
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1693
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1694
	_DBG_FILE("CNSmlContactsDataStore::AddBufferListL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1695
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1696
	return newBufferItem->iItemData;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1697
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1698
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1699
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1700
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1701
// void CNSmlContactsDataStore::StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1702
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1703
void CNSmlContactsDataStore::StripPropertyL( HBufC8*& aItem, const TDesC8& aProperty ) const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1704
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1705
	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1706
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1707
	if( !aItem )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1708
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1709
		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): NULL pointer");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1710
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1711
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1712
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1713
	TPtr8 hItemPtr( aItem->Des() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1714
	HBufC8* propBuf = HBufC8::NewLC( aProperty.Length() + 2 );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1715
	TPtr8 propPtr( propBuf->Des() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1716
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1717
	propPtr.Append( KVersitTokenCRLF() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1718
	propPtr.Append( aProperty );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1719
	TInt propPos = hItemPtr.Find( propPtr );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1720
	if( propPos != KErrNotFound )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1721
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1722
		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property found in item data -> removing it");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1723
		_DBG_FILE( aProperty.Ptr() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1724
		TPtrC8 propPosPtr( hItemPtr.Mid( propPos + KVersitTokenCRLF().Length() ) );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1725
		TInt propEndPos = propPosPtr.Find( KVersitTokenCRLF() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1726
		hItemPtr.Delete( propPos, propEndPos + KVersitTokenCRLF().Length() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1727
		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property removed");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1728
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1729
	CleanupStack::PopAndDestroy(); // propBuf
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1730
	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1731
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1732
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1733
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1734
// void CNSmlContactsDataStore::StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1735
// ------------------------------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1736
void CNSmlContactsDataStore::StripPropertyL( CBufBase*& aItem, const TDesC8& aProperty ) const
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1737
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1738
	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1739
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1740
	if( !aItem )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1741
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1742
		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): NULL pointer");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1743
		return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1744
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1745
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1746
	HBufC8* propBuf = HBufC8::NewLC( aProperty.Length() + 2 );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1747
	TPtr8 propPtr( propBuf->Des() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1748
	propPtr.Append( KVersitTokenCRLF() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1749
	propPtr.Append( aProperty );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1750
	TInt propPos = aItem->Ptr(0).Find( propPtr );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1751
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1752
	while( propPos != KErrNotFound )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1753
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1754
		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property found in item data -> removing it");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1755
		_DBG_FILE( aProperty.Ptr() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1756
		TInt propEndPos = aItem->Ptr( propPos + KVersitTokenCRLF().Length()).Find(KVersitTokenCRLF() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1757
		if( propEndPos != KErrNotFound )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1758
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1759
			aItem->Delete( propPos + KVersitTokenCRLF().Length(), propEndPos );		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1760
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1761
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1762
		propPos = aItem->Ptr(0).Find( propPtr );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1763
		_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): property removed");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1764
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1765
	CleanupStack::PopAndDestroy(); // propBuf
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1766
	_DBG_FILE("CNSmlContactsDataStore::StripPropertyL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1767
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1768
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1769
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1770
// CNSmlContactsDataStore::IsConfidentialL
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1771
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1772
//	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1773
TBool CNSmlContactsDataStore::IsConfidentialL(  MVPbkStoreContact& aItem )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1774
    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1775
    _DBG_FILE("CNSmlContactsDataStore::IsConfidentialL(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1776
    TBool ret( EFalse );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1777
    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1778
    //find X-CLASS field type
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1779
	const MVPbkFieldType* syncclass = 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1780
        iContactManager->FieldTypes().Find(R_VPBK_FIELD_TYPE_SYNCCLASS );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1781
	CVPbkBaseContactFieldTypeIterator* itr = 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1782
        CVPbkBaseContactFieldTypeIterator::NewLC( *syncclass, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1783
            aItem.Fields() );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1784
	while ( itr->HasNext() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1785
        {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1786
        const MVPbkBaseContactField* field = itr->Next();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1787
        const MVPbkContactFieldTextData& data = MVPbkContactFieldTextData::Cast(field->FieldData());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1788
        TPtrC ptr = data.Text();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1789
        //compare the sync type
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1790
        if ( ptr.Compare( KNSmlContactSyncNoSync ) == 0 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1791
            {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1792
            _DBG_FILE("CNSmlContactsModsFetcher::IsConfidentialL(): \
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1793
                       find confidential");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1794
            ret = ETrue;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1795
            }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1796
         
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1797
        }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1798
	CleanupStack::PopAndDestroy( itr );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1799
    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1800
    _DBG_FILE("CNSmlContactsDataStore::IsConfidentialL(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1801
    return ret;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1802
    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1803
    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1804
 // ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1805
// CNSmlContactsDataStore::ResetBuffer
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1806
// ----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1807
//	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1808
void CNSmlContactsDataStore:: ResetBuffer()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1809
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1810
	if( iItemDataAddBatch )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1811
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1812
		iItemDataAddBatch->Reset();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1813
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1814
	iContactsBufferItemList.ResetAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1815
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1816
// -----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1817
// From MVPbkContactStoreListObserver  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1818
// Called when a contact store is ready to use.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1819
// -----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1820
 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1821
void CNSmlContactsDataStore::StoreReady( MVPbkContactStore& /*aContactStore*/ )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1822
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1823
	_DBG_FILE("CNSmlContactsDataStore::StoreReady(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1824
	//The contact data base opened successfully
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1825
	iOpened = ETrue;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1826
	//id to uniquely identify the opened store 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1827
	iOpenedStoreId = DefaultHash::Des16(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1828
						iStore->StoreProperties().Uri().UriDes());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1829
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1830
	TRAPD(error,iContactsModsFetcher->FetchModificationsL( *iCallerStatus ));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1831
	if(error != KErrNone)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1832
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1833
		User::RequestComplete( iCallerStatus, error );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1834
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1835
	_DBG_FILE("CNSmlContactsDataStore::StoreReady(): end");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1836
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1837
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1838
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1839
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1840
//  From MVPbkContactStoreListObserver  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1841
//	Called when a contact store becomes unavailable.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1842
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1843
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1844
void CNSmlContactsDataStore::StoreUnavailable(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1845
        MVPbkContactStore& /*aContactStore*/,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1846
        TInt aReason )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1847
    {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1848
    _DBG_FILE("CNSmlContactsDataStore::StoreUnavailable(): begin");
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1849
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1850
    //Unable open the default contact data base
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1851
	iOpened = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1852
	delete iStoreName;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1853
	iStoreName = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1854
	iOpenedStoreId = 0;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1855
	User::RequestComplete( iCallerStatus, aReason );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1856
	_DBG_FILE("CNSmlContactsDataStore::StoreUnavailable(): end");		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1857
	return;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1858
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1859
    }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1860
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1861
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1862
// From MVPbkContactStoreListObserver  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1863
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1864
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1865
void CNSmlContactsDataStore::HandleStoreEventL(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1866
        MVPbkContactStore& /*aContactStore*/,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1867
        TVPbkContactStoreEvent /*aStoreEvent*/ )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1868
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1869
	//Indication not needed.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1870
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1871
    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1872
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1873
//  CNSmlContactsDataStore::VPbkSingleContactOperationComplete
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1874
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1875
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1876
    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1877
 void CNSmlContactsDataStore::VPbkSingleContactOperationComplete(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1878
		MVPbkContactOperationBase& aOperation,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1879
		MVPbkStoreContact* aContact )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1880
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1881
	MVPbkContactOperationBase* operation = &aOperation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1882
	if ( operation )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1883
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1884
		delete operation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1885
		operation = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1886
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1887
	TRAPD(error ,SingleContactOperationCompleteL(aContact));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1888
	delete aContact;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1889
	if(error!= KErrNone)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1890
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1891
			User::RequestComplete( iCallerStatus, error );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1892
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1893
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1894
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1895
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1896
//  CNSmlContactsDataStore::VPbkSingleContactOperationFailed
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1897
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1898
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1899
void CNSmlContactsDataStore::VPbkSingleContactOperationFailed(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1900
		MVPbkContactOperationBase& aOperation,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1901
		 TInt aError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1902
	 {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1903
	MVPbkContactOperationBase* operation = &aOperation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1904
	if ( operation )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1905
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1906
		delete operation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1907
		operation = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1908
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1909
	 if(iLastOperation == ENSMLFetchOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1910
		 {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1911
	 	iWriteStream.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1912
	 	User::RequestComplete( iCallerStatus, aError );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1913
		 }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1914
		else if(iLastOperation == ENSmlRetrieveOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1915
		 {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1916
		 	User::RequestComplete( iCallerStatus, aError );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1917
		 }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1918
	 }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1919
 // ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1920
//  CNSmlContactsDataStore::VPbkSingleContactOperationFailed
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1921
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1922
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1923
 void CNSmlContactsDataStore::SingleContactOperationCompleteL(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1924
 		MVPbkStoreContact* aContact)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1925
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1926
	if(iLastOperation == ENSMLFetchOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1927
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1928
		iWriteStream.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1929
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1930
		iItemData->Compress();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1931
		//strip the fields not supported by server
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1932
		iDataMod->StripTxL( *iItemData );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1933
		*iSize = iItemData->Size();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1934
		iState = ENSmlItemOpen;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1935
		if ( iServerMaxObjectSize == 0 || *iSize <= iServerMaxObjectSize )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1936
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1937
			User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1938
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1939
		else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1940
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1941
			User::RequestComplete( iCallerStatus, KErrTooBig );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1942
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1943
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1944
	else if (iLastOperation == ENSMLUpdateExportOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1945
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1946
		iDataMod->MergeRxL( *iContactsBufferItemList[iIndex]->iItemData, *iMergeItem );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1947
		iWriteStream.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1948
		delete iMergeItem;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1949
		iMergeItem = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1950
		LdoUpdateItemL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1951
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1952
	else if (iLastOperation == ENSMLUpdateImportOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1953
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1954
		if(!IsConfidentialL(*aContact))
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1955
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1956
			TInt32 id = iIdConverter->LinkToIdentifier(*aContact->CreateLinkLC());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1957
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1958
			TNSmlSnapshotItem item(id);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1959
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1960
			MVPbkStoreContact2* tempContact = 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1961
					reinterpret_cast<MVPbkStoreContact2*> (aContact->StoreContactExtension (KMVPbkStoreContactExtension2Uid));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1962
       		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1963
			MVPbkStoreContactProperties *contactProterties 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1964
										= tempContact ->PropertiesL();;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1965
			CleanupDeletePushL(contactProterties);				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1966
			item.SetLastChangedDate(contactProterties->LastModifiedL());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1967
			CleanupStack::PopAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1968
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1969
			item.SetSoftDelete( EFalse );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1970
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1971
			TRAP_IGNORE(iChangeFinder->ItemUpdatedL( item ));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1972
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1973
			CleanupStack::PopAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1974
			if(iBatchMode)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1975
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1976
				iResultArray->Append(KErrNone);	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1977
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1978
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1979
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1980
			delete iBuf;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1981
			iBuf = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1982
			iReadStream.Close();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1983
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1984
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1985
			iIndex++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1986
			if(iIndex == iContactsBufferItemList.Count() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1987
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1988
				ResetBuffer();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1989
				User::RequestComplete( iCallerStatus, iRetCommand );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1990
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1991
			else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1992
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1993
					ExecuteBufferL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1994
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1995
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1996
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1997
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1998
	else if(iLastOperation == ENSmlRetrieveOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  1999
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2000
		iRetrieveCount--;	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2001
		if(!IsConfidentialL(*aContact))
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2002
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2003
			TInt32 id = iIdConverter->LinkToIdentifier(*aContact->CreateLinkLC());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2004
			*iContactsBufferItemList[iIndex]->iPUid = id;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2005
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2006
			TNSmlSnapshotItem item(id);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2007
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2008
       		MVPbkStoreContact2* tempContact = 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2009
       		    reinterpret_cast<MVPbkStoreContact2*> (aContact->StoreContactExtension (KMVPbkStoreContactExtension2Uid));  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2010
       		       			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2011
			MVPbkStoreContactProperties *contactProterties 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2012
										= tempContact ->PropertiesL();;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2013
			CleanupDeletePushL(contactProterties);				
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2014
			item.SetLastChangedDate(contactProterties->LastModifiedL());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2015
			CleanupStack::PopAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2016
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2017
			item.SetSoftDelete( EFalse );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2018
			// Add the snapshot item to the Change Finder.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2019
			TRAP_IGNORE(iChangeFinder->ItemAddedL( item ));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2020
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2021
			CleanupStack::PopAndDestroy();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2022
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2023
			if(iBatchMode)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2024
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2025
			iResultArray->AppendL(iRetCommand);	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2026
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2027
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2028
			iIndex++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2029
			if(iIndex == iContactsBufferItemList.Count() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2030
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2031
				ResetBuffer();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2032
				User::RequestComplete( iCallerStatus, iRetCommand );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2033
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2034
			else if(!iRetrieveCount)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2035
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2036
					ExecuteBufferL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2037
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2038
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2039
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2040
 }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2041
 // ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2042
//  CNSmlContactsDataStore::ContactsSaved.
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2043
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2044
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2045
 void CNSmlContactsDataStore::ContactsSaved( 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2046
		MVPbkContactOperationBase& aOperation,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2047
        MVPbkContactLinkArray* aResults ) 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2048
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2049
	MVPbkContactOperationBase* operation = &aOperation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2050
	if ( operation )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2051
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2052
		delete operation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2053
		operation = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2054
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2055
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2056
	if(iLastOperation == ENSmlAddOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2057
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2058
		//Count of contacts to be added from server to client 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2059
		TInt  cntAddCount( 0 );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2060
		TInt i(iIndex);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2061
		while( i<iContactsBufferItemList.Count() )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2062
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2063
			if ( iContactsBufferItemList[i]->iModType == ENSmlCntItemAdd &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2064
			     iContactsBufferItemList[i]->iStatus  == KNSmlNoError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2065
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2066
				cntAddCount++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2067
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2068
			i++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2069
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2070
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2071
		//Count of contacts successfully added to client	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2072
		iRetrieveCount = aResults->Count();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2073
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2074
		//Count of contacts which could not be added
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2075
		TInt cntAddFailedCount(0);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2076
		cntAddFailedCount = cntAddCount-iRetrieveCount;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2077
		while(cntAddFailedCount > 0)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2078
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2079
			iContactsBufferItemList[iIndex++]->iStatus  = KErrGeneral;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2080
			iResultArray->Append(KErrGeneral);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2081
			cntAddFailedCount--;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2082
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2083
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2084
		if ( aResults->Count() > 0 )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2085
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2086
			for(TInt i=0;i<aResults->Count();i++)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2087
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2088
				//retrieve the contact
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2089
				TRAPD(error,iContactManager->RetrieveContactL( aResults->At(i), *this ));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2090
				if(error != KErrNone)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2091
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2092
					User::RequestComplete( iCallerStatus, error );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2093
					}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2094
			iLastOperation = ENSmlRetrieveOp;				 	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2095
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2096
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2097
		delete iBuf;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2098
		delete aResults;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2099
		iBuf = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2100
		iReadStream.Close();	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2101
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2102
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2103
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2104
        
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2105
 // ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2106
//  CNSmlContactsDataStore::ContactsSavingFailed
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2107
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2108
//       
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2109
void CNSmlContactsDataStore::ContactsSavingFailed( 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2110
        MVPbkContactOperationBase& aOperation, TInt aError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2111
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2112
	MVPbkContactOperationBase* operation = &aOperation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2113
	if ( operation )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2114
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2115
		delete operation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2116
		operation = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2117
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2118
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2119
	if(iLastOperation == ENSmlAddOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2120
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2121
	if(iBatchMode)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2122
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2123
		while( iIndex < iContactsBufferItemList.Count() &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2124
		iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemAdd )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2125
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2126
			iContactsBufferItemList[iIndex++]->iStatus  = KErrGeneral;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2127
			iResultArray->Append(KErrGeneral);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2128
			}	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2129
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2130
	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2131
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2132
		iIndex++;			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2133
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2134
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2135
	if(iIndex == iContactsBufferItemList.Count())
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2136
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2137
		User::RequestComplete( iCallerStatus, aError );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2138
		ResetBuffer();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2139
		delete iBuf;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2140
	 	iBuf = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2141
	 	iReadStream.Close();	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2142
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2143
		//Execute the remaining commands in batch
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2144
		else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2145
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2146
			TRAPD(error,ExecuteBufferL());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2147
			if(error != KErrNone)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2148
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2149
			User::RequestComplete( iCallerStatus, error );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2150
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2151
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2152
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2153
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2154
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2155
//  CNSmlContactsDataStore::StepComplete
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2156
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2157
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2158
void CNSmlContactsDataStore::StepComplete(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2159
		 MVPbkContactOperationBase& /*aOperation*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2160
        TInt aStepSize )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2161
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2162
	if(iLastOperation == ENSmlDeleteOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2163
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2164
		if(iBatchMode)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2165
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2166
			for(TInt i = 0 ; i<aStepSize && iIndex < iContactsBufferItemList.Count() ;i++)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2167
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2168
				iResultArray->Append(KErrNone);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2169
				if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2170
			    iContactsBufferItemList[iIndex]->iStatus  == KNSmlNoError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2171
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2172
					iContactsBufferItemList[iIndex]->iStatus  = KErrNone;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2173
					iUid  = iContactsBufferItemList[iIndex]->iUid;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2174
					iChangeFinder->ItemDeleted( TNSmlSnapshotItem( iUid ));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2175
					}						
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2176
					else if( iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemSoftDelete &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2177
				   		 iContactsBufferItemList[iIndex]->iStatus  == KNSmlNoError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2178
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2179
					
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2180
					iContactsBufferItemList[iIndex]->iStatus  = KErrNone;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2181
					iUid  = iContactsBufferItemList[iIndex]->iUid;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2182
					TRAP_IGNORE(iChangeFinder->ItemSoftDeletedL( TNSmlSnapshotItem( iUid ) ));
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2183
					}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2184
					iIndex++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2185
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2186
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2187
			else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2188
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2189
			iChangeFinder->ItemDeleted( TNSmlSnapshotItem( iUid ) );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2190
			User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2191
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2192
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2193
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2194
 // ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2195
//  CNSmlContactsDataStore::StepFailed
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2196
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2197
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2198
 TBool CNSmlContactsDataStore::StepFailed(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2199
        MVPbkContactOperationBase& /*aOperation*/,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2200
        TInt /*aStepSize*/,
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2201
        TInt aError )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2202
 {
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2203
 if(iLastOperation == ENSmlDeleteOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2204
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2205
	 	if(iBatchMode)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2206
	 	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2207
			if( iIndex < iContactsBufferItemList.Count() &&
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2208
			iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2209
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2210
			iContactsBufferItemList[iIndex++]->iStatus  = KErrGeneral;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2211
			iResultArray->Append(KErrGeneral);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2212
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2213
		 	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2214
	 	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2215
	 	else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2216
	 	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2217
	 		User::RequestComplete( iCallerStatus, aError );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2218
	 	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2219
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2220
	return ETrue;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2221
 }
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2222
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2223
//  CNSmlContactsDataStore::OperationComplete
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2224
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2225
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2226
void CNSmlContactsDataStore::OperationComplete
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2227
		( MVPbkContactOperationBase& aOperation )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2228
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2229
	MVPbkContactOperationBase* operation = &aOperation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2230
	if ( operation )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2231
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2232
		delete operation;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2233
		operation = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2234
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2235
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2236
	TRAPD(error ,OperationCompleteL());	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2237
	if(error != KErrNone)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2238
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2239
		User::RequestComplete( iCallerStatus, error );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2240
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2241
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2242
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2243
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2244
//  CNSmlContactsDataStore::OperationCompleteL
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2245
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2246
//
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2247
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2248
void CNSmlContactsDataStore::OperationCompleteL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2249
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2250
	if(iLastOperation == ENSmlDeleteOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2251
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2252
		if(iBatchMode )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2253
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2254
			if(iResultArray->Count() != iContactsBufferItemList.Count())
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2255
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2256
				while( iIndex < iContactsBufferItemList.Count() && 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2257
				iContactsBufferItemList[iIndex]->iModType == ENSmlCntItemDelete 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2258
				&& iContactsBufferItemList[iIndex]->iStatus  == KErrNotFound )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2259
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2260
					iResultArray->Append(KErrNotFound);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2261
					iIndex++;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2262
					}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2263
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2264
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2265
			if(iIndex == iContactsBufferItemList.Count())
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2266
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2267
				if(iItemData)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2268
					{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2269
					iItemData->Reset();    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2270
					}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2271
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2272
				ResetBuffer();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2273
				User::RequestComplete( iCallerStatus, KErrNone );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2274
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2275
				else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2276
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2277
				ExecuteBufferL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2278
				}	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2279
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2280
			else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2281
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2282
			
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2283
			if(iItemData)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2284
				{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2285
				iItemData->Reset();    
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2286
				}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2287
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2288
			ResetBuffer();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2289
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2290
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2291
		else
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2292
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2293
		if( iChangeFinder )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2294
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2295
			iChangeFinder->ResetL();		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2296
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2297
		iSnapshotRegistered = EFalse;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2298
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2299
		delete iContactLnks;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2300
		iContactLnks = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2301
		iContactLink = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2302
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2303
		delete iContactViewBase;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2304
		iContactViewBase = NULL;
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2305
		User::RequestComplete( iCallerStatus, KErrNone );	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2306
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2307
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2308
		
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2309
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2310
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2311
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2312
// CNSmlContactsDataStore::ContactViewReady
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2313
// Implements the view ready function of MVPbkContactViewObserver
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2314
// --------------------------------------------------------------------------- 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2315
void CNSmlContactsDataStore::ContactViewReady(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2316
                MVPbkContactViewBase& /*aView*/ ) 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2317
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2318
	if(iLastOperation == ENSMLDeleteAllOp)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2319
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2320
		TRAPD(error,DoDeleteAllContactsL());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2321
		if(error != KErrNone)
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2322
			{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2323
			User::RequestComplete( iCallerStatus, error );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2324
			}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2325
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2326
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2327
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2328
// CNSmlContactsDataStore::PrepareForContactsDeleteL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2329
// Delete all the contacts at client
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2330
// ---------------------------------------------------------------------------	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2331
void CNSmlContactsDataStore::DoDeleteAllContactsL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2332
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2333
	iContactLnks = CVPbkContactLinkArray::NewL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2334
	TInt contactCount = iContactViewBase->ContactCountL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2335
	//add all the contact links to  ContactLinkArray
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2336
	for( TInt i = 0; i < contactCount; i++ )
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2337
		{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2338
			const MVPbkViewContact& contact = 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2339
						iContactViewBase->ContactAtL(i);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2340
			iContactLink = contact.CreateLinkLC();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2341
			iContactLnks->AppendL(iContactLink);
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2342
			CleanupStack::Pop();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2343
		}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2344
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2345
	iContactManager->DeleteContactsL( *iContactLnks, *this );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2346
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2347
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2348
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2349
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2350
// CNSmlContactsDataStore::ContactViewUnavailable
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2351
// Implements the view unavailable function of MVPbkContactViewObserver
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2352
// --------------------------------------------------------------------------- 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2353
void CNSmlContactsDataStore::ContactViewUnavailable(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2354
                MVPbkContactViewBase& /*aView*/ )  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2355
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2356
	   
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2357
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2358
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2359
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2360
// CNSmlContactsDataStore::ContactAddedToView
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2361
// Implements the add contact function of MVPbkContactViewObserver
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2362
// --------------------------------------------------------------------------- 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2363
void CNSmlContactsDataStore::ContactAddedToView(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2364
            MVPbkContactViewBase& /*aView*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2365
            TInt /*aIndex*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2366
            const MVPbkContactLink& /*aContactLink*/ ) 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2367
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2368
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2369
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2370
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2371
// CNSmlContactsDataStore::ContactRemovedFromView
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2372
// Implements the remove contact function of MVPbkContactViewObserver
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2373
// --------------------------------------------------------------------------- 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2374
void CNSmlContactsDataStore::ContactRemovedFromView(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2375
                MVPbkContactViewBase& /*aView*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2376
                TInt /*aIndex*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2377
                const MVPbkContactLink& /*aContactLink*/ )  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2378
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2379
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2380
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2381
// ---------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2382
// CNSmlContactsDataStore::ContactViewError
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2383
// Implements the view error function of MVPbkContactViewObserver
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2384
// --------------------------------------------------------------------------- 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2385
void CNSmlContactsDataStore::ContactViewError(
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2386
            MVPbkContactViewBase& /*aView*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2387
            TInt /*aError*/, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2388
            TBool /*aErrorNotified*/ )  
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2389
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2390
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2391
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2392
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2393
// -----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2394
// CNSmlContactsDataStore::CreateViewL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2395
// Create a contact view 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2396
// -----------------------------------------------------------------------------
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2397
 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2398
void CNSmlContactsDataStore::CreateViewL()
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2399
	{
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2400
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2401
	CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2402
	CleanupStack::PushL( viewDef );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2403
	viewDef->SetType( EVPbkContactsView );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2404
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2405
	viewDef->SetUriL(iStore->StoreProperties().Uri().UriDes());
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2406
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2407
	 iContactViewBase = iContactManager->CreateContactViewLC( 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2408
				                         *this, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2409
				                         *viewDef, 
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2410
				                         iContactManager->FieldTypes()  );
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2411
	CleanupStack::Pop();
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2412
	CleanupStack::PopAndDestroy(viewDef);	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2413
	
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2414
	}
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2415
dab8a81a92de Revision: 200948
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
  2416
// End of File