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 TIntGetNextResultL(TMsvId &)
IMPORT_C TIntGetNextResultL(TMsvEntry &)
IMPORT_C TIntGetQueryIdL()
IMPORT_C TIntGetResultCountL()
IMPORT_C TIntGetResultsL(RArray< TMsvId > &)
IMPORT_C TIntGetResultsL(RArray< TMsvEntry > &)
IMPORT_C CMsvSearchSortOperation *NewL(CMsvSession &)
IMPORT_C TIntProgressL()
IMPORT_C voidRequestL(CMsvSearchSortQuery *, TBool, TRequestStatus &, TInt)
IMPORT_C voidRequestL(TInt, TRequestStatus &, TInt)
IMPORT_C TIntUnmarkQuery(const TInt)
Private Member Functions
CMsvSearchSortOperation(CMsvSession &)
voidCheckIsArrayEmptyL(RArray< TMsvId > &)
voidCheckWhetherSubFolderOptionIsEnabledForSortQueryL(CMsvSearchSortQuery *)
voidComplete()
voidConstructL(CMsvSession &)
voidConstructSearchSortOperation(CMsvSearchSortQuery *, TBool, TRequestStatus &, TInt)
voidConstructSearchSortOperation(TInt, TRequestStatus &, TInt)
voidDeleteQueryData()
voidDoCancel()
voidDoComplete(TInt)
voidDoPorcessOnEntryResultsL()
voidDoPorcessOnNewSearchSortResultsL()
voidDoProcessQuery()
voidDoRunL()
voidDoSetActive()
TBool IsInTMsvEntryField(TMsvMessagePart)
TBool IsMessagePartInHeaderBody(TMsvMessagePart)
TBool IsSearchOnlyOnEntry()
TBool IsSearchQueryWithSortOnTMsvEntryFields()
TBool IsSortOnlyOnEntry()
TMsvOp OpId()
voidProcessSearchSortOnHeaderBodyL()
voidProcessSearchSortQueryL()
voidProcessSearchSortUsingQueryIdL()
voidRunL()
voidSendRequestL()
voidSendTMsvIdWithSortFieldResultsToserverL()
voidSetRequestType(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
enumTRequestQueryType { EMsvReqWithIterator, EMsvReqWithoutIterator }
enumTRequestType { EMsvSearchSortQuery, EMsvQueryId, EMsvSearchSortOnHeaderBody, EMsvGetEntryForIds }
enumTSendResultToServer { 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 > &)

voidCheckIsArrayEmptyL(RArray< TMsvId > &aArray)[private]

Parameters

RArray< TMsvId > & aArray

CheckWhetherSubFolderOptionIsEnabledForSortQueryL(CMsvSearchSortQuery *)

voidCheckWhetherSubFolderOptionIsEnabledForSortQueryL(CMsvSearchSortQuery *aQuery)[private]

Parameters

CMsvSearchSortQuery * aQuery

Complete()

voidComplete()[private]

ConstructL(CMsvSession &)

voidConstructL(CMsvSession &aMsvSession)[private]

Second phase construction

Parameters

CMsvSession & aMsvSession

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

voidConstructSearchSortOperation(CMsvSearchSortQuery *aQuery,
TBoolaMarkQuery,
TRequestStatus &aQueryStatus,
TIntaIterator
)[private]

Parameters

CMsvSearchSortQuery * aQuery
TBool aMarkQuery
TRequestStatus & aQueryStatus
TInt aIterator

ConstructSearchSortOperation(TInt, TRequestStatus &, TInt)

voidConstructSearchSortOperation(TIntaQueryId,
TRequestStatus &aQueryStatus,
TIntaIterator
)[private]

Parameters

TInt aQueryId
TRequestStatus & aQueryStatus
TInt aIterator

DeleteQueryData()

voidDeleteQueryData()[private]

DoCancel()

voidDoCancel()[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)

voidDoComplete(TIntaError)[private]

Parameters

TInt aError

DoPorcessOnEntryResultsL()

voidDoPorcessOnEntryResultsL()[private]

DoPorcessOnNewSearchSortResultsL()

voidDoPorcessOnNewSearchSortResultsL()[private]

DoProcessQuery()

voidDoProcessQuery()[private]

DoRunL()

voidDoRunL()[private]

DoSetActive()

voidDoSetActive()[private]

GetNextResultL(TMsvId &)

IMPORT_C TIntGetNextResultL(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 TIntGetNextResultL(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 TIntGetQueryIdL()

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 TIntGetResultCountL()

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

GetResultsL(RArray< TMsvId > &)

IMPORT_C TIntGetResultsL(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 TIntGetResultsL(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(TMsvMessagePartaMessagePart)[private]

Parameters

TMsvMessagePart aMessagePart

IsMessagePartInHeaderBody(TMsvMessagePart)

TBool IsMessagePartInHeaderBody(TMsvMessagePartaMessagePart)[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()

voidProcessSearchSortOnHeaderBodyL()[private]

ProcessSearchSortQueryL()

voidProcessSearchSortQueryL()[private]

ProcessSearchSortUsingQueryIdL()

voidProcessSearchSortUsingQueryIdL()[private]

ProgressL()

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

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

IMPORT_C voidRequestL(CMsvSearchSortQuery *aQuery,
TBoolaMarkQuery,
TRequestStatus &aQueryStatus,
TIntaIterator = 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 voidRequestL(TIntaQueryId,
TRequestStatus &aQueryStatus,
TIntaIterator = 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()

voidRunL()[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()

voidSendRequestL()[private]

SendTMsvIdWithSortFieldResultsToserverL()

voidSendTMsvIdWithSortFieldResultsToserverL()[private]

SetRequestType(TRequestType, TRequestQueryType)

voidSetRequestType(TRequestTypeaReqType,
TRequestQueryTypeaQueryType
)[private]

Parameters

TRequestType aReqType
TRequestQueryType aQueryType

UnmarkQuery(const TInt)

IMPORT_C TIntUnmarkQuery(const TIntaQueryId)

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]