williamr@2
|
1 |
// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __MSVFTEXT_H__
|
williamr@2
|
17 |
#define __MSVFTEXT_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32base.h>
|
williamr@2
|
20 |
|
williamr@2
|
21 |
#include <mentact.h>
|
williamr@2
|
22 |
#include <mtclbase.h>
|
williamr@2
|
23 |
#include <mtmdef.h>
|
williamr@2
|
24 |
|
williamr@2
|
25 |
class CRichText;
|
williamr@2
|
26 |
|
williamr@2
|
27 |
class CMsvFindText : public CMsgActive
|
williamr@2
|
28 |
/** A utility class which searches through given plain text or rich text for a
|
williamr@2
|
29 |
specified text string.
|
williamr@2
|
30 |
|
williamr@2
|
31 |
The class is an active object and searching can be done synchronously or asynchronously.
|
williamr@2
|
32 |
An instance of this class can be re-used to perform multiple searches for
|
williamr@2
|
33 |
text.
|
williamr@2
|
34 |
@publishedAll
|
williamr@2
|
35 |
@released
|
williamr@2
|
36 |
*/
|
williamr@2
|
37 |
{
|
williamr@2
|
38 |
public:
|
williamr@2
|
39 |
IMPORT_C static CMsvFindText* NewLC(TInt aPriority = EPriorityStandard);
|
williamr@2
|
40 |
IMPORT_C static CMsvFindText* NewL(TInt aPriority = EPriorityStandard);
|
williamr@2
|
41 |
IMPORT_C ~CMsvFindText();
|
williamr@2
|
42 |
//
|
williamr@2
|
43 |
IMPORT_C void FindTextL(const TDesC& aFind, const TDesC& aSource, TMsvPartList aFlags, TRequestStatus& aStatus);
|
williamr@2
|
44 |
IMPORT_C void FindRichTextL(const TDesC& aFind, const CRichText& aSource, TMsvPartList aFlags, TRequestStatus& aStatus);
|
williamr@2
|
45 |
//
|
williamr@2
|
46 |
IMPORT_C TBool FindTextL(const TDesC& aFind, const TDesC& aSource, TMsvPartList aFlags);
|
williamr@2
|
47 |
IMPORT_C TBool FindRichTextL(const TDesC& aFind, const CRichText& aSource, TMsvPartList aFlags);
|
williamr@2
|
48 |
//
|
williamr@2
|
49 |
inline TBool FoundText() const;
|
williamr@2
|
50 |
//
|
williamr@2
|
51 |
private:
|
williamr@2
|
52 |
CMsvFindText(TInt aPriority);
|
williamr@2
|
53 |
//
|
williamr@2
|
54 |
void InitialiseL(const TDesC& aFind, const TDesC* aPlainSource, const CRichText* aRichSource, TMsvPartList aFlags);
|
williamr@2
|
55 |
void DoFindAsyncL(TRequestStatus& aStatus);
|
williamr@2
|
56 |
void DoComplete(TInt&);
|
williamr@2
|
57 |
TBool DoFindSyncL();
|
williamr@2
|
58 |
TBool DoFindStepL();
|
williamr@2
|
59 |
TBool DoFindTextL();
|
williamr@2
|
60 |
void DoRunL();
|
williamr@2
|
61 |
void Check();
|
williamr@2
|
62 |
//
|
williamr@2
|
63 |
private:
|
williamr@2
|
64 |
HBufC* iBuf;
|
williamr@2
|
65 |
HBufC* iFind;
|
williamr@2
|
66 |
TInt iSourcePos;
|
williamr@2
|
67 |
TInt iMaxRead;
|
williamr@2
|
68 |
TInt iSourceLen;
|
williamr@2
|
69 |
const CRichText* iRichText;
|
williamr@2
|
70 |
const TDesC* iPlainText;
|
williamr@2
|
71 |
TMsvPartList iFlags;
|
williamr@2
|
72 |
TChar iPreChar;
|
williamr@2
|
73 |
TChar iPostChar;
|
williamr@2
|
74 |
TBool iFoundText;
|
williamr@2
|
75 |
};
|
williamr@2
|
76 |
|
williamr@2
|
77 |
#include <msvftext.inl>
|
williamr@2
|
78 |
|
williamr@2
|
79 |
#endif
|