|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: DS Dummy datastore |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CNSMLDUMMYDATASTORE_H |
|
19 #define CNSMLDUMMYDATASTORE_H |
|
20 |
|
21 // EXTERNAL INCLUDES |
|
22 #include <NSmlContactsDataStore.h> |
|
23 |
|
24 // Device Info resource filenames |
|
25 _LIT( KNSmlDummyContactsStoreFormatRsc_1_1_2, "z:NSmlDummyDataStoreFormat_1_1_2.rsc" ); |
|
26 _LIT( KNSmlDummyContactsStoreFormatRsc_1_2, "z:NSmlDummyDataStoreFormat_1_2.rsc" ); |
|
27 |
|
28 // CLASS DEFINITION |
|
29 /** |
|
30 * Datastore class for Dummy adapters |
|
31 * @lib nsmldummydataprovider.lib |
|
32 * @since 3.23 |
|
33 */ |
|
34 class CNSmlDummyDataStore : public CNSmlContactsDataStore |
|
35 { |
|
36 private: // Friend class definitions |
|
37 friend class CNSmlDummyDataStore_Test; |
|
38 friend class CNSmlDummyDataStoreWaiter; |
|
39 |
|
40 public: // Constructors and destructor |
|
41 |
|
42 static CNSmlDummyDataStore* NewL(); |
|
43 static CNSmlDummyDataStore* NewLC(); |
|
44 ~CNSmlDummyDataStore(); |
|
45 |
|
46 protected: // Constructors |
|
47 |
|
48 CNSmlDummyDataStore(); |
|
49 void ConstructL(); |
|
50 |
|
51 protected: // From CNSmlContactsDataStore |
|
52 |
|
53 void DoOpenL( const TDesC& aStoreName, MSmlSyncRelationship& aContext, |
|
54 TRequestStatus& aStatus ); |
|
55 |
|
56 void DoBeginBatchL(); |
|
57 |
|
58 void DoOpenItemL( TSmlDbItemUid aUid, TBool& aFieldChange, |
|
59 TInt& aSize, TSmlDbItemUid& aParent, TDes8& aMimeType, |
|
60 TDes8& aMimeVer, TRequestStatus& aStatus ); |
|
61 |
|
62 void DoCommitItemL( TRequestStatus& aStatus ); |
|
63 |
|
64 void DoDeleteItemL( TSmlDbItemUid aUid, TRequestStatus& aStatus ); |
|
65 |
|
66 TBool DoHasSyncHistory() const; |
|
67 |
|
68 const MSmlDataItemUidSet& DoModifiedItems() const; |
|
69 |
|
70 void DoResetChangeInfoL( TRequestStatus& aStatus ); |
|
71 |
|
72 void DoCommitChangeInfoL( TRequestStatus& aStatus, |
|
73 const MSmlDataItemUidSet& aItems ); |
|
74 |
|
75 void DoCommitChangeInfoL( TRequestStatus& aStatus ); |
|
76 |
|
77 void LdoFetchItemL( TSmlDbItemUid& aUid, CBufBase& aItem ); |
|
78 |
|
79 void LdoAddItemL( const TDesC8& aItem, TInt aSize ); |
|
80 |
|
81 void LdoAddItemsL( CBufBase*& aItems,TInt aSize ); |
|
82 |
|
83 TInt ExecuteAddL(); |
|
84 |
|
85 void ExecuteDeleteL(); |
|
86 |
|
87 void ExecuteUpdateL(); |
|
88 |
|
89 void SingleContactOperationCompleteL( MVPbkStoreContact* aContact ); |
|
90 |
|
91 void StepComplete( MVPbkContactOperationBase& aOperation, |
|
92 TInt aStepSize ); |
|
93 |
|
94 void OperationCompleteL(); |
|
95 |
|
96 void DoDeleteAllContactsL(); |
|
97 |
|
98 const TDesC& GetStoreFormatResourceFileL() const; |
|
99 |
|
100 MContactsModsFetcher* CreateModsFetcherL(); |
|
101 |
|
102 protected: // From MVPbkContactCopyObserver |
|
103 |
|
104 void ContactsSaved( MVPbkContactOperationBase& aOperation, |
|
105 MVPbkContactLinkArray* aResults ); |
|
106 |
|
107 void ContactsSavingFailed( MVPbkContactOperationBase& aOperation, |
|
108 TInt aError ); |
|
109 |
|
110 }; |
|
111 |
|
112 #endif // CNSMLDUMMYDATASTORE_H |
|
113 |
|
114 // End of file |