|
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: Visual aligning class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FSTEXTVIEWERLAYOUTER_H |
|
20 #define C_FSTEXTVIEWERLAYOUTER_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 #include <biditext.h> |
|
27 |
|
28 class CFsTextViewerCoordinator; |
|
29 class MFsRichTextObject; |
|
30 class CFsTextViewerVisualizerData; |
|
31 class TFsRangedVisual; |
|
32 class CWsScreenDevice; |
|
33 class CAlfLayout; |
|
34 class CFsRichText; |
|
35 class CAlfEnv; |
|
36 class CFsTextParser; |
|
37 class CFsTextViewerVisualizer; |
|
38 |
|
39 class CFsTextViewerLayouter : public CBase |
|
40 { |
|
41 public: |
|
42 static CFsTextViewerLayouter* NewL( CAlfEnv* aEnv ); |
|
43 ~CFsTextViewerLayouter(); |
|
44 |
|
45 public: |
|
46 TInt MeasureBidiTextBoundsWidth( |
|
47 const CFont& aFont, |
|
48 const TDesC& aText, |
|
49 CFont::TMeasureTextInput::TFlags aOrder); |
|
50 TSize CalculateSizeL( MFsRichTextObject* aObject ); |
|
51 TInt FindMaxLengthL( MFsRichTextObject* aObject ); |
|
52 TFsRangedVisual* PrepareRangedVisL( |
|
53 MFsRichTextObject* aObject, |
|
54 CAlfLayout* aLayout ); |
|
55 void SetDisplaySize( TSize aDisplaySize ); |
|
56 TBool AppendObjectL( MFsRichTextObject* aObject, CAlfLayout* aLayout, CFsTextParser* aParser, TBool aRegisterSelects = ETrue ); |
|
57 TBool InsertObjectL( MFsRichTextObject* aObject, CAlfLayout* aLayout, CFsTextParser* aParser, TBool aRegisterSelects = ETrue ); |
|
58 void ConstructLineL( TInt aHeight = 1 ); |
|
59 void SetMargins( const TInt aLeft, const TInt aRight ); |
|
60 void SetHelper( CFsTextViewerCoordinator* aHelper ); |
|
61 void SetNavigator( CFsTextViewerVisualizerData* aNavigator ); |
|
62 TInt Lines(); |
|
63 void EnableSmileys( TBool aEnable = ETrue ); |
|
64 void SetPosition( TInt aLine, TInt aLineOffset ); |
|
65 void ChangeDirection( TBidiText::TDirectionality aDirection ); |
|
66 void SetDirection( TBidiText::TDirectionality aDirection ); |
|
67 TBidiText::TDirectionality GetDirection(); |
|
68 void JoinRangedVisuals( TFsRangedVisual* aFirst, TFsRangedVisual* aSecond ); |
|
69 TInt GetCurrentLineOffset(); |
|
70 void SetCurrentLineOffset( TInt aOffset ); |
|
71 TBool IsNewLine(); |
|
72 |
|
73 private: |
|
74 void ConstructL(); |
|
75 CFsTextViewerLayouter( CAlfEnv* aEnv ); |
|
76 |
|
77 private: |
|
78 TBool ReorderLineFromLeftL( MFsRichTextObject* aObject, CAlfLayout* aLayout, CFsTextParser* aParser, TSize aObjectSize, TBool aRegisterSelects = ETrue ); |
|
79 TBool ReorderLineFromRightL( MFsRichTextObject* aObject, CAlfLayout* aLayout, CFsTextParser* aParser, TSize aObjectSize, TBool aRegisterSelects = ETrue ); |
|
80 |
|
81 private: |
|
82 CFsTextViewerCoordinator* iHelper; |
|
83 CFsTextViewerVisualizerData* iNavigator; |
|
84 CWsScreenDevice* iScreenDev; |
|
85 CFsRichText* iCFsRichText; |
|
86 TBool iSmileyEnabled; |
|
87 TSize iDisplaySize; |
|
88 CAlfEnv* iEnv; |
|
89 RPointerArray<TFsRangedVisual> iCurrentLineArray; |
|
90 TInt iCurrentLineOffset; |
|
91 TInt iLineHeight; |
|
92 TInt iLastCol; |
|
93 TInt iLeftMargin; |
|
94 TInt iRightMargin; |
|
95 TInt iLines; |
|
96 TInt iLowestPicPosition; |
|
97 TBidiText::TDirectionality iMainDirection; |
|
98 TBool iNewLine; |
|
99 |
|
100 public: |
|
101 CFsTextViewerVisualizer* iVisualizer; |
|
102 CAlfControl* iControl; |
|
103 }; |
|
104 |
|
105 #endif //C_FSTEXTVIEWERLAYOUTER_H |