|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 |
|
25 |
|
26 #include "clplgenericproxy.h" |
|
27 |
|
28 |
|
29 CLplGenericProxy::CLplGenericProxy(MLplPersistenceBroker& aBroker, MLplTransactionManager& aTranMan) |
|
30 : |
|
31 iBroker(aBroker), |
|
32 iTranMan(aTranMan) |
|
33 { |
|
34 } |
|
35 |
|
36 |
|
37 /** |
|
38 Store a new Contact. |
|
39 */ |
|
40 TContactItemId CLplGenericProxy::CreateL(CContactItem& aItem, TUint aSessionId) |
|
41 { |
|
42 #if defined(__PROFILE_DEBUG__) |
|
43 RDebug::Print(_L("[CNTMODEL] MTD: CLplGenericProxy::CreateL")); |
|
44 #endif |
|
45 |
|
46 return iBroker.CreateL(aItem, aSessionId); |
|
47 } |
|
48 |
|
49 |
|
50 /** |
|
51 Read an existing Contact (or parts of it as specified by the view definition). |
|
52 */ |
|
53 CContactItem* CLplGenericProxy::ReadLC(TContactItemId aItemId, const CContactItemViewDef& aView, TInt aInfoToRead, TUint aSessionId, TBool aIccOpenCheck) const |
|
54 { |
|
55 return iBroker.ReadLC(aItemId, aView, aInfoToRead, aSessionId, aIccOpenCheck); |
|
56 } |
|
57 |
|
58 |
|
59 /** |
|
60 Update an existing Contact (or parts of it as specified by the view definition). |
|
61 */ |
|
62 void CLplGenericProxy::UpdateL(CContactItem& aItem, TUint aSessionId) |
|
63 { |
|
64 iBroker.UpdateL(aItem, aSessionId); |
|
65 } |
|
66 |
|
67 |
|
68 /** |
|
69 Delete a Contact. |
|
70 */ |
|
71 CContactItem* CLplGenericProxy::DeleteLC(TContactItemId aItemId, TUint aSessionId, TCntSendEventAction aEventType) |
|
72 { |
|
73 return iBroker.DeleteLC(aItemId, aSessionId, aEventType); |
|
74 } |
|
75 |
|
76 |
|
77 /** |
|
78 Change the type of an existing Contact. |
|
79 */ |
|
80 void CLplGenericProxy::ChangeTypeL(TContactItemId aItemId, TUid aNewType) |
|
81 { |
|
82 iBroker.ChangeTypeL(aItemId, aNewType); |
|
83 } |
|
84 |
|
85 |
|
86 /** |
|
87 Start a new transaction. |
|
88 */ |
|
89 void CLplGenericProxy::StartTransactionL() |
|
90 { |
|
91 iTranMan.StartTransactionL(); |
|
92 } |
|
93 |
|
94 |
|
95 /** |
|
96 Commit the current transaction. |
|
97 */ |
|
98 void CLplGenericProxy::CommitCurrentTransactionL(TUint aSessionId) |
|
99 { |
|
100 iTranMan.CommitCurrentTransactionL(aSessionId); |
|
101 } |
|
102 |
|
103 |
|
104 /** |
|
105 Rollback the current transaction. |
|
106 */ |
|
107 void CLplGenericProxy::RollbackCurrentTransactionL(TUint aSessionId) |
|
108 { |
|
109 iTranMan.RollbackCurrentTransactionL(aSessionId); |
|
110 } |
|
111 |
|
112 |
|
113 /** |
|
114 Determine if a transaction is currently in progress. |
|
115 */ |
|
116 TBool CLplGenericProxy::IsTransactionActive() const |
|
117 { |
|
118 return iTranMan.IsTransactionActive(); |
|
119 } |
|
120 |
|
121 |
|
122 /** Does nothing since the analyser proxy sets the connection ID. |
|
123 */ |
|
124 void CLplGenericProxy::SetConnectionId(TInt /*aConnectionId*/) |
|
125 { |
|
126 } |