searchfw/plugins/contactsplugin/src/contactssearcher.cpp
branchRCL_3
changeset 5 42814f902fe6
parent 0 f979ecb2b13e
child 67 1539a383d7b6
equal deleted inserted replaced
0:f979ecb2b13e 5:42814f902fe6
    49 #include <MVPbkContactViewBase.h>
    49 #include <MVPbkContactViewBase.h>
    50 #include <MVPbkContactStoreInfo.h>
    50 #include <MVPbkContactStoreInfo.h>
    51 #include <CVPbkContactViewDefinition.h>
    51 #include <CVPbkContactViewDefinition.h>
    52 #include <CVPbkSortOrder.h>
    52 #include <CVPbkSortOrder.h>
    53 #include <MVPbkContactViewFiltering.h>
    53 #include <MVPbkContactViewFiltering.h>
       
    54 #include <CPbk2SortOrderManager.h>
    54 #include <barsc.h>
    55 #include <barsc.h>
    55 #include <barsread.h>
    56 #include <barsread.h>
    56 #include <contactssearchresource.rsg>
    57 #include <contactssearchresource.rsg>
    57 #include <bautils.h>
    58 #include <bautils.h>
    58 #include <data_caging_path_literals.hrh>
    59 #include <data_caging_path_literals.hrh>
   389 	                 }
   390 	                 }
   390 	    	   }
   391 	    	   }
   391 	       
   392 	       
   392            else
   393            else
   393         	   {
   394         	   {
   394                User::Leave( KErrNotFound );
   395         	   return NULL;
   395         	   }
   396         	   }
   396          
   397          
   397          }
   398          }
   398      
   399      
   399      return NULL;
   400      return NULL;
   748     {
   749     {
   749     // We just fire a find function with null value to get all the links
   750     // We just fire a find function with null value to get all the links
   750     // in the contact store. Once we get the links, we extract data from them 
   751     // in the contact store. Once we get the links, we extract data from them 
   751     // to be searched, and then pass the same to the text searcher
   752     // to be searched, and then pass the same to the text searcher
   752     
   753     
   753     CVPbkSortOrder* sortOrder = CVPbkSortOrder::NewL( iContactManager->FieldTypes() );
   754 	CPbk2SortOrderManager* sortOrderManager = CPbk2SortOrderManager::NewL( iContactManager->FieldTypes() );
   754     CleanupStack::PushL( sortOrder );
   755 	CleanupStack::PushL( sortOrderManager );
   755         
   756         
   756     CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
   757     CVPbkContactViewDefinition* viewDef = CVPbkContactViewDefinition::NewL();
   757     CleanupStack::PushL( viewDef );
   758     CleanupStack::PushL( viewDef );
   758     viewDef->SetType( EVPbkCompositeView );
   759     viewDef->SetType( EVPbkCompositeView );
   759          
   760          
   779         TRequestStatus* status = &iStatus;
   780         TRequestStatus* status = &iStatus;
   780         User::RequestComplete( status, KErrNone );
   781         User::RequestComplete( status, KErrNone );
   781         SetActive();
   782         SetActive();
   782         }
   783         }
   783     iContactViewBase = iContactManager->CreateContactViewLC( 
   784     iContactViewBase = iContactManager->CreateContactViewLC( 
   784                    *this, *viewDef, *sortOrder );
   785                    *this, *viewDef, sortOrderManager->SortOrder() );
   785                 
   786                 
   786     CleanupStack::Pop(); // CreateContactViewLC
   787     CleanupStack::Pop(); // CreateContactViewLC
   787     CleanupStack::PopAndDestroy( viewDef );
   788     CleanupStack::PopAndDestroy( viewDef );
   788     CleanupStack::PopAndDestroy( sortOrder );
   789     CleanupStack::PopAndDestroy( sortOrderManager );
   789     }
   790     }
   790     
   791     
   791 
   792 
   792     
   793     
   793 // ---------------------------------------------------------------------------
   794 // ---------------------------------------------------------------------------