CMsvSearchSortQuery Class Reference

class CMsvSearchSortQuery : public CBase

Class: CMsvSearchSortQuery

CMsvSearchSortQuery is used to create Searchsort Query

Inherits from

Public Member Functions
~CMsvSearchSortQuery()
IMPORT_C voidAddSearchOptionL(TMsvMessagePart, const TDesC &, TMsvRelationOp)
IMPORT_C voidAddSearchOptionL(TMsvMessagePart, const TInt, TMsvRelationOp)
IMPORT_C voidAddSearchOptionL(TMsvMessagePart, TBool)
IMPORT_C voidAddSortOptionL(TMsvMessagePart, TMsvSortOrder)
IMPORT_C CMsvSearchSortQuery *NewL()
IMPORT_C CMsvSearchSortQuery *NewLC()
IMPORT_C voidSetCaseSensitiveOption(TBool)
IMPORT_C voidSetParentId(const TMsvId)
IMPORT_C voidSetResultType(TMsvSearchSortResultType)
IMPORT_C voidSetSubFolderSearch(TBool)
IMPORT_C voidSetWholeWord(TBool)
IMPORT_C voidSetWildCardSearch(TBool)
Private Member Functions
CMsvSearchSortQuery()
voidConstructL()
TInt GetMaxQuerySize()
TMsvMessagePart GetMessagePart(TInt)
TMsvMessagePart GetMessagePart()
TMsvRelationOp GetRelationOp(TInt)
TMsvSearchSortResultType GetResultType()
TBool IsCaseSensitive()
TBool IsSearchQuery()
TBool IsSubFolderSearch()
TBool IsWholeWord()
TBool IsWildCardSearch()
TBool ValidateMessagePartAgainstEMsvEqualOperator(TMsvMessagePart)
TBool ValidateMessagePartAgainstRelationOp(TMsvRelationOp)
TInt ValidateQueryString(TMsvMessagePart, const TDesC &, TMsvRelationOp)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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 Attributes
TBool iCaseSensitive
TInt iCountMultilevelSort
TBool iExplicitSort
TBool iIsSearchQuery
TMsvId iParentId
TInt iQueryCount
TInt iQueryId
TMsvQueryTable *iQueryTable
TMsvSearchSortResultType iSearchSortResultType
TMsvMessagePart iSortOnMessagePart
TMsvSortOrder iSortOrder
TBool iSubFolderSearch
TBool iWholeWord
TBool iWildCardCharacter

Constructor & Destructor Documentation

CMsvSearchSortQuery()

CMsvSearchSortQuery()[private]

Constructor

~CMsvSearchSortQuery()

IMPORT_C~CMsvSearchSortQuery()

Destructor.

Member Functions Documentation

AddSearchOptionL(TMsvMessagePart, const TDesC &, TMsvRelationOp)

IMPORT_C voidAddSearchOptionL(TMsvMessagePartaMsgPart,
const TDesC &aQueryDesValue,
TMsvRelationOpaRelOp
)

Adds the search options to the search-sort query. This function is used when the message part requires descriptor value during search-sort operation.

leave
KErrNone - Query is added successfully to search-sort query
KErrArgument - An invalid value is passed for a particular message part

KErrMsvInvalidOperator - An invalid operation is being performed on a particular message part

KErrMsvQueryMaxLimit - An addition of search-sort operation has lead to a condition where the query options have exceeded the maximum number of search-sort options supported by messaging framework. The maximum search options that can be added to a search-sort query is five and the maximum sort option that can be can be added is one

KErrQueryTooBig - The search-sort query is too big to be executed. This could be due to a bigger value for the search-sort option provided as part of the query. The query value added to a particular option is greater then KMsvMaxFindTextLength( = 300)

Parameters

TMsvMessagePart aMsgPartA message part on which search operation has to be performed for all the messages under a particular folder entry
const TDesC & aQueryDesValueThe corresponding value of the message part that needs to be searched
TMsvRelationOp aRelOpAn enumeration corresponding to a relational operator used against a particular message part for all the messages in a particular folder during the search operation

AddSearchOptionL(TMsvMessagePart, const TInt, TMsvRelationOp)

IMPORT_C voidAddSearchOptionL(TMsvMessagePartaMsgPart,
const TIntaQueryIntValue,
TMsvRelationOpaRelOp
)

Adds the search options to the search-sort query. This function is used when the message part requires integer value during search-sort operation

leave
KErrNone - Query is added successfully to search-sort query
KErrArgument - An invalid value is passed for a particular message part

KErrMsvInvalidOperator - An invalid operation is being performed on a particular message part

KErrMsvQueryMaxLimit - An addition of search-sort operation has lead to a condition where the query options have exceeded the maximum number of search-sort options supported by messaging framework. The maximum search options that can be added to a search-sort query is five and the maximum sort option that can be can be added is one

Parameters

TMsvMessagePart aMsgPartA message part on which search operation has to be performed for all the messages under a particular folder entry
const TInt aQueryIntValue
TMsvRelationOp aRelOpAn enumeration corresponding to a relational operator used against a particular message part for all the messages in a particular folder during the search operation

AddSearchOptionL(TMsvMessagePart, TBool)

IMPORT_C voidAddSearchOptionL(TMsvMessagePartaMsgPart,
TBoolaMessagePartFlagStatus
)

Adds the search options to the search-sort query. This function is suitable when the message part value to be searched is a flag or a message status.

leave
KErrNone - Query is added successfully to search-sort query
KErrArgument - An invalid value is passed for a particular message part

KErrMsvInvalidOperator - An invalid operation is being performed on a particular message part

KErrMsvQueryMaxLimit - An addition of search-sort operation has lead to a condition where the query options have exceeded the maximum number of search-sort options supported by messaging framework. The maximum search options that can be added to a search-sort query is five and the maximum sort option that can be can be added is one

Parameters

TMsvMessagePart aMsgPartA message part on which search operation has to be performed for all the messages under a particular folder entry
TBool aMessagePartFlagStatus

AddSortOptionL(TMsvMessagePart, TMsvSortOrder)

IMPORT_C voidAddSortOptionL(TMsvMessagePartaMessagePart,
TMsvSortOrderaSortOder
)

Adds sort options to the search-sort query, to enable sorting in ascending or descending order based on the message part added to the query

leave
KErrNone - Query is added successfully to search-sort query KErrNotSupported - for multilevel sort

Parameters

TMsvMessagePart aMessagePart
TMsvSortOrder aSortOder

ConstructL()

voidConstructL()[private]
Second phase construction, allocating memory for query table.
leave
KErrNoMemory A memory allocation failed

GetMaxQuerySize()

TInt GetMaxQuerySize()[private]

get the size of Query.

GetMessagePart(TInt)

TMsvMessagePart GetMessagePart(TIntaIndex)[private]

get the message part from Query structure.

Parameters

TInt aIndex

GetMessagePart()

TMsvMessagePart GetMessagePart()[private]

get the sort field from the Query.

GetRelationOp(TInt)

TMsvRelationOp GetRelationOp(TIntaIndex)[private]

Get Relation operator

Parameters

TInt aIndex

GetResultType()

TMsvSearchSortResultType GetResultType()[private]

Get search sort result type set by client.

IsCaseSensitive()

TBool IsCaseSensitive()[private]

Function to check whether case sensitivesearch search enabled.

IsSearchQuery()

TBool IsSearchQuery()[private]

Function to validate, is this search Query.

IsSubFolderSearch()

TBool IsSubFolderSearch()[private]

Function to check whether sub folder search enabled.

IsWholeWord()

TBool IsWholeWord()[private]

Function to check whether whole word search enabled or not.

IsWildCardSearch()

TBool IsWildCardSearch()[private]

Function to check whether wildcard character search enabled.

NewL()

IMPORT_C CMsvSearchSortQuery *NewL()[static]
Factory function which returns a pointer of CMsvSearchSortQuery to create a search-sort query.
leave
KErrNoMemory A memory allocation failed

NewLC()

IMPORT_C CMsvSearchSortQuery *NewLC()[static]
Factory function which returns a pointer of CMsvSearchSortQuery to create a search-sort query.
leave
KErrNoMemory A memory allocation failed

SetCaseSensitiveOption(TBool)

IMPORT_C voidSetCaseSensitiveOption(TBoolaCaseSensitive)

Set Case Sensitive search option.

Parameters

TBool aCaseSensitive

SetParentId(const TMsvId)

IMPORT_C voidSetParentId(const TMsvIdaParentId)

set aParentId. search and/or sort will be done this aParentId.

Parameters

const TMsvId aParentIdSearch and/or sort operation can be performed on a specified root, folder or service.

SetResultType(TMsvSearchSortResultType)

IMPORT_C voidSetResultType(TMsvSearchSortResultTypeaResultType)

Client expects search sort results as TMsvId or TMsvEntry

Parameters

TMsvSearchSortResultType aResultTypeset result type as TMsvId or TMsvEntry

SetSubFolderSearch(TBool)

IMPORT_C voidSetSubFolderSearch(TBoolaSubFolderSearch)

Enable subfolder search.

Parameters

TBool aSubFolderSearch

SetWholeWord(TBool)

IMPORT_C voidSetWholeWord(TBoolaWholeWord)

Set Whole word search option.

Parameters

TBool aWholeWord

SetWildCardSearch(TBool)

IMPORT_C voidSetWildCardSearch(TBoolaWildCard)

Enable wild card character search.

Parameters

TBool aWildCard

ValidateMessagePartAgainstEMsvEqualOperator(TMsvMessagePart)

TBool ValidateMessagePartAgainstEMsvEqualOperator(TMsvMessagePartaMessagePart)[private]

Parameters

TMsvMessagePart aMessagePart

ValidateMessagePartAgainstRelationOp(TMsvRelationOp)

TBool ValidateMessagePartAgainstRelationOp(TMsvRelationOpaRelationOp)[private]

Parameters

TMsvRelationOp aRelationOp

ValidateQueryString(TMsvMessagePart, const TDesC &, TMsvRelationOp)

TInt ValidateQueryString(TMsvMessagePartaMsgPart,
const TDesC &aQueryString,
TMsvRelationOpaRelOp
)[private]

Validate the query option sent by AddSearchOptionL ()

Parameters

TMsvMessagePart aMsgPartSearch needs to be on this TMessagePart
const TDesC & aQueryStringThe text to be found.
TMsvRelationOp aRelOpTMsgRelationOp enum's needs to used along with TMessagePart to create the query string

Member Data Documentation

TBool iCaseSensitive

TBool iCaseSensitive[private]

TInt iCountMultilevelSort

TInt iCountMultilevelSort[private]

TBool iExplicitSort

TBool iExplicitSort[private]

TBool iIsSearchQuery

TBool iIsSearchQuery[private]

TMsvId iParentId

TMsvId iParentId[private]

TInt iQueryCount

TInt iQueryCount[private]

TInt iQueryId

TInt iQueryId[private]

TMsvQueryTable * iQueryTable

TMsvQueryTable *iQueryTable[private]

TMsvSearchSortResultType iSearchSortResultType

TMsvSearchSortResultType iSearchSortResultType[private]

TMsvMessagePart iSortOnMessagePart

TMsvMessagePart iSortOnMessagePart[private]

TMsvSortOrder iSortOrder

TMsvSortOrder iSortOrder[private]

TBool iSubFolderSearch

TBool iSubFolderSearch[private]

TBool iWholeWord

TBool iWholeWord[private]

TBool iWildCardCharacter

TBool iWildCardCharacter[private]