|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HGTEXTFIND_H_ |
|
20 #define HGTEXTFIND_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <fepbase.h> |
|
24 #include <aknedsts.h> |
|
25 |
|
26 class CHgScroller; |
|
27 |
|
28 NONSHARABLE_CLASS( CHgTextFind ) : |
|
29 public CBase, |
|
30 public MCoeFepAwareTextEditor, |
|
31 public MCoeFepAwareTextEditor_Extension1 |
|
32 { |
|
33 public: |
|
34 static CHgTextFind* NewL(CHgScroller& aScroller); |
|
35 virtual ~CHgTextFind(); |
|
36 |
|
37 public: // from MCoeFepAwareTextEditor |
|
38 void StartFepInlineEditL(const TDesC& aInitialInlineText, TInt aPositionOfInsertionPointInInlineText, |
|
39 TBool aCursorVisibility, const MFormCustomDraw* aCustomDraw, MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, |
|
40 MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit); |
|
41 void UpdateFepInlineTextL(const TDesC& aNewInlineText, TInt aPositionOfInsertionPointInInlineText); |
|
42 void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility); |
|
43 void CancelFepInlineEdit(); |
|
44 TInt DocumentLengthForFep() const; |
|
45 TInt DocumentMaximumLengthForFep() const; |
|
46 void SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection); |
|
47 void GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const; |
|
48 void GetEditorContentForFep(TDes& aEditorContent, TInt aDocumentPosition, TInt aLengthToRetrieve) const; |
|
49 void GetFormatForFep(TCharFormat& aFormat, TInt aDocumentPosition) const; |
|
50 void GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent, TInt aDocumentPosition) const; |
|
51 MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue); |
|
52 |
|
53 public: // MCoeFepAwareTextEditor_Extension1 |
|
54 void SetStateTransferingOwnershipL(CState* aState, TUid aTypeSafetyUid); |
|
55 CState* State(TUid aTypeSafetyUid); |
|
56 |
|
57 public: |
|
58 const TDesC& Text(); |
|
59 |
|
60 private: // from MCoeFepAwareTextEditor |
|
61 void DoCommitFepInlineEditL(); |
|
62 |
|
63 private: |
|
64 CHgTextFind( CHgScroller& aScroller ); |
|
65 void ConstructL(); |
|
66 |
|
67 private: |
|
68 static TInt SearchTimerCallback( TAny* aSelf ); |
|
69 void ClearSearchDesc(); |
|
70 |
|
71 |
|
72 public: |
|
73 CAknEdwinState* iState; |
|
74 CPeriodic* iTimer; // Used for triggering search string clearing |
|
75 CHgScroller& iScroller; |
|
76 |
|
77 RBuf iSearchDesc; // Search string |
|
78 RBuf iBuf; // Type in buffer |
|
79 }; |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 #endif /* HGTEXTFIND_H_ */ |