CPSRequestHandler Class Reference

class CPSRequestHandler : public CActive

CPSRequestHandler An instance of the request handler object for the Predicitve Search application

PsServerClientAPI.lib
Since
S60 v3.2

Inherits from

Public Member Functions
~CPSRequestHandler()
IMPORT_C voidAddObserverL(MPsResultsObserver *)
IMPORT_C voidCancelSearch()
IMPORT_C voidChangeSortOrderL(const TDesC &, RArray< TInt > &)
IMPORT_C MVPbkContactLink *ConvertToVpbkLinkLC(const CPsClientData &, CVPbkContactManager &)
IMPORT_C voidGetAdaptiveGridCharactersL(const MDesCArray &, const TDesC &, const TBool, TDes &)
IMPORT_C voidGetAllContentsL()
IMPORT_C TIntGetCachingStatusL(TCachingStatus &)
IMPORT_C voidGetDataOrderL(const TDesC &, RArray< TInt > &)
IMPORT_C voidGetSortOrderL(const TDesC &, RArray< TInt > &)
IMPORT_C TBoolIsLanguageSupportedL(const TLanguage)
IMPORT_C voidLookupL(const CPsQuery &, const TDesC &, CDesCArray &, RArray< TPsMatchLocation > &)
IMPORT_C voidLookupMatchL(const CPsQuery &, const TDesC &, TDes &)
IMPORT_C CPSRequestHandler *NewL()
IMPORT_C CPSRequestHandler *NewLC()
voidNotifyCachingStatus(TCachingStatus, TInt)
IMPORT_C TIntRemoveObserver(MPsResultsObserver *)
IMPORT_C voidSearchL(const CPsQuery &)
IMPORT_C voidSearchL(const CPsQuery &, RPointerArray< CPsClientData > &, CVPbkContactManager *)
IMPORT_C voidSetSearchSettingsL(const CPsSettings &)
IMPORT_C voidShutdownServerL()
IMPORT_C TVersionVersion()
Protected Member Functions
voidDoCancel()
voidRunL()
Private Member Functions
CPSRequestHandler()
TInt AddMarkedContactsL(RPointerArray< CPsClientData > &)
voidConstructL()
voidHandleBufferOverFlowL()
voidHandleErrorL(TInt)
voidHandleSearchResultsL()
voidRunSearchFromBufferL()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Inherited Enumerations
CActive:TPriority
Private Attributes
CVPbkContactManager *iBookMarkContactManager
CPsUpdateHandler *iContactAddedHandler
CPsUpdateHandler *iContactModifiedHandler
CPsUpdateHandler *iContactRemovedHandler
CVPbkContactIdConverter *iConverter
RPointerArray< CPsClientData >iMarkedContacts
RPointerArray< MPsResultsObserver >iObservers
HBufC8 *iPendingSearchQueryBuffer
CPsPropertyHandler *iPropertyHandler
HBufC8 *iSearchDataBuffer
HBufC8 *iSearchQueryBuffer
TBool iSearchRequestCancelled
HBufC8 *iSearchResultsBuffer
RPsSession iSession
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CPSRequestHandler()

CPSRequestHandler()[private]

CPSRequestHandler. Performs the first phase of two phase construction.

~CPSRequestHandler()

~CPSRequestHandler()[virtual]

~CPSRequestHandler. Destructor. Destroys the object and release all memory objects.

Member Functions Documentation

AddMarkedContactsL(RPointerArray< CPsClientData > &)

TInt AddMarkedContactsL(RPointerArray< CPsClientData > &searchResults)[private]

AddMarkedContacts Filters the bookmark results and adds them to final search result set

Parameters

RPointerArray< CPsClientData > & searchResults

AddObserverL(MPsResultsObserver *)

IMPORT_C voidAddObserverL(MPsResultsObserver *aObserver)

AddObserver.

Parameters

MPsResultsObserver * aObserverThe object to be used to handle updates from the server.

CancelSearch()

IMPORT_C voidCancelSearch()

CancelSearch. Cancels ongoing search.

ChangeSortOrderL(const TDesC &, RArray< TInt > &)

IMPORT_C voidChangeSortOrderL(const TDesC &aDataStore,
RArray< TInt > &aSortOrder
)

ChangeSortOrderL. This function sets the sort order of data fields (mapped to VPbk identifiers) on a datastore. This is a synchronous request.

Parameters

const TDesC & aDataStoreThe data store URI.
RArray< TInt > & aSortOrderThis array has the field identifiers to be set for this store.

ConstructL()

voidConstructL()[private]

ConstructL. Performs the second phase construction of a CPSRequestHandler object.

ConvertToVpbkLinkLC(const CPsClientData &, CVPbkContactManager &)

IMPORT_C MVPbkContactLink *ConvertToVpbkLinkLC(const CPsClientData &aSearchResult,
CVPbkContactManager &aContactManager
)

ConvertToVpbkLinkLC. Extract the VPBK contact link associated with the search result. This is a synchronous request.

Parameters

const CPsClientData & aSearchResultPS result for which contact link is required.
CVPbkContactManager & aContactManagerAn instance of contact manager used for link extraction.

DoCancel()

voidDoCancel()[protected, virtual]

From CActive, DoCancel. Cancels any outstanding operation.

GetAdaptiveGridCharactersL(const MDesCArray &, const TDesC &, const TBool, TDes &)

IMPORT_C voidGetAdaptiveGridCharactersL(const MDesCArray &aDataStores,
const TDesC &aSearchText,
const TBoolaCompanyName,
TDes &aAdaptiveGrid
)

GetAdaptiveGridCharactersL. This is a support method for Adaptive Search functionality. As Predictive Search Engine is well suited for keeping an maintaining data structures related to contacts and updated according to contacts additions/modifications/deletions, like it is done already in Predictive Search Engine.

Parameters

const MDesCArray & aDataStoresThe data store URIs.
const TDesC & aSearchTextThe text in the find box.
const TBool aCompanyNameThe info if Company Name is required.
TDes & aAdaptiveGridThe returned Adaptive Grid.

GetAllContentsL()

IMPORT_C voidGetAllContentsL()

GetAllContentsL. Sends a request to the predictive search server to get all cached contents. This is a asynchronous request.

GetCachingStatusL(TCachingStatus &)

IMPORT_C TIntGetCachingStatusL(TCachingStatus &aStatus)

GetCachingStatusL Gets the status of the caching synchronously

Parameters

TCachingStatus & aStatus

GetDataOrderL(const TDesC &, RArray< TInt > &)

IMPORT_C voidGetDataOrderL(const TDesC &aDataStore,
RArray< TInt > &aDataOrder
)

GetDataOrderL. This function returns the list of supported data fields (mapped to VPbk identifiers) supported by a datastore. This is a synchronous request.

Parameters

const TDesC & aDataStoreThe data store URI.
RArray< TInt > & aDataOrderThis array has the field identifiers returned from the server.

GetSortOrderL(const TDesC &, RArray< TInt > &)

IMPORT_C voidGetSortOrderL(const TDesC &aDataStore,
RArray< TInt > &aSortOrder
)

GetSortOrderL. This function returns the sort order of data fields (mapped to VPbk identifiers) set on a datastore. This is a synchronous request.

Parameters

const TDesC & aDataStoreThe data store URI.
RArray< TInt > & aSortOrderThis array has the field identifiers returned from the server.

HandleBufferOverFlowL()

voidHandleBufferOverFlowL()[private]

HandleBufferOverFlowL. Handles internal buffer overflow event.

HandleErrorL(TInt)

voidHandleErrorL(TIntaErrorCode)[private]

HandleErrorL. Handles error events.

Parameters

TInt aErrorCode

HandleSearchResultsL()

voidHandleSearchResultsL()[private]

ParseResultsL. Parses the results buffer and converts them to data elements.

IsLanguageSupportedL(const TLanguage)

IMPORT_C TBoolIsLanguageSupportedL(const TLanguageaLanguage)

IsLanguageSupportedL. Checks if the language variant is supported by the predictive search engine. This is a synchronous request.

Parameters

const TLanguage aLanguageThe language which has to be checked

LookupL(const CPsQuery &, const TDesC &, CDesCArray &, RArray< TPsMatchLocation > &)

IMPORT_C voidLookupL(const CPsQuery &aSearchQuery,
const TDesC &aSearchData,
CDesCArray &aMatchSet,
RArray< TPsMatchLocation > &aMatchLocation
)

LookupL. Sends a request to the predictive search server. Does a predictive search in aSearchData for aSearchQuery and return the matches. This is a synchronous request.

Parameters

const CPsQuery & aSearchQueryThe input search query.(Length of aSearchQuery <= KPsQueryMaxLen)
const TDesC & aSearchDataThe input data to be searched.
CDesCArray & aMatchSetThe list of matches.
RArray< TPsMatchLocation > & aMatchLocationThe list matched index and length of match

LookupMatchL(const CPsQuery &, const TDesC &, TDes &)

IMPORT_C voidLookupMatchL(const CPsQuery &aSearchQuery,
const TDesC &aSearchData,
TDes &aMatch
)

LookupMatchL. Sends a request to the predictive search server. Does a predictive search in aSearchData for aSearchQuery and return the match string in aMatch. If there is no full match aMatch will be empty (Length()==0) This is a synchronous request.

Parameters

const CPsQuery & aSearchQueryThe input search query.(Length of aSearchQuery <= KPsQueryMaxLen)
const TDesC & aSearchDataThe input data to be searched.
TDes & aMatchThe matched result

NewL()

IMPORT_C CPSRequestHandler *NewL()[static]

NewL. Two-phased constructor. Creates a CPSRequestHandler object using two phase construction, and return a pointer to the created object.

NewLC()

IMPORT_C CPSRequestHandler *NewLC()[static]

NewLC. Two-phased constructor. Creates a CPSRequestHandler object using two phase construction, and return a pointer to the created object.

NotifyCachingStatus(TCachingStatus, TInt)

voidNotifyCachingStatus(TCachingStatusaStatus,
TIntaError
)

Notify observers about the cahcing status

Parameters

TCachingStatus aStatus
TInt aError

RemoveObserver(MPsResultsObserver *)

IMPORT_C TIntRemoveObserver(MPsResultsObserver *aObserver)

RemoveObserverL.

Parameters

MPsResultsObserver * aObserverThe object used to handle updates from the server.

RunL()

voidRunL()[protected, virtual]

From CActive, RunL. Callback function. Invoked to handle responses from the server.

RunSearchFromBufferL()

voidRunSearchFromBufferL()[private]

RunSearchFromBufferL Runs search if search query buffer ( iPendingSearchQueryBuffer ) is not empty

SearchL(const CPsQuery &)

IMPORT_C voidSearchL(const CPsQuery &aSearchQuery)

SearchL. Sends a request to the predictive search server. This is a asynchronous request.

Parameters

const CPsQuery & aSearchQueryThe input search query.(Length of aSearchQuery <= KPsQueryMaxLen)

SearchL(const CPsQuery &, RPointerArray< CPsClientData > &, CVPbkContactManager *)

IMPORT_C voidSearchL(const CPsQuery &aSearchQuery,
RPointerArray< CPsClientData > &aMarkedContacts,
CVPbkContactManager *aContactManager
)

SearchL. Sends a request to the predictive search server. This is a asynchronous request. It considers bookmarked contacts while sending the results back to the client

Parameters

const CPsQuery & aSearchQueryThe input search query.(Length of aSearchQuery <= KPsQueryMaxLen)
RPointerArray< CPsClientData > & aMarkedContactsArray of marked contacts
CVPbkContactManager * aContactManagerContact manager instance

SetSearchSettingsL(const CPsSettings &)

IMPORT_C voidSetSearchSettingsL(const CPsSettings &aSettings)

SetSearchSettingsL. Set the databases and fields to be included in search. Databases ids are mapped to virtual phone book URLs. Fields to be searched are mapped to virutal phonebook identifiers.

Parameters

const CPsSettings & aSettingsHolds the search settings.

ShutdownServerL()

IMPORT_C voidShutdownServerL()

ShutdownServerL Shuts down the predictive search engine.

CAUTION: Shutdown of predictive search server shouldn't be done for each session. It should be done only when the search engine needs to be completely shutdown.

Version()

IMPORT_C TVersionVersion()const

Version. Returns the predictive search server version.

Member Data Documentation

CVPbkContactManager * iBookMarkContactManager

CVPbkContactManager *iBookMarkContactManager[private]

Not Owned iBookMarkContactManager, contact manager reference received from the client To be used only for handling marked contacts.

CPsUpdateHandler * iContactAddedHandler

CPsUpdateHandler *iContactAddedHandler[private]

iContactAddedHandler, handler for reacting to contact being added to cache

CPsUpdateHandler * iContactModifiedHandler

CPsUpdateHandler *iContactModifiedHandler[private]

iContactModifiedHandler, handler for reacting to contact being modified in cache

CPsUpdateHandler * iContactRemovedHandler

CPsUpdateHandler *iContactRemovedHandler[private]

iContactRemovedHandler, handler for reacting to contact being removed from cache

CVPbkContactIdConverter * iConverter

CVPbkContactIdConverter *iConverter[private]

iConverter, instance of contact id converter

RPointerArray< CPsClientData > iMarkedContacts

RPointerArray< CPsClientData >iMarkedContacts[private]

iMarkedContacts, stores the bookmarked contacts if any, sent by the client

RPointerArray< MPsResultsObserver > iObservers

RPointerArray< MPsResultsObserver >iObservers[private]

iObservers, observers which handles updates from the server.

HBufC8 * iPendingSearchQueryBuffer

HBufC8 *iPendingSearchQueryBuffer[private]

iPendingSearchQueryBuffer, the buffer that holds the pending search query.

CPsPropertyHandler * iPropertyHandler

CPsPropertyHandler *iPropertyHandler[private]

iPropertyHandler, the handler to property which is asynchronously monitored

HBufC8 * iSearchDataBuffer

HBufC8 *iSearchDataBuffer[private]

iSearchDataBuffer, the buffer that holds the search data.

HBufC8 * iSearchQueryBuffer

HBufC8 *iSearchQueryBuffer[private]

iSearchQueryBuffer, the buffer that holds the search query.

TBool iSearchRequestCancelled

TBool iSearchRequestCancelled[private]

ETrue, if search request was cancelled

HBufC8 * iSearchResultsBuffer

HBufC8 *iSearchResultsBuffer[private]

iSearchResultsBuffer, the buffer that holds the search results.

RPsSession iSession

RPsSession iSession[private]

iSession, the predictive search server session.