|
1 /* |
|
2 * Copyright (c) 2007 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: API class for TextViewer component |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FSTEXTVIEWER_H |
|
20 #define C_FSTEXTVIEWER_H |
|
21 |
|
22 //<cmail> removed __FS_ALFRED_SUPPORT flag |
|
23 //#include <fsconfig.h> |
|
24 //</cmail> removed __FS_ALFRED_SUPPORT flag |
|
25 #include <e32base.h> |
|
26 // <cmail> SF |
|
27 #include <alf/alfenv.h> |
|
28 // </cmail> |
|
29 class CFsRichText; |
|
30 class CFsTextViewerVisualizer; |
|
31 class CFsTextViewerControl; |
|
32 class MFsTextViewerObserver; |
|
33 class CFsSmileyDictionary; |
|
34 class CFsTextViewerKeys; |
|
35 class CFsTextViewerWatermark; |
|
36 class CAlfLayout; |
|
37 class CAlfTexture; |
|
38 class CFsTextViewerVisualizerSettings; |
|
39 |
|
40 class CFsTextViewer : public CBase |
|
41 { |
|
42 public: |
|
43 IMPORT_C static CFsTextViewer* NewL ( CAlfEnv& aEnv ); |
|
44 IMPORT_C ~CFsTextViewer(); |
|
45 |
|
46 public: |
|
47 IMPORT_C CAlfControl* GetControl() const; |
|
48 IMPORT_C void SetTextL( |
|
49 CFsRichText* aText, |
|
50 CFsSmileyDictionary* aSmDict ); |
|
51 IMPORT_C void Show(); |
|
52 IMPORT_C void Hide(); |
|
53 IMPORT_C void SetObserver( MFsTextViewerObserver* aObserver ); |
|
54 IMPORT_C void SetScrollOffsetInPx( TInt aPxOffset ); |
|
55 IMPORT_C void SetScrollOffsetInLines( TInt aLineOffset ); |
|
56 IMPORT_C void SetSmileySize( TSize aSize ); |
|
57 IMPORT_C void SetPictureSize( TSize aSize ); |
|
58 IMPORT_C void SetScrollDelay( TInt aDelay ); |
|
59 IMPORT_C void SetCursorDelay( TInt aDelay ); |
|
60 IMPORT_C void EnableSmileys( TBool aStatus = ETrue ); |
|
61 IMPORT_C TBool Smileys(); |
|
62 IMPORT_C void ReloadTextL(); |
|
63 IMPORT_C void GetCurrentHotspotL( TInt& aBegin, TInt& aEnd ); |
|
64 IMPORT_C void GetMarkedArea( TInt& aBegin, TInt& aEnd ); |
|
65 IMPORT_C void EnableCursorUpDown( TBool aStatus = ETrue ); |
|
66 IMPORT_C TBool CursorUpDown(); |
|
67 IMPORT_C void SetCustomKeys( CFsTextViewerKeys* aKeys ); |
|
68 IMPORT_C CFsTextViewerKeys* Keys(); |
|
69 IMPORT_C void SetWatermarkL( CFsTextViewerWatermark* aWatermark ); |
|
70 IMPORT_C CAlfLayout* RootLayout(); |
|
71 IMPORT_C void SetBackgroundColorL( const TRgb& aColor ); |
|
72 IMPORT_C void SetBackgroundImageL( CAlfTexture& aTexture ); |
|
73 IMPORT_C void SetBackgroundOpacity( const TAlfTimedValue& aOpacity ); |
|
74 IMPORT_C const TAlfTimedValue& BackgroundOpacity() const; |
|
75 IMPORT_C void SetPartBgColorL( |
|
76 TInt aStartChar, |
|
77 TInt aEndChar, |
|
78 const TRgb& aColor ); |
|
79 IMPORT_C void SetPartBgImageL( |
|
80 TInt aStartChar, |
|
81 TInt aEndChar, |
|
82 CAlfTexture& aTexture ); |
|
83 IMPORT_C void SetLiteLineBg( |
|
84 CAlfTexture& aTexture, |
|
85 TReal32 aOpacity ); |
|
86 IMPORT_C void SetActionButton( |
|
87 CAlfTexture& aTexture, |
|
88 TReal32 aOpacity ); |
|
89 IMPORT_C void SetActionButtonMargin( TReal32 aMargin ); |
|
90 IMPORT_C void SetActionButtonSize( TReal32 aWidth, TReal32 aHeight ); |
|
91 IMPORT_C void SetMirroring( TBool aEnable = ETrue ); |
|
92 IMPORT_C TInt GetTotalLines(); |
|
93 IMPORT_C TInt GetFirstDisplayedLine(); |
|
94 //<cmail> |
|
95 IMPORT_C TInt GetFirstCharInLine(TInt aChar); |
|
96 IMPORT_C TInt GetLineNumber(TInt aLineOffset); |
|
97 //</cmail> |
|
98 IMPORT_C TInt GetLastDisplayedLine(); |
|
99 IMPORT_C void RemoveEndLinesL( TInt aLines ); |
|
100 IMPORT_C void ReplaceTextL( |
|
101 CFsRichText* aRichText, |
|
102 CFsSmileyDictionary* aSmDict = NULL ); |
|
103 IMPORT_C void FocusLineL( |
|
104 TInt aLine, |
|
105 TBool aShowAsFirstLine = EFalse ); |
|
106 IMPORT_C void SetLeftMargin( TInt aMargin ); |
|
107 IMPORT_C void SetRightMargin( TInt aMargin ); |
|
108 IMPORT_C void ReloadPicturesL( TInt aLine = -1 ); |
|
109 IMPORT_C TBool GetVisibleFocusedHotspotLine( TInt& aLineNum ) const; |
|
110 IMPORT_C void HideActionButtonFromCurrentHighlightedHotspot(); |
|
111 IMPORT_C void ShowActionButtonForCurrentHighlightedHotspotL(); |
|
112 // <cmail> |
|
113 IMPORT_C void SetCurrentHotspotByOrderL( TInt aIndex, TBool aFocusLine = EFalse ); |
|
114 // </cmail> |
|
115 IMPORT_C void SetCurrentHotspotByCharL( TInt aIndex ); |
|
116 IMPORT_C CAlfLayout* GetStatusLayout(); |
|
117 IMPORT_C void UpdateStatusLayout(); |
|
118 IMPORT_C void RemoveStatusLayout(); |
|
119 IMPORT_C HBufC* GetCurrentHotspotTextL(); |
|
120 // <cmail> |
|
121 IMPORT_C TInt GetCurrentHotspotByOrder(); |
|
122 // </cmail> |
|
123 |
|
124 private: |
|
125 CFsTextViewer( CAlfEnv& aEnv ); |
|
126 void ConstructL( CAlfEnv& aEnv ); |
|
127 |
|
128 private: |
|
129 CFsTextViewerVisualizer* iVisualizer; |
|
130 CFsTextViewerControl* iControl; |
|
131 CFsTextViewerWatermark* iWatermark; |
|
132 CAlfTexture* iTexture; |
|
133 TRgb iColor; |
|
134 TBool iBackColorSet; |
|
135 CFsTextViewerVisualizerSettings* iSettings; |
|
136 }; |
|
137 |
|
138 #endif // C_FSTEXTVIEWER_H |
|
139 |