metadataengine/client/src/mdeasynchronousfindao.cpp
changeset 1 acef663c1218
parent 0 c53acadfccc6
child 3 6752808b2036
equal deleted inserted replaced
0:c53acadfccc6 1:acef663c1218
   244 			}
   244 			}
   245 		}
   245 		}
   246 
   246 
   247     const TQueryType mode = iQuery.Type();
   247     const TQueryType mode = iQuery.Type();
   248 
   248 
   249     if ( mode == EQueryTypeObject ) 
   249     switch( mode )
   250         {
   250         {
   251         CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   251         case EQueryTypeObject: 
   252         qi.DoNotifyCompleted( aError );
   252             {
   253         }
   253             CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   254     else if ( mode == EQueryTypeRelation )
   254             qi.DoNotifyCompleted( aError );
   255         {
   255             break;
   256         CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   256             }
   257         qi.DoNotifyCompleted( aError );
   257         case EQueryTypeRelation:
   258         }
   258             {
   259     else if ( mode == EQueryTypeEvent )
   259             CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   260         {
   260             qi.DoNotifyCompleted( aError );
   261         CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
   261             break;
   262         qi.DoNotifyCompleted( aError );
   262             }
       
   263         case EQueryTypeEvent:
       
   264             {
       
   265             CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
       
   266             qi.DoNotifyCompleted( aError );
       
   267             break;
       
   268             }
       
   269         default:
       
   270             {
       
   271             return KErrNone;
       
   272             }
   263         }
   273         }
   264 
   274 
   265 	return KErrNone;
   275 	return KErrNone;
   266 	}
   276 	}
   267 
   277 
   272            aStatus == EAsyncFindComplete ) &&
   282            aStatus == EAsyncFindComplete ) &&
   273            iResultList.Count() > 0)
   283            iResultList.Count() > 0)
   274         {
   284         {
   275         const TQueryType mode = iQuery.Type();
   285         const TQueryType mode = iQuery.Type();
   276 
   286 
   277         if ( mode == EQueryTypeObject )
   287         switch( mode )
   278             {
   288             {
   279             CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   289             case EQueryTypeObject:
   280             qi.DoNotifyResultsL( iResultList );
   290                 {
   281             }
   291                 CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   282         else if ( mode == EQueryTypeRelation )
   292                 qi.DoNotifyResultsL( iResultList );
   283             {
   293                 break;
   284             CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   294                 }
   285             qi.DoNotifyResultsL( iResultList );
   295             case EQueryTypeRelation:
   286             }
   296                 {
   287         else if ( mode == EQueryTypeEvent )
   297                 CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   288             {
   298                 qi.DoNotifyResultsL( iResultList );
   289             CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
   299                 break;
   290             qi.DoNotifyResultsL( iResultList );
   300                 }
       
   301             case EQueryTypeEvent:
       
   302                 {
       
   303                 CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
       
   304                 qi.DoNotifyResultsL( iResultList );
       
   305                 break;
       
   306                 }
       
   307             default:
       
   308                 {
       
   309                 // Nothing to do
       
   310                 }
   291             }
   311             }
   292 
   312 
   293         // get rid of local results list
   313         // get rid of local results list
   294         iResultList.Reset();
   314         iResultList.Reset();
   295         }
   315         }
   298            aStatus == EAsyncFindComplete ) &&
   318            aStatus == EAsyncFindComplete ) &&
   299            iIdResultList.Count() > 0)
   319            iIdResultList.Count() > 0)
   300         {
   320         {
   301         const TQueryType mode = iQuery.Type();
   321         const TQueryType mode = iQuery.Type();
   302         
   322         
   303         if ( mode == EQueryTypeObject )
   323         switch( mode )
   304             {
   324             {
   305             CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   325             case EQueryTypeObject:
   306             qi.DoNotifyResultsL( iIdResultList );
   326                 {
   307             }
   327                 CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   308         else if ( mode == EQueryTypeRelation )
   328                 qi.DoNotifyResultsL( iIdResultList );
   309             {
   329                 break;
   310             CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   330                 }
   311             qi.DoNotifyResultsL( iIdResultList );
   331             case EQueryTypeRelation:
   312             }
   332                 {
   313         else if ( mode == EQueryTypeEvent )
   333                 CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   314             {
   334                 qi.DoNotifyResultsL( iIdResultList );
   315             CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
   335                 break;
   316             qi.DoNotifyResultsL( iIdResultList );
   336                 }
       
   337             case EQueryTypeEvent:
       
   338                 {
       
   339                 CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
       
   340                 qi.DoNotifyResultsL( iIdResultList );
       
   341                 break;
       
   342                 }
       
   343             default:
       
   344                 {
       
   345                 // Nothing to do
       
   346                 }
   317             }
   347             }
   318 
   348 
   319         // get rid of local results list
   349         // get rid of local results list
   320         iIdResultList.Reset();
   350         iIdResultList.Reset();
   321         }
   351         }
   322     else if ( iQuery.ResultMode() == EQueryResultModeCount )
   352     else if ( iQuery.ResultMode() == EQueryResultModeCount )
   323         {
   353         {
   324         const TQueryType mode = iQuery.Type();
   354         const TQueryType mode = iQuery.Type();
   325         
   355         
   326         if ( mode == EQueryTypeObject )
   356         switch( mode )
   327             {
   357             {
   328             CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   358             case EQueryTypeObject:
   329             qi.DoNotifyResults( iCountResult );
   359                 {
   330             }
   360                 CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   331         else if ( mode == EQueryTypeRelation )
   361                 qi.DoNotifyResults( iCountResult );
   332             {
   362                 break;
   333             CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   363                 }
   334             qi.DoNotifyResults( iCountResult );
   364             case EQueryTypeRelation:
   335             }
   365                 {
   336         else if ( mode == EQueryTypeEvent )
   366                 CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   337             {
   367                 qi.DoNotifyResults( iCountResult );
   338             CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
   368                 break;
   339             qi.DoNotifyResults( iCountResult );
   369                 }
       
   370             case EQueryTypeEvent:
       
   371                 {
       
   372                 CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
       
   373                 qi.DoNotifyResults( iCountResult );
       
   374                 break;
       
   375                 }
       
   376             default:
       
   377                 {
       
   378                 // Nothing to do
       
   379                 }
   340             }
   380             }
   341         }
   381         }
   342     else if ( ( aStatus == EAsyncFindSetReady ||
   382     else if ( ( aStatus == EAsyncFindSetReady ||
   343            aStatus == EAsyncFindComplete ) &&
   383            aStatus == EAsyncFindComplete ) &&
   344            iDistinctResults && iQuery.ResultMode() == EQueryResultModeDistinctValues )
   384            iDistinctResults && iQuery.ResultMode() == EQueryResultModeDistinctValues )
   363         {
   403         {
   364         const TInt code = ( aStatus == EAsyncFindComplete ? KErrNone : aStatus );
   404         const TInt code = ( aStatus == EAsyncFindComplete ? KErrNone : aStatus );
   365         
   405         
   366         const TQueryType mode = iQuery.Type();
   406         const TQueryType mode = iQuery.Type();
   367 
   407 
   368         if ( mode == EQueryTypeObject ) 
   408         switch( mode )
   369             {
   409             {
   370             CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   410             case EQueryTypeObject:
   371             qi.DoNotifyCompleted( code );
   411                 {
   372             }
   412                 CMdEObjectQueryImpl& qi = (CMdEObjectQueryImpl&)iQuery;
   373         else if ( mode == EQueryTypeRelation )
   413                 qi.DoNotifyCompleted( code );
   374             {
   414                 break;
   375             CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   415                 }
   376             qi.DoNotifyCompleted( code );
   416             case EQueryTypeRelation:
   377             }
   417                 {
   378         else if ( mode == EQueryTypeEvent )
   418                 CMdERelationQueryImpl& qi = (CMdERelationQueryImpl&)iQuery;
   379             {
   419                 qi.DoNotifyCompleted( code );
   380             CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
   420                 break;
   381             qi.DoNotifyCompleted( code );
   421                 }
       
   422             case EQueryTypeEvent:
       
   423                 {
       
   424                 CMdEEventQueryImpl& qi = (CMdEEventQueryImpl&)iQuery;
       
   425                 qi.DoNotifyCompleted( code );
       
   426                 break;
       
   427                 }
       
   428             default:
       
   429                 {
       
   430                 // Nothing to do
       
   431                 }
   382             }
   432             }
   383         }
   433         }
   384     
   434     
   385     if( aStatus == KErrServerTerminated )
   435     if( aStatus == KErrServerTerminated )
   386     	{
   436     	{