CMsvFindOperation Class Reference

#include <mw/msvfind.h>

class CMsvFindOperation : public CMsvOperation, public CMsvOperation
Public Member Functions
~CMsvFindOperation()
virtual IMPORT_C const TDesC8 &FinalProgress()
IMPORT_C CMsvFindOperation *FindInChildrenL(CMsvSession &, const TDesC &, TMsvId, TMsvPartList, TRequestStatus &)
IMPORT_C CMsvFindOperation *FindInSelectionL(CMsvSession &, const TDesC &, const CMsvEntrySelection &, TMsvPartList, TRequestStatus &)
const CMsvFindResultSelection &GetFindResult()
virtual IMPORT_C const TDesC8 &ProgressL()
Protected Member Functions
CMsvFindOperation(CMsvSession &, const TDesC &, TMsvPartList, TRequestStatus &)
IMPORT_C voidConstructFindInChildrenL(TMsvId)
IMPORT_C voidConstructFindInSelectionL(const CMsvEntrySelection &)
Inherited Attributes
CActive::iStatus
CMsvOperation::iMsvSession
CMsvOperation::iMtm
CMsvOperation::iObserverRequestStatus
CMsvOperation::iService
Inherited Enumerations
CActive:TPriority
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
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()
CMsvOperation::CMsvOperation(CMsvSession &,TInt,TRequestStatus &)
CMsvOperation::Extension_(TUint,TAny *&,TAny *)
CMsvOperation::Id()const
CMsvOperation::Mtm()const
CMsvOperation::Service()const
CMsvOperation::SystemProgress(TMsvSystemProgress &)
CMsvOperation::~CMsvOperation()

Detailed Description

Encapsulates a text search operation.

The class offers an interface for locating messages which contain specified text. Messages may contain data created for, or received from, any of the transport protocols that are supported by the Messaging Architecture (e.g. Email, FAX and SMS).

Clients create a new instance for each search operation to be performed. They are also responsible for destroying the instance once a search operation is complete.

Clients can derive from this class, typically to implement their own version of the function IsValid().

Constructor & Destructor Documentation

CMsvFindOperation ( CMsvSession &, const TDesC &, TMsvPartList, TRequestStatus & )

IMPORT_CCMsvFindOperation(CMsvSession &aSession,
const TDesC &aTextToFind,
TMsvPartListaPartList,
TRequestStatus &aObserverRequestStatus
)[protected]

Constructor, specifying search parameters.

Parameters
aSessionAn open session with the Message Server
aTextToFindThe text to be found. The length of the text to be found must not be greater than KMsvMaxFindTextLength.
aPartListThe parts of the messages which are to be searched.
aObserverRequestStatusRequest status of an observer to signal when the search is complete.
Panic Codes
MSGS306 aTextToFind is longer than KMsvMaxFindTextLength (debug builds only). In release builds, a USER 11 panic will occur.

~CMsvFindOperation ( )

IMPORT_C~CMsvFindOperation()

Destructor.

Member Function Documentation

ConstructFindInChildrenL ( TMsvId )

IMPORT_C voidConstructFindInChildrenL(TMsvIdaId)[protected]

Second phase constructor, for constructing a search of an entry and of all its children.

Parameters
aIdThe entry Id of the root, folder or service to search

ConstructFindInSelectionL ( const CMsvEntrySelection & )

IMPORT_C voidConstructFindInSelectionL(const CMsvEntrySelection &aSelection)[protected]

Second phase constructor, for constructing a search of a specified selection of messages.

Parameters
aSelectionA selection of messages to search.
Panic Codes
MSGS258 The selection is empty

FinalProgress ( )

IMPORT_C const TDesC8 &FinalProgress()[virtual]

Reimplemented from CMsvOperation::FinalProgress()

Returns progress information after the search operation is complete.

The function returns the same information as ProgressL() but can only be called after the search operation is complete. The function raises a MSGS 285 panic if it is called while the search operation is still in progress.

Return Value
A reference to a descriptor holding progress information. Progress information is encapsulated by a TMsvFindOperationProgress type object and this is returned as a package buffer, a TPckgBuf<TMsvFindOperationProgress> object

FindInChildrenL ( CMsvSession &, const TDesC &, TMsvId, TMsvPartList, TRequestStatus & )

IMPORT_C CMsvFindOperation *FindInChildrenL(CMsvSession &aSession,
const TDesC &aTextToFind,
TMsvIdaParentId,
TMsvPartListaPartList,
TRequestStatus &aObserverRequestStatus
)[static]

Creates a new search operation to search for text within a specified root, folder or service.

Searching for messages is done recursively through all child services and folders. All messages found are searched for text.

Parameters
aSessionAn open session with the Message Server.
aTextToFindThe text to be found. The length of the text to be found must not be greater than KMsvMaxFindTextLength, otherwise the function raises a MSGS 306 panic.
aParentIdThe entry Id of the root, a folder or a service. If this is the Id of the root entry, then all messages stored in the message store on the Symbian OS phone are searched. The function leaves with the KErrArgument code if this is neither the entry Id of the root, nor a folder nor a service.
aPartListThe parts of the messages which are to be searched.
aObserverRequestStatusThe request status object. This is set when the search operation is complete. The is set to: KErrNone, if the search operation completes successfully.
Return Value
Pointer to the new search operation object.

FindInSelectionL ( CMsvSession &, const TDesC &, const CMsvEntrySelection &, TMsvPartList, TRequestStatus & )

IMPORT_C CMsvFindOperation *FindInSelectionL(CMsvSession &aSession,
const TDesC &aTextToFind,
const CMsvEntrySelection &aSelection,
TMsvPartListaPartList,
TRequestStatus &aObserverRequestStatus
)[static]

Creates a new search operation to search for text within a specified selection of messages.

The function leaves with the KErrArgument code if the first entry in the selection is not recognised as a message.

Parameters
aSessionAn open session with the Message Server.
aTextToFindThe text to be found. The length of the text to be found must not be greater than KMsvMaxFindTextLength, otherwise the function raises a MSGS 306 panic.
aSelectionA selection of messages to search. The function raises a MSGS 258 panic if the selection is empty (i.e. there are zero messages in the selection).
aPartListThe parts of the messages which are to be searched.
aObserverRequestStatusThe request status object. This is set when the search operation is complete. The is set to: KErrNone, if the search operation completes successfully. KErrArgument, if any of the entries in the selection, apart from the first, cannot be recognised as a message.
Return Value
Pointer to the new search operation object.

GetFindResult ( )

const CMsvFindResultSelection &GetFindResult()const [inline]

ProgressL ( )

IMPORT_C const TDesC8 &ProgressL()[virtual]

Reimplemented from CMsvOperation::ProgressL()

Returns progress information.

Progress information supplies sufficient data to drive a progress gauge for the text search operation and also identifies the message currently being searched. It does not provide any information about the search progress within a message.

Return Value
A reference to a descriptor holding progress information. Progress information is encapsulated by a TMsvFindOperationProgress type object and this is returned as a package buffer, a TPckgBuf<TMsvFindOperationProgress> object.