CMsvSearchSortOperation Class Reference

class CMsvSearchSortOperation : public CActive

Class: CMsvSearchSortOperation

CMsvSearchSortOperation is used for extended search-sort in message store

Inherits from

Public Member Functions
~CMsvSearchSortOperation ()
IMPORT_C TInt GetNextResultL ( TMsvId &)
IMPORT_C TInt GetNextResultL ( TMsvEntry &)
IMPORT_C TInt GetQueryIdL ()
IMPORT_C TInt GetResultCountL ()
IMPORT_C TInt GetResultsL ( RArray < TMsvId > &)
IMPORT_C TInt GetResultsL ( RArray < TMsvEntry > &)
IMPORT_C CMsvSearchSortOperation * NewL ( CMsvSession &)
IMPORT_C TInt ProgressL ()
IMPORT_C void RequestL ( CMsvSearchSortQuery *, TBool , TRequestStatus &, TInt )
IMPORT_C void RequestL ( TInt , TRequestStatus &, TInt )
IMPORT_C TInt UnmarkQuery (const TInt )
Private Member Functions
CMsvSearchSortOperation ( CMsvSession &)
void CheckIsArrayEmptyL ( RArray < TMsvId > &)
void CheckWhetherSubFolderOptionIsEnabledForSortQueryL ( CMsvSearchSortQuery *)
void Complete ()
void ConstructL ( CMsvSession &)
void ConstructSearchSortOperation ( CMsvSearchSortQuery *, TBool , TRequestStatus &, TInt )
void ConstructSearchSortOperation ( TInt , TRequestStatus &, TInt )
void DeleteQueryData ()
void DoCancel ()
void DoComplete ( TInt )
void DoPorcessOnEntryResultsL ()
void DoPorcessOnNewSearchSortResultsL ()
void DoProcessQuery ()
void DoRunL ()
void DoSetActive ()
TBool IsInTMsvEntryField ( TMsvMessagePart )
TBool IsMessagePartInHeaderBody ( TMsvMessagePart )
TBool IsSearchOnlyOnEntry ()
TBool IsSearchQueryWithSortOnTMsvEntryFields ()
TBool IsSortOnlyOnEntry ()
TMsvOp OpId ()
void ProcessSearchSortOnHeaderBodyL ()
void ProcessSearchSortQueryL ()
void ProcessSearchSortUsingQueryIdL ()
void RunL ()
void SendRequestL ()
void SendTMsvIdWithSortFieldResultsToserverL ()
void SetRequestType ( TRequestType , TRequestQueryType )
TInt ValidateQueryString ( CMsvSearchSortQuery *)
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()
Private Member Enumerations
enum TRequestQueryType { EMsvReqWithIterator , EMsvReqWithoutIterator }
enum TRequestType { EMsvSearchSortQuery , EMsvQueryId , EMsvSearchSortOnHeaderBody , EMsvGetEntryForIds }
enum TSendResultToServer { ESendTMsvId , ESendTMsvIdWithSortFileld , ESendInvalidTMsvId }
Inherited Enumerations
CActive:TPriority
Protected Attributes
CMsvSession & iMsvSession
Private Attributes
TInt iCount
RArray < TMsvEntry > iEntryArray
CMsvSearchsortOpOnHeaderBody * iHeaderBodySearch
RArray < TMsvId > iIdArray
TBool iIsQueryIdRequest
TBool iIsSearchSortOnIndexEntry
TInt iIterator
TBool iMarkQuery
TRequestStatus * iObserverRequestStatus
TMsvOp iOpId
TInt iOperationProgress
CMsvSearchSortQuery * iQuery
TInt iQueryId
TRequestQueryType iQueryType
TRequestType iReqType
TInt iResultStatus
TSendResultToServer iResultToServer
TMsvSearchSortResultType iResultType
TMsvEntry iTMsvEntry
TMsvId iTMsvId
RArray < TMsvIdWithSortField > iTMsvIdWithSortField
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CMsvSearchSortOperation(CMsvSession &)

CMsvSearchSortOperation ( CMsvSession & iMsvSession ) [private]

Parameters

CMsvSession & iMsvSession

~CMsvSearchSortOperation()

IMPORT_C ~CMsvSearchSortOperation ( )

Destructor.

Member Functions Documentation

CheckIsArrayEmptyL(RArray< TMsvId > &)

void CheckIsArrayEmptyL ( RArray < TMsvId > & aArray ) [private]

Parameters

RArray < TMsvId > & aArray

CheckWhetherSubFolderOptionIsEnabledForSortQueryL(CMsvSearchSortQuery *)

void CheckWhetherSubFolderOptionIsEnabledForSortQueryL ( CMsvSearchSortQuery * aQuery ) [private]

Parameters

CMsvSearchSortQuery * aQuery

Complete()

void Complete ( ) [private]

ConstructL(CMsvSession &)

void ConstructL ( CMsvSession & aMsvSession ) [private]

Second phase construction

Parameters

CMsvSession & aMsvSession

ConstructSearchSortOperation(CMsvSearchSortQuery *, TBool, TRequestStatus &, TInt)

void ConstructSearchSortOperation ( CMsvSearchSortQuery * aQuery,
TBool aMarkQuery,
TRequestStatus & aQueryStatus,
TInt aIterator
) [private]

Parameters

CMsvSearchSortQuery * aQuery
TBool aMarkQuery
TRequestStatus & aQueryStatus
TInt aIterator

ConstructSearchSortOperation(TInt, TRequestStatus &, TInt)

void ConstructSearchSortOperation ( TInt aQueryId,
TRequestStatus & aQueryStatus,
TInt aIterator
) [private]

Parameters

TInt aQueryId
TRequestStatus & aQueryStatus
TInt aIterator

DeleteQueryData()

void DeleteQueryData ( ) [private]

DoCancel()

void DoCancel ( ) [private, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel() .

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel() .

CActive::Cancel

DoComplete(TInt)

void DoComplete ( TInt aError ) [private]

Parameters

TInt aError

DoPorcessOnEntryResultsL()

void DoPorcessOnEntryResultsL ( ) [private]

DoPorcessOnNewSearchSortResultsL()

void DoPorcessOnNewSearchSortResultsL ( ) [private]

DoProcessQuery()

void DoProcessQuery ( ) [private]

DoRunL()

void DoRunL ( ) [private]

DoSetActive()

void DoSetActive ( ) [private]

GetNextResultL(TMsvId &)

IMPORT_C TInt GetNextResultL ( TMsvId & aTMsvId )

Gets the TMsvId of a single index entry object at a time. This function is used when getting the results using iterative mechanism.

Parameters

TMsvId & aTMsvId

GetNextResultL(TMsvEntry &)

IMPORT_C TInt GetNextResultL ( TMsvEntry & aTMsvEntry )

Gets one index entry object at a time. This function is used when getting the results using iterative mechanism.

Parameters

TMsvEntry & aTMsvEntry

GetQueryIdL()

IMPORT_C TInt GetQueryIdL ( )

After the completion of asynchronous function RequestL() , this function provides the query Id corresponding to a particular search-sort query.

leave
KErrRequestPending if the asynchronous function RequestL() is not yet completed.

GetResultCountL()

IMPORT_C TInt GetResultCountL ( )

Returns the count of search-sort results, without returning the actual search-sort results.

GetResultsL(RArray< TMsvId > &)

IMPORT_C TInt GetResultsL ( RArray < TMsvId > & aMsvIdList )

After the completion of asynchronous function RequestL() , this function provides a list of index entry Id objects (TMsvId).

leave
KErrMsvInvalidResultRequest - If the result type requested during execution of query was set to TMsvEntry , but the messaging client is trying to receive TMsvId objects

Parameters

RArray < TMsvId > & aMsvIdList

GetResultsL(RArray< TMsvEntry > &)

IMPORT_C TInt GetResultsL ( RArray < TMsvEntry > & aMsvEntryList )

After the completion of asynchronous function RequestL() , this function provides a list of index entry objects ( TMsvEntry ).

leave
KErrMsvInvalidResultRequest - If the result type requested during execution of query was set to TMsvEntry , but the messaging client is trying to receive TMsvId objects

Parameters

RArray < TMsvEntry > & aMsvEntryList

IsInTMsvEntryField(TMsvMessagePart)

TBool IsInTMsvEntryField ( TMsvMessagePart aMessagePart ) [private]

Parameters

TMsvMessagePart aMessagePart

IsMessagePartInHeaderBody(TMsvMessagePart)

TBool IsMessagePartInHeaderBody ( TMsvMessagePart aMessagePart ) [private]

Parameters

TMsvMessagePart aMessagePart

IsSearchOnlyOnEntry()

TBool IsSearchOnlyOnEntry ( ) [private]

IsSearchQueryWithSortOnTMsvEntryFields()

TBool IsSearchQueryWithSortOnTMsvEntryFields ( ) [private]

IsSortOnlyOnEntry()

TBool IsSortOnlyOnEntry ( ) [private]

NewL(CMsvSession &)

IMPORT_C CMsvSearchSortOperation * NewL ( CMsvSession & iMsvSession ) [static]

Allocates and constructs a CMsvSearchSortOperation object.

leave
KErrNotFound The requested entry does not exist
leave
KErrNoMemory A memory allocation failed

Parameters

CMsvSession & iMsvSession

OpId()

TMsvOp OpId ( ) [private]

ProcessSearchSortOnHeaderBodyL()

void ProcessSearchSortOnHeaderBodyL ( ) [private]

ProcessSearchSortQueryL()

void ProcessSearchSortQueryL ( ) [private]

ProcessSearchSortUsingQueryIdL()

void ProcessSearchSortUsingQueryIdL ( ) [private]

ProgressL()

IMPORT_C TInt ProgressL ( )
Returns progress information on the current search-sort request.
leave

RequestL(CMsvSearchSortQuery *, TBool, TRequestStatus &, TInt)

IMPORT_C void RequestL ( CMsvSearchSortQuery * aQuery,
TBool aMarkQuery,
TRequestStatus & aQueryStatus,
TInt aIterator = 0
)

Search-sort operation is performed on a specified folder (e.g, on INBOX, SENT-ITEMS, DRAFT, OUTBOX or any user created folder).

leave
If iterator count is morethan one, it will with leave with KErrArgument

Parameters

CMsvSearchSortQuery * aQuery
TBool aMarkQuery
TRequestStatus & aQueryStatus
TInt aIterator = 0

RequestL(TInt, TRequestStatus &, TInt)

IMPORT_C void RequestL ( TInt aQueryId,
TRequestStatus & aQueryStatus,
TInt aIterator = 0
)

Getting Search-sort results for specified QueryId.

leave
If iterator count is morethan one, it will with leave with KErrArgument

Parameters

TInt aQueryId
TRequestStatus & aQueryStatus
TInt aIterator = 0

RunL()

void RunL ( ) [private, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

SendRequestL()

void SendRequestL ( ) [private]

SendTMsvIdWithSortFieldResultsToserverL()

void SendTMsvIdWithSortFieldResultsToserverL ( ) [private]

SetRequestType(TRequestType, TRequestQueryType)

void SetRequestType ( TRequestType aReqType,
TRequestQueryType aQueryType
) [private]

Parameters

TRequestType aReqType
TRequestQueryType aQueryType

UnmarkQuery(const TInt)

IMPORT_C TInt UnmarkQuery ( const TInt aQueryId )

Unmarks the query listed in search-sort cache. The unmarked queries are preferred over marked queries for being disposed from the search-sort cache when the search-sort cache reaches a maximum limit

leave
KErrNotFound The requested queryId does not exist

Parameters

const TInt aQueryId

ValidateQueryString(CMsvSearchSortQuery *)

TInt ValidateQueryString ( CMsvSearchSortQuery * aQuery ) [private]

Parameters

CMsvSearchSortQuery * aQuery

Member Enumerations Documentation

Enum TRequestQueryType

Enumerators

EMsvReqWithIterator
EMsvReqWithoutIterator

Enum TRequestType

Enumerators

EMsvSearchSortQuery
EMsvQueryId
EMsvSearchSortOnHeaderBody
EMsvGetEntryForIds

Enum TSendResultToServer

Enumerators

ESendTMsvId
ESendTMsvIdWithSortFileld
ESendInvalidTMsvId

Member Data Documentation

TInt iCount

TInt iCount [private]

RArray< TMsvEntry > iEntryArray

RArray < TMsvEntry > iEntryArray [private]

CMsvSearchsortOpOnHeaderBody * iHeaderBodySearch

CMsvSearchsortOpOnHeaderBody * iHeaderBodySearch [private]

RArray< TMsvId > iIdArray

RArray < TMsvId > iIdArray [private]

TBool iIsQueryIdRequest

TBool iIsQueryIdRequest [private]

TBool iIsSearchSortOnIndexEntry

TBool iIsSearchSortOnIndexEntry [private]

TInt iIterator

TInt iIterator [private]

TBool iMarkQuery

TBool iMarkQuery [private]

CMsvSession & iMsvSession

CMsvSession & iMsvSession [protected]

TRequestStatus * iObserverRequestStatus

TRequestStatus * iObserverRequestStatus [private]

TMsvOp iOpId

TMsvOp iOpId [private]

TInt iOperationProgress

TInt iOperationProgress [private]

CMsvSearchSortQuery * iQuery

CMsvSearchSortQuery * iQuery [private]

TInt iQueryId

TInt iQueryId [private]

TRequestQueryType iQueryType

TRequestQueryType iQueryType [private]

TRequestType iReqType

TRequestType iReqType [private]

TInt iResultStatus

TInt iResultStatus [private]

TSendResultToServer iResultToServer

TSendResultToServer iResultToServer [private]

TMsvSearchSortResultType iResultType

TMsvSearchSortResultType iResultType [private]

TMsvEntry iTMsvEntry

TMsvEntry iTMsvEntry [private]

TMsvId iTMsvId

TMsvId iTMsvId [private]

RArray< TMsvIdWithSortField > iTMsvIdWithSortField

RArray < TMsvIdWithSortField > iTMsvIdWithSortField [private]