CMsvSearchsortOpOnHeaderBody Class Reference

class CMsvSearchsortOpOnHeaderBody : public CActive

CMsvSearchsortOpOnHeaderBody is used to perform the search sort operation on Message header, body and attachment

Inherits from

Public Member Functions
~CMsvSearchsortOpOnHeaderBody ()
IMPORT_C void DoGetEntryForAllIdL (const RArray < TMsvId > &, TRequestStatus &)
IMPORT_C void GetResultAsInvalidTMsvIdL ( RArray < TMsvId > &)
IMPORT_C void GetResultAsTMsvIdL ( RArray < TMsvId > &)
IMPORT_C void GetResultAsTMsvIdWithSortFieldL ( RArray < TMsvIdWithSortField > &)
IMPORT_C void GetResultAsTmsvEntryL ( RArray < TMsvEntry > &)
IMPORT_C CMsvSearchsortOpOnHeaderBody * NewL ( CMsvSession &, TInt )
IMPORT_C void SearchSortOnHeaderBodyL ( CMsvSearchSortQuery *, RArray < TMsvId >, TBool , TRequestStatus &)
Private Member Functions
CMsvSearchsortOpOnHeaderBody ( CMsvSession &, TInt )
TBool AddSearchFlag ( TMsvPartList , TMsvPartList &)
TBool AddSortFlag ( TMsvPartList )
void Complete ( TInt )
void CompleteSelf ()
void ConstructL ()
TBool DoAttachmentTypeSearchL ( TInt )
void DoCancel ()
void DoCopySortDataL ( CBaseMtm *)
void DoRunL ()
void FindInHeaderBodyL ()
void InitializePartList ()
TBool IsOnlySortOperation ()
void ProcessQuery ( CMsvSearchSortQuery *, const RArray < TMsvId >, TBool , TRequestStatus &)
void RemoveSearchFlag ( TMsvPartList , TMsvPartList &)
void RunL ()
void StartL ()
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 TRequestType { EMsvSearchSortOnHeaderBody , EMsvGetEntryForIds }
Inherited Enumerations
CActive:TPriority
Private Attributes
CMsvEntry * iCMsvEntry
CClientMtmRegistry * iClientRegistry
TMsvEnhanceSearchSortUtil iEnhanceSearch
TMsvEntry iEntry
RArray < TMsvEntry > iEntryArray
RArray < TMsvId > iIdArray
TInt iIdToSearch
RArray < TMsvId > iInvalidIds
CArrayPtrFlat < CBaseMtm > * iMtmArray
TMsvPartList iPartList
CMsvSearchSortQuery * iQuery
TInt iQueryCount
TRequestStatus * iRequestStatus
TRequestType iRequestType
RArray < TMsvId > iResultIds
RArray < TMsvIdWithSortField > iSelectionArray
CMsvSession & iSession
TBool iSortOnIndexEntry
TBuf < KMsvMaxSearchTextLength > iTextToFind
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CMsvSearchsortOpOnHeaderBody(CMsvSession &, TInt)

CMsvSearchsortOpOnHeaderBody ( CMsvSession & aSession,
TInt aPriority
) [private]

Parameters

CMsvSession & aSession
TInt aPriority

~CMsvSearchsortOpOnHeaderBody()

IMPORT_C ~CMsvSearchsortOpOnHeaderBody ( )

Destructor

Member Functions Documentation

AddSearchFlag(TMsvPartList, TMsvPartList &)

TBool AddSearchFlag ( TMsvPartList aSearchPartList,
TMsvPartList & aPartList
) [private]

AddSearchFlag() Adds the search specific flag specifying the field on which the search operation is to be performed.

Parameters

TMsvPartList aSearchPartList
TMsvPartList & aPartList

AddSortFlag(TMsvPartList)

TBool AddSortFlag ( TMsvPartList aSortPartList ) [private]

AddSortFlag() Adds the sort specific flag specifying the field on which the result would be sorted.

Parameters

TMsvPartList aSortPartList

Complete(TInt)

void Complete ( TInt aStatus ) [private]

Parameters

TInt aStatus

CompleteSelf()

void CompleteSelf ( ) [private]

ConstructL()

void ConstructL ( ) [private]

Second phase construction

DoAttachmentTypeSearchL(TInt)

TBool DoAttachmentTypeSearchL ( TInt aIndex ) [private]

Parameters

TInt aIndex

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

DoCopySortDataL(CBaseMtm *)

void DoCopySortDataL ( CBaseMtm * aBaseMtm ) [private]

DoCopySortDataL() copies the sort data. This is obtained by calling the basemtm getextension method.

Parameters

CBaseMtm * aBaseMtm

DoGetEntryForAllIdL(const RArray< TMsvId > &, TRequestStatus &)

IMPORT_C void DoGetEntryForAllIdL ( const RArray < TMsvId > & aIdArray,
TRequestStatus & aStatus
)

DoGetEntryForAllIdL() Gets TMsvEntry for all Id's in RArray asynchronously

Parameters

const RArray < TMsvId > & aIdArray An array holding list of id's
TRequestStatus & aStatus Request status

DoRunL()

void DoRunL ( ) [private]

FindInHeaderBodyL()

void FindInHeaderBodyL ( ) [private]

FindInHeaderBodyL() This function performs the actual search, sort or search-sort operation. Steps: 1) Initializes partlist flags. These flags are used in the client mtm code to identify different message parts and other information. 2) Checks mtm type for each TMsvId specified in the array. If the mtm is found, continues with the operation else registers the particular mtm type and continues. 3) Load message. This sets the context to the message 4) If it is a search operation, than it matches each query option specified in the query table If all the options are succesfully matched, adds it to resultant list 5) If sorting is specified than copies the sort data only when the last of the query table condition is successfully matched 6) In case of sorting, call the pure virtual Find method to copy only the sort data. 7) In case of search by attachment types, restores the attachment manager and identifies the attachment.

GetResultAsInvalidTMsvIdL(RArray< TMsvId > &)

IMPORT_C void GetResultAsInvalidTMsvIdL ( RArray < TMsvId > & aInValidIdArray )

GetResultAsInvalidTMsvIdL() Returns a list of TMsvIds that do not satisfy the search criteria and are not part of the final result set

Parameters

RArray < TMsvId > & aInValidIdArray An array holding list of invalid TMsvIds

GetResultAsTMsvIdL(RArray< TMsvId > &)

IMPORT_C void GetResultAsTMsvIdL ( RArray < TMsvId > & aIdArray )

GetResultAsTMsvIdL() Returns a list of TMsvIds and the Sort field data

Parameters

RArray < TMsvId > & aIdArray

GetResultAsTMsvIdWithSortFieldL(RArray< TMsvIdWithSortField > &)

IMPORT_C void GetResultAsTMsvIdWithSortFieldL ( RArray < TMsvIdWithSortField > & aArrayOfIdWithSortField )

GetResultAsTMsvIdWithSortFieldL() Returns a list of TMsvIds and the Sort field data

Parameters

RArray < TMsvIdWithSortField > & aArrayOfIdWithSortField An array holding list of invalid TMsvIds and sort string

GetResultAsTmsvEntryL(RArray< TMsvEntry > &)

IMPORT_C void GetResultAsTmsvEntryL ( RArray < TMsvEntry > & aEntryArray )

Parameters

RArray < TMsvEntry > & aEntryArray

InitializePartList()

void InitializePartList ( ) [private]

InitializePartList() Adds flags to parts variable before performing the actual operation. This method gets called once and the flag value persists until all the TMsvIds are exhausted.

IsOnlySortOperation()

TBool IsOnlySortOperation ( ) [private]

NewL(CMsvSession &, TInt)

IMPORT_C CMsvSearchsortOpOnHeaderBody * NewL ( CMsvSession & aSession,
TInt aPriority
) [static]
Allocates and constructs a CMsvSearchsortOpOnHeaderBody object.
leave
one of the leave code if leave occurs in creation of object or clinet reigistry,

Parameters

CMsvSession & aSession
TInt aPriority

ProcessQuery(CMsvSearchSortQuery *, const RArray< TMsvId >, TBool, TRequestStatus &)

void ProcessQuery ( CMsvSearchSortQuery * aQuery,
const RArray < TMsvId > aIdArray,
TBool aSortOnIndexEntry,
TRequestStatus & aStatus
) [private]

ProcessQuery Initialzes the search sort operation. This copies the array of ids and initialzes different parameters for the operartion

Parameters

CMsvSearchSortQuery * aQuery
const RArray < TMsvId > aIdArray
TBool aSortOnIndexEntry
TRequestStatus & aStatus

RemoveSearchFlag(TMsvPartList, TMsvPartList &)

void RemoveSearchFlag ( TMsvPartList aSearchPartList,
TMsvPartList & aPartList
) [private]

RemoveSearchFlag() Removes the search partlist and resets that bit. The next query option could be on different field.

Parameters

TMsvPartList aSearchPartList
TMsvPartList & aPartList

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

SearchSortOnHeaderBodyL(CMsvSearchSortQuery *, RArray< TMsvId >, TBool, TRequestStatus &)

IMPORT_C void SearchSortOnHeaderBodyL ( CMsvSearchSortQuery * aQuery,
RArray < TMsvId > aSourceArray,
TBool aSortOnIndexEntry,
TRequestStatus & aStatus
)

SearchSortOnHeaderBodyL Initialzes the search sort operation. This copies the array of ids and initialzes different parameters for the operartion

Parameters

CMsvSearchSortQuery * aQuery
RArray < TMsvId > aSourceArray
TBool aSortOnIndexEntry
TRequestStatus & aStatus

StartL()

void StartL ( ) [private]

Member Enumerations Documentation

Enum TRequestType

Enumerators

EMsvSearchSortOnHeaderBody
EMsvGetEntryForIds

Member Data Documentation

CMsvEntry * iCMsvEntry

CMsvEntry * iCMsvEntry [private]

CClientMtmRegistry * iClientRegistry

CClientMtmRegistry * iClientRegistry [private]

TMsvEnhanceSearchSortUtil iEnhanceSearch

TMsvEnhanceSearchSortUtil iEnhanceSearch [private]

TMsvEntry iEntry

TMsvEntry iEntry [private]

RArray< TMsvEntry > iEntryArray

RArray < TMsvEntry > iEntryArray [private]

RArray< TMsvId > iIdArray

RArray < TMsvId > iIdArray [private]

TInt iIdToSearch

TInt iIdToSearch [private]

RArray< TMsvId > iInvalidIds

RArray < TMsvId > iInvalidIds [private]

CArrayPtrFlat< CBaseMtm > * iMtmArray

CArrayPtrFlat < CBaseMtm > * iMtmArray [private]

TMsvPartList iPartList

TMsvPartList iPartList [private]

CMsvSearchSortQuery * iQuery

CMsvSearchSortQuery * iQuery [private]

TInt iQueryCount

TInt iQueryCount [private]

TRequestStatus * iRequestStatus

TRequestStatus * iRequestStatus [private]

TRequestType iRequestType

TRequestType iRequestType [private]

RArray< TMsvId > iResultIds

RArray < TMsvId > iResultIds [private]

RArray< TMsvIdWithSortField > iSelectionArray

RArray < TMsvIdWithSortField > iSelectionArray [private]

CMsvSession & iSession

CMsvSession & iSession [private]

TBool iSortOnIndexEntry

TBool iSortOnIndexEntry [private]

TBuf< KMsvMaxSearchTextLength > iTextToFind

TBuf < KMsvMaxSearchTextLength > iTextToFind [private]