Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: msvftext.h
Link against: msgs.lib

Class CMsvFindText

CMsvFindText

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

CActiveThe core class of the active object abstraction
CBaseBase class for all classes to be instantiated on the heap
CMsgActiveBase class used in the derivation of CMsvFindText
CMsvFindTextA utility class which searches through given plain text or rich text for a specified text string

Defined in CMsvFindText:
FindRichTextL(), FindTextL(), FoundText(), NewL(), NewLC()

Inherited from CActive:
Cancel(), Deque(), DoCancel(), EPriorityHigh, EPriorityIdle, EPriorityLow, EPriorityStandard, EPriorityUserInput, IsActive(), IsAdded(), Priority(), RunError(), RunL(), SetActive(), SetPriority(), TPriority, iStatus

Inherited from CBase:
operator new()


Construction


NewL()

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


NewLC()

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

[Top]


Find plain text


FindTextL()

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

Description

Searches for a specified text string within the given plain text.

The search can be done synchronously or asynchronously.

Parameters

const TDesC& aFind

The text string to be found

const TDesC& aSource

The plain text to be searched

TMsvPartList aFlags

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

TRequestStatus& aStatus

The request status object. This is set when the search operation is complete. This argument only applies to the asynchronous variant.

Return value

TBool

This is returned by the synchronous variant: True, if there is a match. False, if no match can be found.For the asynchronous variant, use FoundText() for returning the result of the search.

[Top]


Find rich text


FindRichTextL()

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 TDesC& aFind

The text string to be found

const CRichText& aSource

The rich text to be searched

TMsvPartList aFlags

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

TRequestStatus& aStatus

The request status object. This is set when the search operation is complete. This argument only applies to the asynchronous variant.

Return value

TBool

This is returned by the synchronous variant: True, if there is a match. False, if no match can be found.For the asynchronous variant, use FoundText() for returning the result of the search.


FindRichTextL()

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

Description

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

Parameters

TInt aPriority

The priority of this active object.

Return value

CMsvFindText*

Pointer to the new find text utility object

[Top]


Result of asynchronous search


FoundText()

TBool FoundText() const;

Description

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

Return value

TBool

True, if there is a match. False, if no match can be found.