Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <MSVFTEXT.H>
Link against: msgs.lib
Link against: msgs_autoshutdown.lib

Class CMsvFindText

class CMsvFindText : public CMsgActive;

Description

A utility class which searches through given plain text or rich text for a specified text string.

The class is an active object and searching can be done synchronously or asynchronously. An instance of this class can be re-used to perform multiple searches for text.

Derivation

Members

Defined in CMsvFindText:


Construction and destruction


NewLC(TInt)

IMPORT_C static CMsvFindText* NewLC(TInt aPriority=EPriorityStandard);

Description

Creates a new find text utility object with the specified priority and puts a pointer to the new object onto the cleanup stack.

The function leaves if the object cannot be created.

Parameters

TInt aPriority

The priority of this active object.

Return value

CMsvFindText *

Pointer to the new find text utility object


NewL(TInt)

IMPORT_C static CMsvFindText* NewL(TInt aPriority=EPriorityStandard);

Description

Creates a new find text utility object with the specified priority.

The function leaves if the object cannot be created.

Parameters

TInt aPriority

The priority of this active object.

Return value

CMsvFindText *

Pointer to the new find text utility object


~CMsvFindText()

IMPORT_C ~CMsvFindText();

Description

Destructor.

Any outstanding search is cancelled.

[Top]


Member functions


FindTextL(const TDesC &,const TDesC &,TMsvPartList,TRequestStatus &)

IMPORT_C void FindTextL(const TDesC &aFind, const TDesC &aSource, TMsvPartList aFlags, TRequestStatus &aStatus);

Description

Performs an asynchronous search for a text string within another text string.

Parameters

const TDesC16 &aFind

The text string to search for.

const TDesC16 &aSource

The plain text to be searched.

TMsvPartList aFlags

A set of flags which modify the way the search works: KMsvFindCaseSensitive means the search is successful only if there is an exact case match for the text. KMsvFindWholeWord means the search is successful only if the matching text in aSource is not delimited by alphanumeric characters.

TRequestStatus &aStatus

The request status object, which is set when the search operation is complete. Use CMsvFindText::FoundText()const to return the result of the search.


FindRichTextL(const TDesC &,const CRichText &,TMsvPartList,TRequestStatus &)

IMPORT_C void FindRichTextL(const TDesC &aFind, const CRichText &aSource, TMsvPartList aFlags, TRequestStatus &aStatus);

Description

Searches for a specified text string within the given rich text asynchronously.

Parameters

const TDesC16 &aFind

The text string to search for.

const CRichText &aSource

The rich text to be searched.

TMsvPartList aFlags

A set of flags which modify the way the search works: KMsvFindCaseSensitive means the search is successful only if there is an exact case match for the text. KMsvFindWholeWord means the search is successful only if the matching text in aSource is not delimited by alphanumeric characters.

TRequestStatus &aStatus

The request status object, which is set when the search operation is complete. Use CMsvFindText::FoundText()const to return the result of the search.


FindTextL(const TDesC &,const TDesC &,TMsvPartList)

IMPORT_C TBool FindTextL(const TDesC &aFind, const TDesC &aSource, TMsvPartList aFlags);

Description

Performs a synchronous search for a text string within another text string.

Parameters

const TDesC16 &aFind

The text string to search for.

const TDesC16 &aSource

The plain text to be searched.

TMsvPartList aFlags

A set of flags which modify the way the search works: KMsvFindCaseSensitive means the search is successful only if there is an exact case match for the text. KMsvFindWholeWord means the search is successful only if the matching text in aSource is not delimited by alphanumeric characters.

Return value

TBool

ETrue if there is a match, otherwise EFalse.


FindRichTextL(const TDesC &,const CRichText &,TMsvPartList)

IMPORT_C TBool FindRichTextL(const TDesC &aFind, const CRichText &aSource, TMsvPartList aFlags);

Description

Searches for a specified text string within the given rich text synchronously.

Parameters

const TDesC16 &aFind

The text string to search for.

const CRichText &aSource

The rich text to be searched.

TMsvPartList aFlags

A set of flags which modify the way the search works: KMsvFindCaseSensitive means the search is successful only if there is an exact case match for the text. KMsvFindWholeWord means the search is successful only if the matching text in aSource is not delimited by alphanumeric characters.

Return value

TBool

ETrue if there is a match, otherwise EFalse.


FoundText()const

inline TBool FoundText() const;

Description

Returns the result of the asynchronous search for a matching text string.

Return value

TBool

ETrue if there is a match, otherwise EFalse.


DoComplete(TInt &)

private: virtual void DoComplete(TInt &);

Description

Parameters

TInt &


DoRunL()

private: virtual void DoRunL();

Description