predictivesearch/PcsAlgorithm/Algorithm1/inc/CPcsAlgorithm1.h
branchRCL_3
changeset 6 e8e3147d53eb
parent 0 e686773b3f54
child 7 b3431bff8c19
equal deleted inserted replaced
5:81f8547efd4f 6:e8e3147d53eb
   158 	public:	
   158 	public:	
   159         
   159         
   160 		/**
   160 		/**
   161 		* Returns the array index of cache (in iPcsCache) for a datastore
   161 		* Returns the array index of cache (in iPcsCache) for a datastore
   162 		*/
   162 		*/
   163 		TInt GetCacheIndex(TDesC& aDataStore);	
   163 		TInt GetCacheIndex(const TDesC& aDataStore);	
   164 
   164 
   165 		/** 
   165 		/** 
   166 		* Return the cache instance at a specific array index
   166 		* Return the cache instance at a specific array index
   167 		*/
   167 		*/
   168 		inline CPcsCache* GetCache(TInt aIndex) 
   168 		inline CPcsCache* GetCache(TInt aIndex) 
   174 		* Returns the key map instance
   174 		* Returns the key map instance
   175 		*/
   175 		*/
   176 		inline CPcsKeyMap* GetKeyMap() 
   176 		inline CPcsKeyMap* GetKeyMap() 
   177 		{ 
   177 		{ 
   178 			return iKeyMap; 
   178 			return iKeyMap; 
   179 		};
   179 		}
   180         
   180         
   181 		
   181 		
   182 	private:
   182 	private:
   183 	
   183 	
   184 		/**
   184 		/**
   207 		* Search function helper
   207 		* Search function helper
   208 		*/
   208 		*/
   209 		void DoSearchL ( const CPsSettings& aPcsSettings,
   209 		void DoSearchL ( const CPsSettings& aPcsSettings,
   210 						 CPsQuery& aCondition,
   210 						 CPsQuery& aCondition,
   211 						 RPointerArray<CPsData>& searchResults,
   211 						 RPointerArray<CPsData>& searchResults,
   212 	                     RPointerArray<CPsPattern>& searchSeqs );		                       
   212 	                     RPointerArray<CPsPattern>& searchSeqs );
   213 							                       
   213 		
   214 		/**                
   214 		/**                
   215 		* Search function helper
   215 		* Search function helper
   216 		*/
   216 		*/
   217 		void DoSearchInputL ( CPsQuery& aQuery,
   217 		void DoSearchInputL ( CPsQuery& aQuery,
   218 						 	  TDesC& aData,
   218 						 	  const TDesC& aData,
   219 							  RPointerArray<TDesC>& searchSeqs,
   219 							  RPointerArray<TDesC>& aSearchSeqs,
   220 							  RArray<TPsMatchLocation>& aMatchLocation );	 
   220 							  RArray<TPsMatchLocation>& aMatchLocation );
   221 						                    		                       
   221 		
   222 		/**
   222 		/**
   223 		* Returns the index corresponding a URI in iDataStoreUri
   223 		* Returns the index corresponding a URI in iDataStoreUri
   224 		*/
   224 		*/
   225 		TInt FindStoreUri ( TDesC& aDataStoreUri );
   225 		TInt FindStoreUri ( const TDesC& aDataStoreUri );
   226 
   226 
   227 		/**
   227 		/**
   228 		* Function to return all cached content
   228 		* Function to return all cached content
   229 		*/
   229 		*/
   230 		void GetAllContentsL ( const CPsSettings& aPcsSettings,	                    
   230 		void GetAllContentsL ( const CPsSettings& aPcsSettings,
   231 		                       RPointerArray<CPsData>& searchResults );
   231 		                       RPointerArray<CPsData>& aSearchResults );
   232 		    
   232 		    
   233 		/**
   233 		/**
   234 		* Checks if search is on groups
   234 		* Checks if search is on groups
   235         * Return ETrue if there is a valid group URI        
   235         * Return ETrue if there is a valid group URI
   236 		*/
   236 		*/
   237 		TBool IsGroupSearchL ( CPsSettings& aSettings,
   237 		TBool IsGroupSearchL ( CPsSettings& aSettings,
   238 		                       RArray<TInt>& aGroupIdArray );						 
   238 		                       RArray<TInt>& aGroupIdArray );
   239 
   239 
   240         /**
   240         /**
   241         * Utility function to replace groups uri with that of contacts uri
   241         * Utility function to replace groups uri with that of contacts uri
   242         */
   242         */
   243         void ReplaceGroupsUriL ( CPsSettings& aSettings );							 
   243         void ReplaceGroupsUriL ( CPsSettings& aSettings );
   244 
   244 
   245 		/**
   245 		/**
   246 		* Filters the search results array for groups
   246 		* Filters the search results array for groups
   247 		*/
   247 		*/
   248 		void FilterSearchResultsForGroupsL ( RArray<TInt>& aGroupContactIds,
   248 		void FilterSearchResultsForGroupsL ( RArray<TInt>& aGroupContactIds,
   249 							 	             RPointerArray<CPsData>& aSearchResults );
   249 							 	             RPointerArray<CPsData>& aSearchResults );
   250 
   250 
   251         /**
   251         /**
   252         * Get the list of contact ids that belong to a group.
   252         * Get the list of contact ids that belong to a group.
   253         */							 	           
   253         */
   254 		void GetContactsInGroupL ( TInt aGroupId, 
   254 		void GetContactsInGroupL ( TInt aGroupId, 
   255                                    RArray<TInt>& aGroupContactIds );
   255                                    RArray<TInt>& aGroupContactIds );
   256                                                 						
   256         
   257 		/**
   257 		/**
   258 		* Read sort order for a data store from the central repository
   258 		* Read sort order for a data store from the central repository
   259 		* @param aURI - The data store URI for which sort order is required
   259 		* @param aURI - The data store URI for which sort order is required
   260 		* @param aSortOrder - The persisted sort order from the cenrep
   260 		* @param aSortOrder - The persisted sort order from the cenrep
   261 		*/
   261 		*/
   262 		void ReadSortOrderFromCenRepL ( TDesC& aURI, 
   262 		void ReadSortOrderFromCenRepL ( const TDesC& aURI, 
   263 		                               RArray<TInt>& aSortOrder );
   263 		                                RArray<TInt>& aSortOrder );
   264 
   264 
   265 		/** Write sort order for a data store to the central repository
   265 		/** Write sort order for a data store to the central repository
   266 		* @param aURI - The data store URI for which sort order is to be persisted
   266 		* @param aURI - The data store URI for which sort order is to be persisted
   267 		* @param aSortOrder - The sort order to be persisted	
   267 		* @param aSortOrder - The sort order to be persisted	
   268 		*/
   268 		*/
   269 		void WriteSortOrderToCenRepL ( TDesC& aURI, 
   269 		void WriteSortOrderToCenRepL ( const TDesC& aURI, 
   270 		                              RArray<TInt>& aSortOrder );	
   270 		                               RArray<TInt>& aSortOrder );	
   271 		                         								
   271 		                         								
   272 		/**
   272 		/**
   273 		* Utility function that sets the caching error value
   273 		* Utility function that sets the caching error value
   274 		*/                             
   274 		*/
   275 		void SetCachingError ( TDesC& aDataStore, 
   275 		void SetCachingError ( const TDesC& aDataStore, 
   276 		                       TInt aError );	
   276 		                       TInt aError );
   277 
   277 
   278 		/**
   278 		/**
   279 		* Write the content required by client 
   279 		* Write the content required by client 
   280 		*/
   280 		*/
   281 		CPsClientData* WriteClientDataL ( CPsData& aPsData );	
   281 		CPsClientData* WriteClientDataL ( CPsData& aPsData );
   282 			
   282 			
   283 		/**
   283 		/**
   284 		* Function to return data base URI for an internal identifier
   284 		* Function to return data base URI for an internal identifier
   285 		*/		                     
   285 		*/
   286 		TDesC& GetUriForIdL( TUint8 aUriId );		
   286 		const TDesC& GetUriForIdL( TUint8 aUriId );
   287 		
   287 		
   288         /**
   288         /**
   289         * launch plugins by idle
   289         * launch plugins by idle
   290         */
   290         */
   291          void DoLaunchPluginsL();
   291          void DoLaunchPluginsL();
   292         
   292         
   293         /**
   293         /**
   294         * launch plugins
   294         * launch plugins
   295         */
   295         */
   296          static TInt DoLaunchPluginsL(TAny* aPtr);
   296          static TInt DoLaunchPluginsL(TAny* aPtr);
   297 									
   297 
   298     private:
   298     private:
   299     
   299     
   300 		/**
   300 		/**
   301 		* Instance of contacts cache
   301 		* Instance of contacts cache
   302 		* Own
   302 		* Own
   315 		CPcsKeyMap* iKeyMap;
   315 		CPcsKeyMap* iKeyMap;
   316 
   316 
   317 		/**
   317 		/**
   318 		* Data plugin interface. Owned
   318 		* Data plugin interface. Owned
   319 		*/
   319 		*/
   320 		CPsDataPluginInterface *iPsDataPluginInterface;
   320 		CPsDataPluginInterface* iPsDataPluginInterface;
   321 
   321 
   322 		/**
   322 		/**
   323 		* Instance of algorithm helper. Owned
   323 		* Instance of algorithm helper. Owned
   324 		*/
   324 		*/
   325 		CPcsAlgorithm1Helper* iHelper;
   325 		CPcsAlgorithm1Helper* iHelper;