CMsvSearchSortQuery Class Reference

class CMsvSearchSortQuery : public CBase

Class: CMsvSearchSortQuery

CMsvSearchSortQuery is used to create Searchsort Query

Inherits from

Public Member Functions
~CMsvSearchSortQuery ()
IMPORT_C void AddSearchOptionL ( TMsvMessagePart , const TDesC &, TMsvRelationOp )
IMPORT_C void AddSearchOptionL ( TMsvMessagePart , const TInt , TMsvRelationOp )
IMPORT_C void AddSearchOptionL ( TMsvMessagePart , TBool )
IMPORT_C void AddSortOptionL ( TMsvMessagePart , TMsvSortOrder )
IMPORT_C CMsvSearchSortQuery * NewL ()
IMPORT_C CMsvSearchSortQuery * NewLC ()
IMPORT_C void SetCaseSensitiveOption ( TBool )
IMPORT_C void SetParentId (const TMsvId )
IMPORT_C void SetResultType ( TMsvSearchSortResultType )
IMPORT_C void SetSubFolderSearch ( TBool )
IMPORT_C void SetWholeWord ( TBool )
IMPORT_C void SetWildCardSearch ( TBool )
Private Member Functions
CMsvSearchSortQuery ()
void ConstructL ()
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 void AddSearchOptionL ( TMsvMessagePart aMsgPart,
const TDesC & aQueryDesValue,
TMsvRelationOp aRelOp
)

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 aMsgPart A message part on which search operation has to be performed for all the messages under a particular folder entry
const TDesC & aQueryDesValue The corresponding value of the message part that needs to be searched
TMsvRelationOp aRelOp An 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 void AddSearchOptionL ( TMsvMessagePart aMsgPart,
const TInt aQueryIntValue,
TMsvRelationOp aRelOp
)

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 aMsgPart A message part on which search operation has to be performed for all the messages under a particular folder entry
const TInt aQueryIntValue
TMsvRelationOp aRelOp An 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 void AddSearchOptionL ( TMsvMessagePart aMsgPart,
TBool aMessagePartFlagStatus
)

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 aMsgPart A 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 void AddSortOptionL ( TMsvMessagePart aMessagePart,
TMsvSortOrder aSortOder
)

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

void ConstructL ( ) [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 ( TInt aIndex ) [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 ( TInt aIndex ) [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 void SetCaseSensitiveOption ( TBool aCaseSensitive )

Set Case Sensitive search option.

Parameters

TBool aCaseSensitive

SetParentId(const TMsvId)

IMPORT_C void SetParentId ( const TMsvId aParentId )

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

Parameters

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

SetResultType(TMsvSearchSortResultType)

IMPORT_C void SetResultType ( TMsvSearchSortResultType aResultType )

Client expects search sort results as TMsvId or TMsvEntry

Parameters

TMsvSearchSortResultType aResultType set result type as TMsvId or TMsvEntry

SetSubFolderSearch(TBool)

IMPORT_C void SetSubFolderSearch ( TBool aSubFolderSearch )

Enable subfolder search.

Parameters

TBool aSubFolderSearch

SetWholeWord(TBool)

IMPORT_C void SetWholeWord ( TBool aWholeWord )

Set Whole word search option.

Parameters

TBool aWholeWord

SetWildCardSearch(TBool)

IMPORT_C void SetWildCardSearch ( TBool aWildCard )

Enable wild card character search.

Parameters

TBool aWildCard

ValidateMessagePartAgainstEMsvEqualOperator(TMsvMessagePart)

TBool ValidateMessagePartAgainstEMsvEqualOperator ( TMsvMessagePart aMessagePart ) [private]

Parameters

TMsvMessagePart aMessagePart

ValidateMessagePartAgainstRelationOp(TMsvRelationOp)

TBool ValidateMessagePartAgainstRelationOp ( TMsvRelationOp aRelationOp ) [private]

Parameters

TMsvRelationOp aRelationOp

ValidateQueryString(TMsvMessagePart, const TDesC &, TMsvRelationOp)

TInt ValidateQueryString ( TMsvMessagePart aMsgPart,
const TDesC & aQueryString,
TMsvRelationOp aRelOp
) [private]

Validate the query option sent by AddSearchOptionL ()

Parameters

TMsvMessagePart aMsgPart Search needs to be on this TMessagePart
const TDesC & aQueryString The text to be found.
TMsvRelationOp aRelOp TMsgRelationOp 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]