|
1 /* |
|
2 * Copyright (c) 2007-2008 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: layout info class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CIMCVAPPLAYOUTINFO_H |
|
20 #define CIMCVAPPLAYOUTINFO_H |
|
21 |
|
22 // INCLUDES |
|
23 |
|
24 #include "mimcvapplayoutinfo.h" |
|
25 #include "mimcvapplayoutchangeobserver.h" |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <AknLayout2Def.h> |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Layout and render info for im Listbox's item drawer and view |
|
35 * Helps to calculate and draw items. |
|
36 * |
|
37 * @lib imcvuiapp.exe |
|
38 * @since 5.0 |
|
39 */ |
|
40 class CIMCVAppLayoutInfo : public CBase, |
|
41 public MIMCVAppLayoutInfo, |
|
42 public MIMCVAppLayoutChangeObserver |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor using default smile icon array. |
|
48 */ |
|
49 static CIMCVAppLayoutInfo* NewL( TChatListBoxLayout::TLayout aLayoutID ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CIMCVAppLayoutInfo(); |
|
55 |
|
56 public: // New methods |
|
57 |
|
58 |
|
59 public: // from MIMCVAppLayoutInfo |
|
60 |
|
61 /** |
|
62 * MainPaneRect |
|
63 * rect of main pane. |
|
64 */ |
|
65 void SetLayoutID( TChatListBoxLayout::TLayout aLayout ); |
|
66 |
|
67 /** |
|
68 * MainPaneRect |
|
69 * rect of main pane. |
|
70 */ |
|
71 TRect MainPaneRect(); |
|
72 |
|
73 |
|
74 /** |
|
75 * ScreenRect |
|
76 * rect of main pane. |
|
77 */ |
|
78 TRect ScreenRect(); |
|
79 |
|
80 /** |
|
81 * SetEditorVisibility |
|
82 */ |
|
83 void SetEditorVisibility( TBool aVisible ); |
|
84 |
|
85 /** |
|
86 * EditorVisibility |
|
87 */ |
|
88 TBool EditorVisibility(); |
|
89 |
|
90 /** |
|
91 * im_reading_pane |
|
92 * im reading pande |
|
93 * param@ aIndex_h, index of reading pane |
|
94 */ |
|
95 TAknWindowLineLayout im_reading_pane(TInt aIndex_H); |
|
96 |
|
97 /** |
|
98 * im_reading_field |
|
99 * im reading pane. |
|
100 * param@ aIndex_t, index of reading field |
|
101 */ |
|
102 TAknWindowLineLayout im_reading_field(TInt aIndex_t); |
|
103 |
|
104 /** |
|
105 * IM_text_elements |
|
106 * im text elements |
|
107 * @param aLineIndex, index of text element |
|
108 */ |
|
109 TAknWindowLineLayout IM_text_elements(TInt aLineIndex); |
|
110 |
|
111 /** |
|
112 * IM_reading_pane_texts_Line_1 |
|
113 * im reading pane text line 1 |
|
114 * @param aCommon1, command to excute |
|
115 */ |
|
116 TAknTextLineLayout IM_reading_pane_texts_Line_1(TInt aCommon1); |
|
117 |
|
118 /** |
|
119 * IM_reading_pane_texts_Line_2 |
|
120 * imreading pane text line2 |
|
121 */ |
|
122 TAknTextLineLayout IM_reading_pane_texts_Line_2(); |
|
123 |
|
124 |
|
125 /** |
|
126 * im_writing_pane |
|
127 * im writing pane |
|
128 * @param aCommon1, command to excute |
|
129 */ |
|
130 TAknWindowLineLayout im_writing_pane(TInt aCommon1); |
|
131 |
|
132 /** |
|
133 * IM_writing_field_elements_Line_1 |
|
134 * im writing field element line 1 |
|
135 * @param aIndex_H, index of writing element |
|
136 */ |
|
137 TAknWindowLineLayout IM_writing_field_elements_Line_1(TInt aIndex_H); |
|
138 |
|
139 /** |
|
140 * IM_writing_field_elements_Line_2 |
|
141 * im writing fields elements line 2 |
|
142 */ |
|
143 TAknWindowLineLayout IM_writing_field_elements_Line_2(); |
|
144 |
|
145 /** |
|
146 * IM_writing_field_elements_Line_3 |
|
147 * im writing fields elements line 3 |
|
148 * @param aIndex_H, index of writing field element |
|
149 */ |
|
150 TAknWindowLineLayout IM_writing_field_elements_Line_3(TInt aIndex_H); |
|
151 |
|
152 /** |
|
153 * Multiline_IM_writing_pane_texts_Line_1 |
|
154 * im writing pane text line 1 |
|
155 * @param aNumberOfLinesShown, no of line to shown in the pane |
|
156 */ |
|
157 TAknMultiLineTextLayout Multiline_IM_writing_pane_texts_Line_1( |
|
158 TInt aNumberOfLinesShown); |
|
159 /** |
|
160 * IM_navi_pane_texts_Line_1 |
|
161 * im navi pane text line 1 |
|
162 * @param aIndex_C, index of text line |
|
163 * @param aIndex_W, index of pane |
|
164 */ |
|
165 TAknTextLineLayout IM_navi_pane_texts_Line_1(TInt aIndex_C, TInt aIndex_W); |
|
166 /** |
|
167 * DPLayout |
|
168 * dp layout |
|
169 * @param aStr, string to be draw |
|
170 * @param aLayout, layout |
|
171 */ |
|
172 void DPLayout( const TDesC& aStr, const TAknTextLineLayout aLayout ); |
|
173 /** |
|
174 * DPLayout |
|
175 * rect of main pane. |
|
176 * @param aStr, string to be draw |
|
177 * @param aLayout, layout |
|
178 */ |
|
179 void DPLayout( const TDesC& aStr, const TAknWindowLineLayout aLayout ); |
|
180 /** |
|
181 * DPRect |
|
182 * dp rect |
|
183 * @param aStr, string to be draw |
|
184 * @param aRect, rect for the layout |
|
185 */ |
|
186 void DPRect( const TDesC& aStr, const TRect& aRect ); |
|
187 |
|
188 public: // from MIMCVAppLayoutChangeObserver |
|
189 /** |
|
190 * MainPaneRect |
|
191 * change of layout |
|
192 * @param aType, type of layout changes |
|
193 */ |
|
194 virtual void LayoutChangedL( TInt aType = 0 ); |
|
195 |
|
196 private: // Constructors and destructor |
|
197 |
|
198 /** |
|
199 * C++ constructor. |
|
200 * @param aLayoutID, id of layout |
|
201 */ |
|
202 CIMCVAppLayoutInfo( TChatListBoxLayout::TLayout aLayoutID ); |
|
203 |
|
204 /** |
|
205 * Second-phased constructor |
|
206 */ |
|
207 void ConstructL(); |
|
208 |
|
209 private: // New methods |
|
210 /** |
|
211 * LogLayoutL |
|
212 * log layout |
|
213 */ |
|
214 void LogLayoutL(); |
|
215 /** |
|
216 * FillLayoutL |
|
217 * fill the layout |
|
218 */ |
|
219 void FillLayoutL(); |
|
220 /** |
|
221 * FillReadingPaneL |
|
222 * fill the reading pane |
|
223 */ |
|
224 void FillReadingPaneL(); |
|
225 /** |
|
226 * FillReadingFieldL |
|
227 * fill the reading field |
|
228 */ |
|
229 void FillReadingFieldL(); |
|
230 /** |
|
231 * FillReadingPaneTextsLine1L |
|
232 * fill the reading pane text line1 |
|
233 */ |
|
234 void FillReadingPaneTextsLine1L(); |
|
235 /** |
|
236 * FillReadingPaneTextsLine2 |
|
237 * fill the reading pane text line2 |
|
238 */ |
|
239 void FillReadingPaneTextsLine2(); |
|
240 /** |
|
241 * FillIMTextElementsL |
|
242 * fill the text elements |
|
243 */ |
|
244 void FillIMTextElementsL(); |
|
245 /** |
|
246 * FillWrittingPaneTextsLineL |
|
247 * fill writing pane text line |
|
248 */ |
|
249 void FillWrittingPaneTextsLineL(); |
|
250 /** |
|
251 * FillIMWritingFieldLine1L |
|
252 * ffill writing field line 1 |
|
253 */ |
|
254 void FillIMWritingFieldLine1L(); |
|
255 /** |
|
256 * FillIMWritingFieldLine2 |
|
257 * fill writing field line 2 |
|
258 */ |
|
259 void FillIMWritingFieldLine2(); |
|
260 /** |
|
261 * FillIMWritingFieldLine3L |
|
262 * fill writing field line 3 |
|
263 */ |
|
264 void FillIMWritingFieldLine3L(); |
|
265 /** |
|
266 * FillWrittingPaneL |
|
267 * fill writing pane |
|
268 */ |
|
269 void FillWrittingPaneL(); |
|
270 /** |
|
271 * FillIMNaviPaneTextsLineL |
|
272 * fill navi pane text |
|
273 */ |
|
274 void FillIMNaviPaneTextsLineL(); |
|
275 /** |
|
276 * setMainPaneRect |
|
277 * set rect of main pane. |
|
278 */ |
|
279 void SetupMainPaneRect(); |
|
280 |
|
281 private: // Data |
|
282 |
|
283 // owned, layout id |
|
284 TChatListBoxLayout::TLayout iLayoutID; |
|
285 // owned, max line toi display |
|
286 TInt iMaxLines; |
|
287 // owned, main pane layout |
|
288 TRect iMainPaneRect; |
|
289 // owned, screen rect |
|
290 TRect iScreenRect; |
|
291 // owned, last screen rect |
|
292 TRect iLastScreenRect; |
|
293 // owned, reading pane |
|
294 CArrayFixFlat<TAknWindowLineLayout>* iReadingPane; |
|
295 // owned, writing pane |
|
296 CArrayFixFlat<TAknWindowLineLayout>* iWrittingPane; |
|
297 // owned, reading fields |
|
298 CArrayFixFlat<TAknWindowLineLayout>* iReadingField; |
|
299 // owned, reading pane text layout |
|
300 CArrayFixFlat<TAknTextLineLayout>* iReadingPaneTextsLine1; |
|
301 // owned, text elements |
|
302 CArrayFixFlat<TAknWindowLineLayout>* iIMTextElements; |
|
303 // owned, reading text line |
|
304 TAknTextLineLayout iReadingPaneTextsLine2; |
|
305 // owned, writing text line |
|
306 CArrayFixFlat<TAknMultiLineTextLayout>* iWrittingPaneTextsLine; |
|
307 // owned, writing field line 1 |
|
308 CArrayFixFlat<TAknWindowLineLayout>* iIMWritingFieldLine1; |
|
309 // owned, writing field line 2 |
|
310 TAknWindowLineLayout iIMWritingFieldLine2; |
|
311 // owned, writing field line 3 |
|
312 CArrayFixFlat<TAknWindowLineLayout>* iIMWritingFieldLine3; |
|
313 // owned, writing text line 1 |
|
314 CArrayFixFlat<TAknTextLineLayout>* iIMNaviPaneTextsLine1; |
|
315 |
|
316 CArrayFixFlat<TAknTextLineLayout>* iIMNaviPaneTextsLine2; |
|
317 |
|
318 TBool iEditorVisibility; |
|
319 }; |
|
320 |
|
321 #endif // CIMCVAPPLAYOUTINFO_H |