phonebookengines/contactsmodel/cntplsql/src/cviewcontactmanager.cpp
branchRCL_3
changeset 23 5586b4d2ec3e
parent 0 e686773b3f54
child 45 34879f5cfc63
equal deleted inserted replaced
21:b3431bff8c19 23:5586b4d2ec3e
   381 @param  aContactTypeUid contact type uid to check.
   381 @param  aContactTypeUid contact type uid to check.
   382 @param  aTypeToInclude  view preferences have flags to define which contact the view should have.
   382 @param  aTypeToInclude  view preferences have flags to define which contact the view should have.
   383 @return ETrue if the uid match or reverse.
   383 @return ETrue if the uid match or reverse.
   384 */
   384 */
   385 TBool CViewContactManager::ContactCorrectType(TUid aContactTypeUid, TContactViewPreferences aTypeToInclude)
   385 TBool CViewContactManager::ContactCorrectType(TUid aContactTypeUid, TContactViewPreferences aTypeToInclude)
   386 	{
   386     {
   387 	TBool correctType(EFalse);
   387     TBool correctType = EFalse;
   388 	if (aContactTypeUid==KUidContactCard || aContactTypeUid==KUidContactOwnCard)
   388 
   389 		{
   389     if (aContactTypeUid == KUidContactCard)
   390 		// Ignore Unsorted Contacts flags & White Space flag
   390         {
   391 		// catch non- contact views
   391         if (!(aTypeToInclude & (EGroupsOnly | EICCEntriesOnly)))
   392 		// Should be EContactsOnly, EContactAndGroups & EICCEntriesAndContacts
   392             {
   393 		if (0 == ((aTypeToInclude & ~(ESingleWhiteSpaceIsEmptyField | EIgnoreUnSorted | EUnSortedAtBeginning | EUnSortedAtEnd))
   393             correctType = ETrue;
   394 				& (EGroupsOnly | EICCEntriesOnly))) // Ignore 'UnSorted' flags, exclude Groups Only & ICC Only 
   394             }
   395 			{
   395         }
   396 			correctType = ETrue;
   396     else if (aContactTypeUid == KUidContactOwnCard)
   397 			}
   397         {
   398 		}
   398         if (!(aTypeToInclude & (EGroupsOnly | EICCEntriesOnly | EContactCardsOnly)))
   399 	else if (aContactTypeUid == KUidContactGroup)
   399             {
   400 		{
   400             correctType = ETrue;
   401 		if (aTypeToInclude & (EGroupsOnly | EContactAndGroups))
   401             }
   402 			{
   402         }
   403 			correctType = ETrue;
   403     else if (aContactTypeUid == KUidContactGroup)
   404 			}
   404         {
   405 		}
   405         if (aTypeToInclude & (EGroupsOnly | EContactAndGroups))
   406 	else if (aContactTypeUid == KUidContactICCEntry)
   406             {
   407 		{
   407             correctType = ETrue;
   408 		if (aTypeToInclude & (EICCEntriesOnly | EICCEntriesAndContacts))
   408             }
   409 			{
   409         }
   410 			correctType = ETrue;
   410     else if (aContactTypeUid == KUidContactICCEntry)
   411 			}
   411         {
   412 		}
   412         if (aTypeToInclude & (EICCEntriesOnly | EICCEntriesAndContacts))
   413 	return correctType;
   413             {
   414 	}
   414             correctType = ETrue;
       
   415             }
       
   416         }
       
   417 
       
   418     return correctType;
       
   419     }
   415 
   420 
   416 
   421 
   417 /** 
   422 /** 
   418 Heap sort the give view contacts array.
   423 Heap sort the give view contacts array.
   419 
   424