|
1 /* |
|
2 * Copyright (c) 2006 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: Utility for selecting smile icon and converting |
|
15 * between smile id and smile string. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CCALAYOUTINFO_H |
|
21 #define CCALAYOUTINFO_H |
|
22 |
|
23 // INCLUDES |
|
24 |
|
25 #include "MCALayoutInfo.h" |
|
26 #include "TCAChatListBoxLayout.h" |
|
27 #include "MCALayoutChangeObserver.h" |
|
28 |
|
29 #include <e32base.h> |
|
30 #include <AknLayout2Def.h> |
|
31 // FORWARD DECLARATIONS |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Layout and render info for Chat Listbox's item drawer and view |
|
37 * Helps to calculate and draw items. |
|
38 * |
|
39 * @lib chat.app |
|
40 * @since 2.8 |
|
41 */ |
|
42 class CCALayoutInfo : public CBase, |
|
43 public MCALayoutInfo, |
|
44 public MCALayoutChangeObserver |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor using default smile icon array. |
|
50 */ |
|
51 static CCALayoutInfo* NewL( TChatListBoxLayout::TLayout aLayoutID ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CCALayoutInfo(); |
|
57 |
|
58 public: // New methods |
|
59 |
|
60 |
|
61 public: // from MCALayoutInfo |
|
62 |
|
63 void SetLayoutID( TChatListBoxLayout::TLayout aLayout ); |
|
64 |
|
65 TInt LayoutID(); |
|
66 |
|
67 TBool Mirrored(); |
|
68 |
|
69 const CFont* NickFont(); |
|
70 |
|
71 const CFont* MessageFont(); |
|
72 |
|
73 TInt LineHeight(); |
|
74 |
|
75 TInt MaxLineWidth(); |
|
76 |
|
77 TInt MaxNickWidth(); |
|
78 |
|
79 TInt MaxLines(); |
|
80 |
|
81 TRect MainPaneRect(); |
|
82 |
|
83 TInt Indent(); |
|
84 |
|
85 TRect ScreenRect(); |
|
86 |
|
87 void SetEditorVisibility( TBool aVisible ); |
|
88 |
|
89 TBool EditorVisibility(); |
|
90 |
|
91 TAknWindowLineLayout im_reading_pane( TInt aIndex_H ); |
|
92 |
|
93 TAknWindowLineLayout im_reading_field( TInt aIndex_t ); |
|
94 |
|
95 TAknWindowLineLayout IM_text_elements( TInt aLineIndex ); |
|
96 |
|
97 TAknTextLineLayout IM_reading_pane_texts_Line_1( TInt aCommon1 ); |
|
98 |
|
99 TAknTextLineLayout IM_reading_pane_texts_Line_2(); |
|
100 |
|
101 TAknWindowLineLayout IM_text_elements_Line_1(); |
|
102 |
|
103 TAknWindowLineLayout IM_text_elements_Line_2(); |
|
104 |
|
105 TAknWindowLineLayout IM_reading_field_highlight_graphics_Line_1( |
|
106 const TRect& aParentRect ); |
|
107 |
|
108 TAknWindowLineLayout IM_reading_field_highlight_graphics_Line_2( |
|
109 const TRect& aParentRect ); |
|
110 |
|
111 TAknWindowLineLayout im_writing_pane( TInt aCommon1 ); |
|
112 |
|
113 TAknWindowLineLayout IM_writing_field_elements_Line_1( TInt aIndex_H ); |
|
114 |
|
115 TAknWindowLineLayout IM_writing_field_elements_Line_2(); |
|
116 |
|
117 TAknWindowLineLayout IM_writing_field_elements_Line_3( TInt aIndex_H ); |
|
118 |
|
119 TAknMultiLineTextLayout Multiline_IM_writing_pane_texts_Line_1( |
|
120 TInt aNumberOfLinesShown ); |
|
121 |
|
122 TAknTextLineLayout IM_navi_pane_texts_Line_1( TInt aIndex_C, TInt aIndex_W ); |
|
123 |
|
124 void DPLayout( const TDesC& aStr, const TAknTextLineLayout aLayout ); |
|
125 |
|
126 void DPLayout( const TDesC& aStr, const TAknWindowLineLayout aLayout ); |
|
127 |
|
128 void DPRect( const TDesC& aStr, const TRect& aRect ); |
|
129 public: // from MCALayoutChangeObserver |
|
130 |
|
131 virtual void LayoutChangedL( TInt aType = 0 ); |
|
132 |
|
133 private: // Constructors and destructor |
|
134 |
|
135 /** |
|
136 * C++ constructor. |
|
137 */ |
|
138 CCALayoutInfo( TChatListBoxLayout::TLayout aLayoutID ); |
|
139 |
|
140 /** |
|
141 * Second-phased constructor |
|
142 */ |
|
143 void ConstructL(); |
|
144 |
|
145 private: // New methods |
|
146 |
|
147 void LogLayoutL(); |
|
148 |
|
149 void FillLayoutL(); |
|
150 |
|
151 void FillReadingPaneL(); |
|
152 |
|
153 void FillReadingFieldL(); |
|
154 |
|
155 void FillReadingPaneTextsLine1L(); |
|
156 |
|
157 void FillReadingPaneTextsLine2(); |
|
158 |
|
159 void FillIMTextElementsL(); |
|
160 |
|
161 void FillWrittingPaneTextsLineL(); |
|
162 |
|
163 void FillIMWritingFieldLine1L(); |
|
164 |
|
165 void FillIMWritingFieldLine2(); |
|
166 |
|
167 void FillIMWritingFieldLine3L(); |
|
168 |
|
169 void FillWrittingPaneL(); |
|
170 |
|
171 void FillIMNaviPaneTextsLineL(); |
|
172 |
|
173 void SetupMainPaneRect(); |
|
174 |
|
175 private: // Data |
|
176 |
|
177 TChatListBoxLayout::TLayout iLayoutID; |
|
178 |
|
179 TBool iMirrored; |
|
180 |
|
181 // doesn't own |
|
182 const CFont* iNickFont; |
|
183 |
|
184 const CFont* iMsgFont; |
|
185 |
|
186 TInt iLineHeight; |
|
187 |
|
188 TInt iMaxLineWidth; |
|
189 |
|
190 TInt iMaxNickWidth; |
|
191 |
|
192 TInt iMaxLines; |
|
193 |
|
194 TRect iMainPaneRect; |
|
195 |
|
196 TRect iScreenRect; |
|
197 |
|
198 TRect iLastScreenRect; |
|
199 |
|
200 TInt iIconSkip; |
|
201 |
|
202 TInt iIndent; |
|
203 |
|
204 CArrayFixFlat<TAknWindowLineLayout>* iReadingPane; |
|
205 |
|
206 CArrayFixFlat<TAknWindowLineLayout>* iWrittingPane; |
|
207 |
|
208 CArrayFixFlat<TAknWindowLineLayout>* iReadingField; |
|
209 |
|
210 CArrayFixFlat<TAknTextLineLayout>* iReadingPaneTextsLine1; |
|
211 |
|
212 CArrayFixFlat<TAknWindowLineLayout>* iIMTextElements; |
|
213 |
|
214 TAknTextLineLayout iReadingPaneTextsLine2; |
|
215 |
|
216 CArrayFixFlat<TAknMultiLineTextLayout>* iWrittingPaneTextsLine; |
|
217 |
|
218 CArrayFixFlat<TAknWindowLineLayout>* iIMWritingFieldLine1; |
|
219 |
|
220 TAknWindowLineLayout iIMWritingFieldLine2; |
|
221 |
|
222 CArrayFixFlat<TAknWindowLineLayout>* iIMWritingFieldLine3; |
|
223 |
|
224 CArrayFixFlat<TAknTextLineLayout>* iIMNaviPaneTextsLine1; |
|
225 |
|
226 CArrayFixFlat<TAknTextLineLayout>* iIMNaviPaneTextsLine2; |
|
227 |
|
228 TBool iEditorVisibility; |
|
229 }; |
|
230 |
|
231 #endif // CCALAYOUTINFO_H |