94 // |
94 // |
95 void CCPClient::GetListL( const CLiwGenericParamList& aInParamList, |
95 void CCPClient::GetListL( const CLiwGenericParamList& aInParamList, |
96 CLiwGenericParamList& aOutParamList ) |
96 CLiwGenericParamList& aOutParamList ) |
97 { |
97 { |
98 CP_DEBUG( _L8("CCPClient::GetListL()") ); |
98 CP_DEBUG( _L8("CCPClient::GetListL()") ); |
|
99 CP_EXTENDED_DEBUG( "GetListL()" , aInParamList ); |
99 CheckMapL( aInParamList, KFilter ); |
100 CheckMapL( aInParamList, KFilter ); |
100 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
101 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
101 inMapForServer->PushL( ); |
102 inMapForServer->PushL( ); |
102 inMapForServer->IsValidForGetListL( ); |
103 inMapForServer->IsValidForGetListL( ); |
103 iServerClient.GetListL( *inMapForServer, aOutParamList ); |
104 iServerClient.GetListL( *inMapForServer, aOutParamList ); |
111 void CCPClient::AddL( const CLiwGenericParamList& aInParamList, |
112 void CCPClient::AddL( const CLiwGenericParamList& aInParamList, |
112 CLiwGenericParamList& aOutParamList, |
113 CLiwGenericParamList& aOutParamList, |
113 TUint aCmdOptions ) |
114 TUint aCmdOptions ) |
114 { |
115 { |
115 CP_DEBUG( _L8("CCPClient::AddL()") ); |
116 CP_DEBUG( _L8("CCPClient::AddL()") ); |
|
117 CP_EXTENDED_DEBUG( "Add()" , aInParamList ); |
116 CheckMapL( aInParamList, KItem ); |
118 CheckMapL( aInParamList, KItem ); |
117 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ) ; |
119 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ) ; |
118 inMapForServer->PushL( ); |
120 inMapForServer->PushL( ); |
119 inMapForServer->IsValidForAddL( ); |
121 inMapForServer->IsValidForAddL( ); |
120 iServerClient.AddL( *inMapForServer, aOutParamList, aCmdOptions ); |
122 iServerClient.AddL( *inMapForServer, aOutParamList, aCmdOptions ); |
126 // ----------------------------------------------------------------------------- |
128 // ----------------------------------------------------------------------------- |
127 // |
129 // |
128 void CCPClient::DeleteL( const CLiwGenericParamList& aInParamList ) |
130 void CCPClient::DeleteL( const CLiwGenericParamList& aInParamList ) |
129 { |
131 { |
130 CP_DEBUG( _L8("CCPClient::DeleteL()") ); |
132 CP_DEBUG( _L8("CCPClient::DeleteL()") ); |
|
133 CP_EXTENDED_DEBUG( "Delete()" , aInParamList ); |
131 CheckMapL( aInParamList, KData ); |
134 CheckMapL( aInParamList, KData ); |
132 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
135 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
133 inMapForServer->PushL( ); |
136 inMapForServer->PushL( ); |
134 inMapForServer->IsValidForDeleteL( ); |
137 inMapForServer->IsValidForDeleteL( ); |
135 iServerClient.DeleteL( *inMapForServer ); |
138 iServerClient.DeleteL( *inMapForServer ); |
142 // |
145 // |
143 void CCPClient::RegisterObserverL( MLiwNotifyCallback* aObserver, |
146 void CCPClient::RegisterObserverL( MLiwNotifyCallback* aObserver, |
144 const CLiwGenericParamList& aInParamList, TInt32 aTransactionId ) |
147 const CLiwGenericParamList& aInParamList, TInt32 aTransactionId ) |
145 { |
148 { |
146 CP_DEBUG( _L8("CCPClient::RegisterObserverL()") ); |
149 CP_DEBUG( _L8("CCPClient::RegisterObserverL()") ); |
|
150 CP_EXTENDED_DEBUG( "RegisterObserver()" , aInParamList ); |
147 CheckMapL( aInParamList, KFilter ); |
151 CheckMapL( aInParamList, KFilter ); |
148 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
152 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
149 inMapForServer->PushL( ); |
153 inMapForServer->PushL( ); |
150 inMapForServer->IsValidForNotificationL( ); |
154 inMapForServer->IsValidForNotificationL( ); |
151 if ( !iActiveNotifier ) |
155 if ( !iActiveNotifier ) |
161 // ----------------------------------------------------------------------------- |
165 // ----------------------------------------------------------------------------- |
162 // |
166 // |
163 void CCPClient::UnregisterObserversL( const CLiwGenericParamList& aInParamList ) |
167 void CCPClient::UnregisterObserversL( const CLiwGenericParamList& aInParamList ) |
164 { |
168 { |
165 CP_DEBUG( _L8("CCPClient::UnregisterObservers()") ); |
169 CP_DEBUG( _L8("CCPClient::UnregisterObservers()") ); |
|
170 CP_EXTENDED_DEBUG( "UnregisterObservers()" , aInParamList ); |
166 if ( !iActiveNotifier ) |
171 if ( !iActiveNotifier ) |
167 { |
172 { |
168 User::Leave( KErrNotFound ); |
173 User::Leave( KErrNotFound ); |
169 } |
174 } |
170 TInt32 transactionId( -1 ); |
175 TInt32 transactionId( -1 ); |
196 // ----------------------------------------------------------------------------- |
201 // ----------------------------------------------------------------------------- |
197 // |
202 // |
198 void CCPClient::ExecuteActionL( const CLiwGenericParamList& aInParamList, |
203 void CCPClient::ExecuteActionL( const CLiwGenericParamList& aInParamList, |
199 TUint aCmdOptions) |
204 TUint aCmdOptions) |
200 { |
205 { |
201 CP_DEBUG( _L8("CCPClient::RegisterObserverL()") ); |
206 CP_DEBUG( _L8("CCPClient::ExecuteActionL()") ); |
|
207 CP_EXTENDED_DEBUG( "ExecuteAction()" , aInParamList ); |
202 CheckMapL( aInParamList, KFilter ); |
208 CheckMapL( aInParamList, KFilter ); |
203 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
209 CCPLiwMap* inMapForServer = CCPLiwMap::NewL( aInParamList ); |
204 inMapForServer->PushL( ); |
210 inMapForServer->PushL( ); |
205 inMapForServer->IsValidForActionL( ); |
211 inMapForServer->IsValidForActionL( ); |
206 iServerClient.ExecuteActionL( *inMapForServer, aCmdOptions ); |
212 iServerClient.ExecuteActionL( *inMapForServer, aCmdOptions ); |
207 CleanupStack::PopAndDestroy( inMapForServer ); |
213 CleanupStack::PopAndDestroy( inMapForServer ); |
|
214 } |
|
215 |
|
216 // ----------------------------------------------------------------------------- |
|
217 // |
|
218 // ----------------------------------------------------------------------------- |
|
219 // |
|
220 void CCPClient::ExecuteMultipleActionsL( |
|
221 const CLiwGenericParamList& aInParamList, TUint aCmdOptions) |
|
222 { |
|
223 CP_DEBUG( _L8("CCPClient::ExecuteMultipleActionsL()") ); |
|
224 CP_EXTENDED_DEBUG( "ExecuteMultipleActionsL()" , aInParamList ); |
|
225 CheckMultiExecuteInputParamsL(aInParamList); |
|
226 iServerClient.ExecuteMultipleActionsL( aInParamList, aCmdOptions ); |
208 } |
227 } |
209 |
228 |
210 // ----------------------------------------------------------------------------- |
229 // ----------------------------------------------------------------------------- |
211 // |
230 // |
212 // ----------------------------------------------------------------------------- |
231 // ----------------------------------------------------------------------------- |
223 { |
242 { |
224 User::Leave( KErrBadName ); |
243 User::Leave( KErrBadName ); |
225 } |
244 } |
226 } |
245 } |
227 } |
246 } |
|
247 |
|
248 // ----------------------------------------------------------------------------- |
|
249 // |
|
250 // --------------- -------------------------------------------------------------- |
|
251 // |
|
252 void CCPClient::CheckMultiExecuteInputParamsL( |
|
253 const CLiwGenericParamList& aList) |
|
254 { |
|
255 const TLiwGenericParam* param = NULL; |
|
256 TInt pos(0); |
|
257 param = aList.FindFirst(pos, KFilters); |
|
258 User::LeaveIfError(pos); //leaves if not found |
|
259 if (param->Value().TypeId() != LIW::EVariantTypeList) |
|
260 { |
|
261 User::Leave(KErrBadName); |
|
262 } |
|
263 } |