24 #include "cpdebug.h" |
24 #include "cpdebug.h" |
25 #include "cpliwmap.h" |
25 #include "cpliwmap.h" |
26 #include "cpglobals.h" |
26 #include "cpglobals.h" |
27 #include "cpserverdef.h" |
27 #include "cpserverdef.h" |
28 |
28 |
|
29 using namespace LIW; |
29 // ======== MEMBER FUNCTIONS ======== |
30 // ======== MEMBER FUNCTIONS ======== |
30 |
31 |
31 // --------------------------------------------------------------------------- |
32 // --------------------------------------------------------------------------- |
32 // |
33 // |
33 // --------------------------------------------------------------------------- |
34 // --------------------------------------------------------------------------- |
180 |
181 |
181 // ----------------------------------------------------------------------------- |
182 // ----------------------------------------------------------------------------- |
182 // |
183 // |
183 // ----------------------------------------------------------------------------- |
184 // ----------------------------------------------------------------------------- |
184 // |
185 // |
185 TBool CCPNotificationHandler::IsProperForFilterL( const CLiwDefaultMap& aMap, |
186 TBool CCPNotificationHandler::IsProperForFilterL( const CLiwMap& aMap, |
186 const CCPLiwMap& aFilter ) |
187 const CCPLiwMap& aFilter ) |
187 { |
188 { |
188 CP_DEBUG( _L8("CCPNotificationHandler::IsProperForFilter()") ); |
189 CP_DEBUG( _L8("CCPNotificationHandler::IsProperForFilter()") ); |
189 TBool result( EFalse ); |
190 TBool result( EFalse ); |
190 if( CheckRegistryTypeL( aMap, aFilter ) && |
191 if( CheckRegistryTypeL( aMap, aFilter ) && |
296 const CCPLiwMap*const* filter = iter.NextValue( ); |
297 const CCPLiwMap*const* filter = iter.NextValue( ); |
297 while( filter ) |
298 while( filter ) |
298 { |
299 { |
299 |
300 |
300 CLiwDefaultList* listOfMatchingMaps = CLiwDefaultList::NewLC( ); |
301 CLiwDefaultList* listOfMatchingMaps = CLiwDefaultList::NewLC( ); |
301 |
302 TInt count = aListOfMaps->Count( ); |
302 //for every item in the input list |
303 //for every item in the input list |
303 for ( TInt j = 0; j < aListOfMaps->Count( ); j++ ) |
304 for ( TInt j = 0; j < count; j++ ) |
304 { |
305 { |
305 CLiwDefaultMap* map = CLiwDefaultMap::NewLC( ); |
|
306 TLiwVariant variant; |
306 TLiwVariant variant; |
307 variant.PushL( ); |
307 variant.PushL( ); |
308 aListOfMaps->AtL( j, variant ); |
308 aListOfMaps->AtL( j, variant ); |
309 variant.Get( *map ); |
309 if ( variant.TypeId() == EVariantTypeMap ) |
310 if ( IsProperForFilterL( *map, **filter ) ) |
310 { |
311 { |
311 if ( IsProperForFilterL( *variant.AsMap(), **filter ) ) |
312 listOfMatchingMaps->AppendL( TLiwVariant( map ) ); |
312 { |
313 } |
313 listOfMatchingMaps->AppendL( variant ); |
314 CleanupStack::PopAndDestroy( &variant ); |
314 } |
315 CleanupStack::PopAndDestroy( map ); |
315 else |
|
316 { |
|
317 variant.Reset(); |
|
318 } |
|
319 } |
|
320 CleanupStack::Pop( &variant ); |
316 } |
321 } |
317 if ( listOfMatchingMaps->Count( ) ) |
322 if ( listOfMatchingMaps->Count( ) ) |
318 { |
323 { |
319 //append transaction id |
324 //append transaction id |
320 listOfMatchingMaps->AppendL( TLiwVariant( *iter.CurrentKey() )); |
325 listOfMatchingMaps->AppendL( TLiwVariant( *iter.CurrentKey() )); |
337 |
342 |
338 // ---------------------------------------------------------------------------- |
343 // ---------------------------------------------------------------------------- |
339 // |
344 // |
340 // ---------------------------------------------------------------------------- |
345 // ---------------------------------------------------------------------------- |
341 // |
346 // |
342 void CCPNotificationHandler::GetPropertyL( const CLiwDefaultMap& aMap, |
347 void CCPNotificationHandler::GetPropertyL( const CLiwMap& aMap, |
343 const TDesC8& aProperty, RBuf& aResult ) |
348 const TDesC8& aProperty, RBuf& aResult ) |
344 { |
349 { |
345 TLiwVariant value; |
350 TLiwVariant value; |
346 value.PushL( ); |
351 value.PushL( ); |
347 if ( aMap.FindL( aProperty, value ) ) |
352 if ( aMap.FindL( aProperty, value ) ) |
355 |
360 |
356 // ---------------------------------------------------------------------------- |
361 // ---------------------------------------------------------------------------- |
357 // |
362 // |
358 // ---------------------------------------------------------------------------- |
363 // ---------------------------------------------------------------------------- |
359 // |
364 // |
360 TBool CCPNotificationHandler::CheckIdL( const CLiwDefaultMap& aMap, |
365 TBool CCPNotificationHandler::CheckIdL( const CLiwMap& aMap, |
361 const CCPLiwMap& aFilter ) |
366 const CCPLiwMap& aFilter ) |
362 { |
367 { |
363 TBool result = EFalse; |
368 TBool result = EFalse; |
364 TInt32 id( 0); |
369 TInt32 id( 0); |
365 if ( aFilter.GetProperty( KId, id ) ) |
370 if ( aFilter.GetProperty( KId, id ) ) |
384 |
389 |
385 // ---------------------------------------------------------------------------- |
390 // ---------------------------------------------------------------------------- |
386 // |
391 // |
387 // ---------------------------------------------------------------------------- |
392 // ---------------------------------------------------------------------------- |
388 // |
393 // |
389 TBool CCPNotificationHandler::CheckPropertiesL( const CLiwDefaultMap& aMap, |
394 TBool CCPNotificationHandler::CheckPropertiesL( const CLiwMap& aMap, |
390 const CCPLiwMap& aFilter ) |
395 const CCPLiwMap& aFilter ) |
391 { |
396 { |
392 TBool result( EFalse ); |
397 TBool result( EFalse ); |
393 TBool publisherName( ETrue ); |
398 TBool publisherName( ETrue ); |
394 TBool contentType( ETrue ); |
399 TBool contentType( ETrue ); |
457 |
462 |
458 // ---------------------------------------------------------------------------- |
463 // ---------------------------------------------------------------------------- |
459 // |
464 // |
460 // ---------------------------------------------------------------------------- |
465 // ---------------------------------------------------------------------------- |
461 // |
466 // |
462 TBool CCPNotificationHandler::CheckOperationTypeL( const CLiwDefaultMap& aMap, |
467 TBool CCPNotificationHandler::CheckOperationTypeL( const CLiwMap& aMap, |
463 const CCPLiwMap& aFilter ) |
468 const CCPLiwMap& aFilter ) |
464 { |
469 { |
465 TBool result = ETrue; |
470 TBool result = ETrue; |
466 RBuf operation; |
471 RBuf operation; |
467 operation.CleanupClosePushL(); |
472 operation.CleanupClosePushL(); |
489 |
494 |
490 // ---------------------------------------------------------------------------- |
495 // ---------------------------------------------------------------------------- |
491 // |
496 // |
492 // ---------------------------------------------------------------------------- |
497 // ---------------------------------------------------------------------------- |
493 // |
498 // |
494 TBool CCPNotificationHandler::CheckRegistryTypeL( const CLiwDefaultMap& aMap, |
499 TBool CCPNotificationHandler::CheckRegistryTypeL( const CLiwMap& aMap, |
495 const CCPLiwMap& aFilter ) |
500 const CCPLiwMap& aFilter ) |
496 { |
501 { |
497 TBool result = ETrue; |
502 TBool result = ETrue; |
498 RBuf type; |
503 RBuf type; |
499 type.CleanupClosePushL(); |
504 type.CleanupClosePushL(); |