diff -r 666f914201fb -r 2fe1408b6811 epoc32/include/msvftext.h --- a/epoc32/include/msvftext.h Tue Nov 24 13:55:44 2009 +0000 +++ b/epoc32/include/msvftext.h Tue Mar 16 16:12:26 2010 +0000 @@ -1,1 +1,79 @@ -msvftext.h +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members +// which accompanies this distribution, and is available +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef __MSVFTEXT_H__ +#define __MSVFTEXT_H__ + +#include + +#include +#include +#include + +class CRichText; + +class CMsvFindText : public CMsgActive +/** 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. +@publishedAll +@released +*/ + { +public: + IMPORT_C static CMsvFindText* NewLC(TInt aPriority = EPriorityStandard); + IMPORT_C static CMsvFindText* NewL(TInt aPriority = EPriorityStandard); + IMPORT_C ~CMsvFindText(); + // + IMPORT_C void FindTextL(const TDesC& aFind, const TDesC& aSource, TMsvPartList aFlags, TRequestStatus& aStatus); + IMPORT_C void FindRichTextL(const TDesC& aFind, const CRichText& aSource, TMsvPartList aFlags, TRequestStatus& aStatus); + // + IMPORT_C TBool FindTextL(const TDesC& aFind, const TDesC& aSource, TMsvPartList aFlags); + IMPORT_C TBool FindRichTextL(const TDesC& aFind, const CRichText& aSource, TMsvPartList aFlags); + // + inline TBool FoundText() const; + // +private: + CMsvFindText(TInt aPriority); + // + void InitialiseL(const TDesC& aFind, const TDesC* aPlainSource, const CRichText* aRichSource, TMsvPartList aFlags); + void DoFindAsyncL(TRequestStatus& aStatus); + void DoComplete(TInt&); + TBool DoFindSyncL(); + TBool DoFindStepL(); + TBool DoFindTextL(); + void DoRunL(); + void Check(); + // +private: + HBufC* iBuf; + HBufC* iFind; + TInt iSourcePos; + TInt iMaxRead; + TInt iSourceLen; + const CRichText* iRichText; + const TDesC* iPlainText; + TMsvPartList iFlags; + TChar iPreChar; + TChar iPostChar; + TBool iFoundText; + }; + +#include + +#endif