|
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: Layout and render info for Chat Listbox's item drawer and view |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "CCALayoutInfo.h" |
|
22 #include "LayoutDebugPrint.h" |
|
23 |
|
24 #include <AknUtils.h> |
|
25 #include <AppLayout.cdl.h> //cdl |
|
26 #include <F32FILE.H> |
|
27 #include <AknLayoutScalable_Apps.cdl.h> |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // ================= MEMBER FUNCTIONS ======================= |
|
32 |
|
33 // ----------------------------------------------------------------------------- |
|
34 // CCALayoutInfo::NewL |
|
35 // Two-phased constructor. |
|
36 // ----------------------------------------------------------------------------- |
|
37 // |
|
38 CCALayoutInfo* CCALayoutInfo::NewL( TChatListBoxLayout::TLayout aLayoutID ) |
|
39 { |
|
40 CCALayoutInfo* self = new ( ELeave ) CCALayoutInfo( aLayoutID ); |
|
41 CleanupStack::PushL( self ); |
|
42 self->ConstructL(); |
|
43 CleanupStack::Pop( self ); |
|
44 return self; |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CCALayoutInfo::~CCALayoutInfo |
|
49 // Destructor |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 CCALayoutInfo::~CCALayoutInfo() |
|
53 { |
|
54 if ( iReadingPane ) |
|
55 { |
|
56 iReadingPane->Reset(); |
|
57 delete iReadingPane; |
|
58 } |
|
59 |
|
60 if ( iWrittingPane ) |
|
61 { |
|
62 iWrittingPane->Reset(); |
|
63 delete iWrittingPane; |
|
64 } |
|
65 |
|
66 if ( iReadingField ) |
|
67 { |
|
68 iReadingField->Reset(); |
|
69 delete iReadingField; |
|
70 } |
|
71 |
|
72 if ( iReadingPaneTextsLine1 ) |
|
73 { |
|
74 iReadingPaneTextsLine1->Reset(); |
|
75 delete iReadingPaneTextsLine1; |
|
76 } |
|
77 |
|
78 if ( iIMTextElements ) |
|
79 { |
|
80 iIMTextElements->Reset(); |
|
81 delete iIMTextElements; |
|
82 } |
|
83 |
|
84 if ( iWrittingPaneTextsLine ) |
|
85 { |
|
86 iWrittingPaneTextsLine->Reset(); |
|
87 delete iWrittingPaneTextsLine; |
|
88 } |
|
89 |
|
90 if ( iIMWritingFieldLine1 ) |
|
91 { |
|
92 iIMWritingFieldLine1->Reset(); |
|
93 delete iIMWritingFieldLine1; |
|
94 } |
|
95 |
|
96 if ( iIMWritingFieldLine3 ) |
|
97 { |
|
98 iIMWritingFieldLine3->Reset(); |
|
99 delete iIMWritingFieldLine3; |
|
100 } |
|
101 |
|
102 if ( iIMNaviPaneTextsLine1 ) |
|
103 { |
|
104 iIMNaviPaneTextsLine1->Reset(); |
|
105 delete iIMNaviPaneTextsLine1; |
|
106 } |
|
107 |
|
108 if ( iIMNaviPaneTextsLine2 ) |
|
109 { |
|
110 iIMNaviPaneTextsLine2->Reset(); |
|
111 delete iIMNaviPaneTextsLine2; |
|
112 } |
|
113 } |
|
114 |
|
115 // ----------------------------------------------------------------------------- |
|
116 // CCALayoutInfo::CCALayoutInfo |
|
117 // C++ constructor can NOT contain any code, that might leave. |
|
118 // ----------------------------------------------------------------------------- |
|
119 // |
|
120 CCALayoutInfo::CCALayoutInfo( TChatListBoxLayout::TLayout aLayoutID ) : |
|
121 iLayoutID( aLayoutID ) |
|
122 { |
|
123 } |
|
124 |
|
125 // ----------------------------------------------------------------------------- |
|
126 // CCALayoutInfo::ConstructL |
|
127 // Second phase constructor |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 void CCALayoutInfo::ConstructL() |
|
131 { |
|
132 SetupMainPaneRect(); |
|
133 FillLayoutL(); |
|
134 LogLayoutL(); |
|
135 } |
|
136 |
|
137 // --------------------------------------------------------- |
|
138 // CCALayoutInfo::LayoutID |
|
139 // (other items were commented in a header). |
|
140 // --------------------------------------------------------- |
|
141 // |
|
142 TInt CCALayoutInfo::LayoutID() |
|
143 { |
|
144 return iLayoutID; |
|
145 } |
|
146 |
|
147 // --------------------------------------------------------- |
|
148 // CCALayoutInfo::Mirrored |
|
149 // (other items were commented in a header). |
|
150 // --------------------------------------------------------- |
|
151 // |
|
152 TBool CCALayoutInfo::Mirrored() |
|
153 { |
|
154 return iMirrored; |
|
155 } |
|
156 |
|
157 // --------------------------------------------------------- |
|
158 // CCALayoutInfo::LayoutChangedL |
|
159 // (other items were commented in a header). |
|
160 // --------------------------------------------------------- |
|
161 // |
|
162 void CCALayoutInfo::LayoutChangedL( TInt /*aType = 0*/ ) |
|
163 { |
|
164 LAYOUT_DP_TXT( "CCALayoutInfo::LayoutChangedL" ); |
|
165 |
|
166 FillLayoutL(); |
|
167 |
|
168 TAknLayoutRect myLayoutRect; |
|
169 |
|
170 TAknLayoutRect myLine; |
|
171 |
|
172 iMirrored = AknLayoutUtils::LayoutMirrored(); |
|
173 |
|
174 //update MainPaneRect |
|
175 SetupMainPaneRect(); |
|
176 |
|
177 TAknWindowLineLayout readingPane = im_reading_pane( iLayoutID ); |
|
178 |
|
179 myLayoutRect.LayoutRect( iMainPaneRect, readingPane ); |
|
180 |
|
181 //line height |
|
182 TAknWindowLineLayout lineLayout = im_reading_field( 0 ); |
|
183 |
|
184 myLine.LayoutRect( myLayoutRect.Rect(), lineLayout ); |
|
185 |
|
186 iLineHeight = myLine.Rect().Height(); |
|
187 |
|
188 LAYOUT_DP( D_LAYOUT_LIT( "CCALayoutInfo::LayoutChangedL iLineHeight:%d" ) |
|
189 , iLineHeight ); |
|
190 |
|
191 //Max Lines |
|
192 |
|
193 iMaxLines = myLayoutRect.Rect().Height() / iLineHeight; |
|
194 |
|
195 LAYOUT_DP( D_LAYOUT_LIT( "CCALayoutInfo::LayoutChangedL iMaxLines:%d" ) |
|
196 , iMaxLines ); |
|
197 |
|
198 // NickFont |
|
199 |
|
200 TAknTextLineLayout myMessageHeaderLayout = |
|
201 IM_reading_pane_texts_Line_1( 1 ); |
|
202 iNickFont = AknLayoutUtils::FontFromId( myMessageHeaderLayout.FontId() ); |
|
203 |
|
204 // MaxLineWidth |
|
205 |
|
206 TAknLayoutText myTextLayout; |
|
207 TAknLayoutText myTextLayout2; |
|
208 |
|
209 myTextLayout.LayoutText( myLine.Rect(), myMessageHeaderLayout ); |
|
210 |
|
211 iMaxLineWidth = myTextLayout.TextRect().Width(); |
|
212 |
|
213 LAYOUT_DP( D_LAYOUT_LIT( "CCALayoutInfo::LayoutChangedL iMaxLineWidth:%d" ) |
|
214 , iMaxLineWidth ); |
|
215 |
|
216 // IconSkip |
|
217 myMessageHeaderLayout = IM_reading_pane_texts_Line_1( 2 ); |
|
218 |
|
219 myTextLayout2.LayoutText( myLine.Rect(), myMessageHeaderLayout ); |
|
220 |
|
221 if ( iMirrored ) |
|
222 { |
|
223 iIconSkip = myTextLayout.TextRect().iBr.iX |
|
224 - myTextLayout2.TextRect().iBr.iX; |
|
225 } |
|
226 else |
|
227 { |
|
228 iIconSkip = myTextLayout2.TextRect().iTl.iX |
|
229 - myTextLayout.TextRect().iTl.iX; |
|
230 } |
|
231 |
|
232 LAYOUT_DP( D_LAYOUT_LIT( "CCALayoutInfo::LayoutChangedL iIconSkip:%d" ) |
|
233 , iIconSkip ); |
|
234 |
|
235 // MsgFont |
|
236 |
|
237 TAknTextLineLayout myMessageLayout = IM_reading_pane_texts_Line_2(); |
|
238 iMsgFont = AknLayoutUtils::FontFromId( myMessageLayout.FontId() ); |
|
239 |
|
240 //Indent |
|
241 //normal message text with indent |
|
242 myTextLayout.LayoutText( myLine.Rect(), myMessageLayout ); |
|
243 |
|
244 //header with full width |
|
245 myMessageHeaderLayout = IM_reading_pane_texts_Line_1( 1 ); |
|
246 myTextLayout2.LayoutText( myLine.Rect(), myMessageHeaderLayout ); |
|
247 |
|
248 if ( iMirrored ) |
|
249 { |
|
250 iIndent = myTextLayout2.TextRect().iBr.iX |
|
251 - myTextLayout.TextRect().iBr.iX; |
|
252 } |
|
253 else |
|
254 { |
|
255 iIndent = myTextLayout.TextRect().iTl.iX |
|
256 - myTextLayout2.TextRect().iTl.iX; |
|
257 } |
|
258 LAYOUT_DP( D_LAYOUT_LIT( "CCALayoutInfo::LayoutChangedL iIndent:%d" ) |
|
259 , iIndent ); |
|
260 |
|
261 // MaxNickWidth |
|
262 |
|
263 myMessageHeaderLayout = IM_reading_pane_texts_Line_1( 0 ); |
|
264 |
|
265 myTextLayout.LayoutText( myLine.Rect(), myMessageHeaderLayout ); |
|
266 |
|
267 iMaxNickWidth = myTextLayout.TextRect().Width() + iIndent; |
|
268 // - myTextLayout2.TextRect().iTl.iX; |
|
269 |
|
270 LAYOUT_DP( D_LAYOUT_LIT( "CCALayoutInfo::LayoutChangedL iMaxNickWidth:%d" ) |
|
271 , iMaxNickWidth ); |
|
272 |
|
273 LAYOUT_DP_TXT( "CCALayoutInfo::LayoutChangedL over" ); |
|
274 } |
|
275 |
|
276 // --------------------------------------------------------- |
|
277 // CCALayoutInfo::NickFont |
|
278 // (other items were commented in a header). |
|
279 // --------------------------------------------------------- |
|
280 // |
|
281 const CFont* CCALayoutInfo::NickFont() |
|
282 { |
|
283 return iNickFont; |
|
284 } |
|
285 |
|
286 // --------------------------------------------------------- |
|
287 // CCALayoutInfo::MessageFont |
|
288 // (other items were commented in a header). |
|
289 // --------------------------------------------------------- |
|
290 // |
|
291 const CFont* CCALayoutInfo::MessageFont() |
|
292 { |
|
293 return iMsgFont; |
|
294 } |
|
295 |
|
296 // --------------------------------------------------------- |
|
297 // CCALayoutInfo::LineHeight |
|
298 // (other items were commented in a header). |
|
299 // --------------------------------------------------------- |
|
300 // |
|
301 TInt CCALayoutInfo::LineHeight() |
|
302 { |
|
303 return iLineHeight; |
|
304 } |
|
305 |
|
306 // --------------------------------------------------------- |
|
307 // CCALayoutInfo::MaxLineWidth |
|
308 // (other items were commented in a header). |
|
309 // --------------------------------------------------------- |
|
310 // |
|
311 TInt CCALayoutInfo::MaxLineWidth() |
|
312 { |
|
313 return iMaxLineWidth; |
|
314 } |
|
315 |
|
316 // --------------------------------------------------------- |
|
317 // CCALayoutInfo::MaxNickWidth |
|
318 // (other items were commented in a header). |
|
319 // --------------------------------------------------------- |
|
320 // |
|
321 TInt CCALayoutInfo::MaxNickWidth() |
|
322 { |
|
323 return iMaxNickWidth; |
|
324 } |
|
325 |
|
326 // --------------------------------------------------------- |
|
327 // CCALayoutInfo::MaxLines |
|
328 // (other items were commented in a header). |
|
329 // --------------------------------------------------------- |
|
330 // |
|
331 TInt CCALayoutInfo::MaxLines() |
|
332 { |
|
333 return iMaxLines; |
|
334 } |
|
335 |
|
336 // --------------------------------------------------------- |
|
337 // CCALayoutInfo::MainPaneRect |
|
338 // (other items were commented in a header). |
|
339 // --------------------------------------------------------- |
|
340 // |
|
341 TRect CCALayoutInfo::MainPaneRect() |
|
342 { |
|
343 return TRect( iMainPaneRect ); |
|
344 } |
|
345 |
|
346 // --------------------------------------------------------- |
|
347 // CCALayoutInfo::SetLayoutID |
|
348 // (other items were commented in a header). |
|
349 // --------------------------------------------------------- |
|
350 // |
|
351 void CCALayoutInfo::SetLayoutID( TChatListBoxLayout::TLayout aLayout ) |
|
352 { |
|
353 iLayoutID = aLayout; |
|
354 TRAPD( err, LayoutChangedL() ); |
|
355 if ( err != KErrNone ) |
|
356 { |
|
357 CActiveScheduler::Current()->Error( err ); |
|
358 } |
|
359 } |
|
360 |
|
361 // --------------------------------------------------------- |
|
362 // CCALayoutInfo::Indent |
|
363 // (other items were commented in a header). |
|
364 // --------------------------------------------------------- |
|
365 // |
|
366 TInt CCALayoutInfo::Indent() |
|
367 { |
|
368 return iIndent; |
|
369 } |
|
370 |
|
371 // --------------------------------------------------------- |
|
372 // CCALayoutInfo::ScreenRect |
|
373 // (other items were commented in a header). |
|
374 // --------------------------------------------------------- |
|
375 // |
|
376 TRect CCALayoutInfo::ScreenRect() |
|
377 { |
|
378 return iScreenRect; |
|
379 } |
|
380 |
|
381 // --------------------------------------------------------- |
|
382 // CCALayoutInfo::SetEditorVisibility |
|
383 // (other items were commented in a header). |
|
384 // --------------------------------------------------------- |
|
385 // |
|
386 void CCALayoutInfo::SetEditorVisibility( TBool aVisible ) |
|
387 { |
|
388 iEditorVisibility = aVisible; |
|
389 } |
|
390 |
|
391 // --------------------------------------------------------- |
|
392 // CCALayoutInfo::EditorVisibility |
|
393 // (other items were commented in a header). |
|
394 // --------------------------------------------------------- |
|
395 // |
|
396 TBool CCALayoutInfo::EditorVisibility() |
|
397 { |
|
398 return iEditorVisibility; |
|
399 } |
|
400 |
|
401 // --------------------------------------------------------- |
|
402 // CCALayoutInfo::SetupMainPaneRect |
|
403 // (other items were commented in a header). |
|
404 // --------------------------------------------------------- |
|
405 // |
|
406 void CCALayoutInfo::SetupMainPaneRect() |
|
407 { |
|
408 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, |
|
409 iMainPaneRect ); |
|
410 _LIT( KMain, "MainPane" ); |
|
411 |
|
412 iMainPaneRect.Move( -iMainPaneRect.iTl.iX, -iMainPaneRect.iTl.iY ); |
|
413 |
|
414 DPRect( KMain, iMainPaneRect ); |
|
415 |
|
416 TRect myControlPane; |
|
417 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EControlPane, |
|
418 myControlPane ); |
|
419 _LIT( KControlPane, "ControlPane" ); |
|
420 DPRect( KControlPane, myControlPane ); |
|
421 //this is screen relative lets move back to origin. |
|
422 } |
|
423 |
|
424 // --------------------------------------------------------- |
|
425 // CCALayoutInfo::im_reading_pane |
|
426 // (other items were commented in a header). |
|
427 // --------------------------------------------------------- |
|
428 // |
|
429 TAknWindowLineLayout CCALayoutInfo::im_reading_pane( TInt aIndex_H ) |
|
430 { |
|
431 return ( *iReadingPane )[ aIndex_H ]; |
|
432 } |
|
433 |
|
434 // --------------------------------------------------------- |
|
435 // CCALayoutInfo::im_reading_field |
|
436 // (other items were commented in a header). |
|
437 // --------------------------------------------------------- |
|
438 // |
|
439 TAknWindowLineLayout CCALayoutInfo::im_reading_field( TInt aIndex_t ) |
|
440 { |
|
441 return ( *iReadingField )[ aIndex_t ]; |
|
442 } |
|
443 |
|
444 // --------------------------------------------------------- |
|
445 // CCALayoutInfo::IM_text_elements |
|
446 // (other items were commented in a header). |
|
447 // --------------------------------------------------------- |
|
448 // |
|
449 TAknWindowLineLayout CCALayoutInfo::IM_text_elements( TInt aLineIndex ) |
|
450 { |
|
451 return ( *iIMTextElements )[ aLineIndex ]; |
|
452 } |
|
453 |
|
454 // --------------------------------------------------------- |
|
455 // CCALayoutInfo::IM_reading_pane_texts_Line_1 |
|
456 // (other items were commented in a header). |
|
457 // --------------------------------------------------------- |
|
458 // |
|
459 TAknTextLineLayout CCALayoutInfo::IM_reading_pane_texts_Line_1( TInt aCommon1 ) |
|
460 { |
|
461 return ( *iReadingPaneTextsLine1 )[ aCommon1 ]; |
|
462 } |
|
463 |
|
464 // --------------------------------------------------------- |
|
465 // CCALayoutInfo::IM_reading_pane_texts_Line_2 |
|
466 // (other items were commented in a header). |
|
467 // --------------------------------------------------------- |
|
468 // |
|
469 TAknTextLineLayout CCALayoutInfo::IM_reading_pane_texts_Line_2() |
|
470 { |
|
471 return iReadingPaneTextsLine2; |
|
472 } |
|
473 |
|
474 // --------------------------------------------------------- |
|
475 // CCALayoutInfo::IM_text_elements_Line_1 |
|
476 // (other items were commented in a header). |
|
477 // --------------------------------------------------------- |
|
478 // |
|
479 TAknWindowLineLayout CCALayoutInfo::IM_text_elements_Line_1() |
|
480 { |
|
481 return AppLayout::IM_text_elements_Line_1(); |
|
482 } |
|
483 |
|
484 // --------------------------------------------------------- |
|
485 // CCALayoutInfo::IM_text_elements_Line_2 |
|
486 // (other items were commented in a header). |
|
487 // --------------------------------------------------------- |
|
488 // |
|
489 TAknWindowLineLayout CCALayoutInfo::IM_text_elements_Line_2() |
|
490 { |
|
491 return AppLayout::IM_text_elements_Line_2(); |
|
492 } |
|
493 |
|
494 // --------------------------------------------------------- |
|
495 // CCALayoutInfo::IM_reading_field_highlight_graphics_Line_1 |
|
496 // (other items were commented in a header). |
|
497 // --------------------------------------------------------- |
|
498 // |
|
499 TAknWindowLineLayout CCALayoutInfo::IM_reading_field_highlight_graphics_Line_1( |
|
500 const TRect& aParentRect ) |
|
501 { |
|
502 return AppLayout::IM_reading_field_highlight_graphics_Line_1( aParentRect ); |
|
503 } |
|
504 |
|
505 // --------------------------------------------------------- |
|
506 // CCALayoutInfo::IM_reading_field_highlight_graphics_Line_2 |
|
507 // (other items were commented in a header). |
|
508 // --------------------------------------------------------- |
|
509 // |
|
510 TAknWindowLineLayout CCALayoutInfo::IM_reading_field_highlight_graphics_Line_2( |
|
511 const TRect& aParentRect ) |
|
512 { |
|
513 return AppLayout::IM_reading_field_highlight_graphics_Line_2( aParentRect ); |
|
514 } |
|
515 |
|
516 // --------------------------------------------------------- |
|
517 // CCALayoutInfo::im_writing_pane |
|
518 // (other items were commented in a header). |
|
519 // --------------------------------------------------------- |
|
520 // |
|
521 TAknWindowLineLayout CCALayoutInfo::im_writing_pane( TInt aCommon1 ) |
|
522 { |
|
523 return ( *iWrittingPane )[ aCommon1 ]; |
|
524 } |
|
525 |
|
526 // --------------------------------------------------------- |
|
527 // CCALayoutInfo::IM_writing_field_elements_Line_1 |
|
528 // (other items were commented in a header). |
|
529 // --------------------------------------------------------- |
|
530 // |
|
531 TAknWindowLineLayout CCALayoutInfo::IM_writing_field_elements_Line_1( |
|
532 TInt aIndex_H ) |
|
533 { |
|
534 return ( *iIMWritingFieldLine1 )[ aIndex_H ]; |
|
535 } |
|
536 |
|
537 // --------------------------------------------------------- |
|
538 // CCALayoutInfo::IM_writing_field_elements_Line_2 |
|
539 // (other items were commented in a header). |
|
540 // --------------------------------------------------------- |
|
541 // |
|
542 TAknWindowLineLayout CCALayoutInfo::IM_writing_field_elements_Line_2() |
|
543 { |
|
544 return iIMWritingFieldLine2; |
|
545 } |
|
546 |
|
547 // --------------------------------------------------------- |
|
548 // CCALayoutInfo::IM_writing_field_elements_Line_3 |
|
549 // (other items were commented in a header). |
|
550 // --------------------------------------------------------- |
|
551 // |
|
552 TAknWindowLineLayout CCALayoutInfo::IM_writing_field_elements_Line_3( |
|
553 TInt aIndex_H ) |
|
554 { |
|
555 return ( *iIMWritingFieldLine3 )[ aIndex_H ]; |
|
556 } |
|
557 |
|
558 // --------------------------------------------------------- |
|
559 // CCALayoutInfo::Multiline_IM_writing_pane_texts_Line_1 |
|
560 // (other items were commented in a header). |
|
561 // --------------------------------------------------------- |
|
562 // |
|
563 TAknMultiLineTextLayout CCALayoutInfo::Multiline_IM_writing_pane_texts_Line_1( |
|
564 TInt aNumberOfLinesShown ) |
|
565 { |
|
566 return ( *iWrittingPaneTextsLine )[ aNumberOfLinesShown ]; |
|
567 } |
|
568 |
|
569 // --------------------------------------------------------- |
|
570 // CCALayoutInfo::IM_navi_pane_texts_Line_1 |
|
571 // (other items were commented in a header). |
|
572 // --------------------------------------------------------- |
|
573 // |
|
574 TAknTextLineLayout CCALayoutInfo::IM_navi_pane_texts_Line_1( |
|
575 TInt aIndex_C, TInt /*aIndex_W*/ ) |
|
576 { |
|
577 return ( *iIMNaviPaneTextsLine1 )[ aIndex_C ]; |
|
578 } |
|
579 |
|
580 // --------------------------------------------------------- |
|
581 // CCALayoutInfo::LogLayout |
|
582 // (other items were commented in a header). |
|
583 // --------------------------------------------------------- |
|
584 // |
|
585 void CCALayoutInfo::LogLayoutL() |
|
586 { |
|
587 #ifdef _DEBUG |
|
588 |
|
589 _LIT( K1, "im_reading_pane( 0 ) " ); |
|
590 DPLayout( K1, AppLayout::im_reading_pane( 0 ) ); |
|
591 DPLayout( K1, im_reading_pane( 0 ) ); |
|
592 _LIT( K2, "im_reading_pane( 1 ) " ); |
|
593 DPLayout( K2, AppLayout::im_reading_pane( 1 ) ); |
|
594 DPLayout( K2, im_reading_pane( 1 ) ); |
|
595 _LIT( K3, "im_reading_pane( 2 ) " ); |
|
596 DPLayout( K3, AppLayout::im_reading_pane( 2 ) ); |
|
597 DPLayout( K3, im_reading_pane( 2 ) ); |
|
598 |
|
599 _LIT( KWP1, "im_writing_pane( 0 )" ); |
|
600 DPLayout( KWP1, AppLayout::im_writing_pane( 0 ) ); |
|
601 DPLayout( KWP1, im_writing_pane( 0 ) ); |
|
602 _LIT( KWP2, "im_writing_pane( 1 )" ); |
|
603 DPLayout( KWP2, AppLayout::im_writing_pane( 1 ) ); |
|
604 DPLayout( KWP2, im_writing_pane( 1 ) ); |
|
605 |
|
606 _LIT( K4, "im_reading_field( 0 ) " ); |
|
607 DPLayout( K4, AppLayout::im_reading_field( 0 ) ); |
|
608 DPLayout( K4, im_reading_field( 0 ) ); |
|
609 _LIT( K5, "im_reading_field( 1 ) " ); |
|
610 DPLayout( K5, AppLayout::im_reading_field( 1 ) ); |
|
611 DPLayout( K5, im_reading_field( 1 ) ); |
|
612 _LIT( K6, "im_reading_field( 2 ) " ); |
|
613 DPLayout( K6, AppLayout::im_reading_field( 2 ) ); |
|
614 DPLayout( K6, im_reading_field( 2 ) ); |
|
615 _LIT( K7, "im_reading_field( 3 ) " ); |
|
616 DPLayout( K7, AppLayout::im_reading_field( 3 ) ); |
|
617 DPLayout( K7, im_reading_field( 3 ) ); |
|
618 _LIT( K8, "im_reading_field( 4 ) " ); |
|
619 DPLayout( K8, AppLayout::im_reading_field( 4 ) ); |
|
620 DPLayout( K8, im_reading_field( 4 ) ); |
|
621 _LIT( K9, "im_reading_field( 5 ) " ); |
|
622 DPLayout( K9, AppLayout::im_reading_field( 5 ) ); |
|
623 DPLayout( K9, im_reading_field( 5 ) ); |
|
624 _LIT( K10, "im_reading_field( 6 ) " ); |
|
625 DPLayout( K10, AppLayout::im_reading_field( 6 ) ); |
|
626 DPLayout( K10, im_reading_field( 6 ) ); |
|
627 |
|
628 TAknLayoutScalableParameterLimits limits( |
|
629 AknLayoutScalable_Apps::list_im_single_pane_ParamLimits() ); |
|
630 |
|
631 if ( 7 <= limits.LastRow() ) |
|
632 { |
|
633 _LIT( K11, "im_reading_field( 7 ) " ); |
|
634 DPLayout( K11, AppLayout::im_reading_field( 7 ) ); |
|
635 DPLayout( K11, im_reading_field( 7 ) ); |
|
636 } |
|
637 |
|
638 _LIT( KRPT0, "IM_reading_pane_texts_Line_1( 0 )" ); |
|
639 DPLayout( KRPT0, AppLayout::IM_reading_pane_texts_Line_1( 0 ) ); |
|
640 DPLayout( KRPT0, IM_reading_pane_texts_Line_1( 0 ) ); |
|
641 _LIT( KRPT1, "IM_reading_pane_texts_Line_1( 1 )" ); |
|
642 DPLayout( KRPT1, AppLayout::IM_reading_pane_texts_Line_1( 1 ) ); |
|
643 DPLayout( KRPT1, IM_reading_pane_texts_Line_1( 1 ) ); |
|
644 _LIT( KRPT2, "IM_reading_pane_texts_Line_1( 2 )" ); |
|
645 DPLayout( KRPT2, AppLayout::IM_reading_pane_texts_Line_1( 2 ) ); |
|
646 DPLayout( KRPT2, IM_reading_pane_texts_Line_1( 2 ) ); |
|
647 _LIT( KRPT3, "IM_reading_pane_texts_Line_2()" ); |
|
648 DPLayout( KRPT3, AppLayout::IM_reading_pane_texts_Line_2() ); |
|
649 DPLayout( KRPT3, IM_reading_pane_texts_Line_2() ); |
|
650 |
|
651 _LIT( KIMT1, "IM_text_elements( 0 )" ); |
|
652 DPLayout( KIMT1, AppLayout::IM_text_elements( 0 ) ); |
|
653 DPLayout( KIMT1, IM_text_elements( 0 ) ); |
|
654 _LIT( KIMT2, "IM_text_elements( 1 )" ); |
|
655 DPLayout( KIMT2, AppLayout::IM_text_elements( 1 ) ); |
|
656 DPLayout( KIMT2, IM_text_elements( 1 ) ); |
|
657 _LIT( KIMT3, "IM_text_elements( 2 )" ); |
|
658 DPLayout( KIMT3, AppLayout::IM_text_elements( 2 ) ); |
|
659 DPLayout( KIMT3, IM_text_elements( 2 ) ); |
|
660 |
|
661 _LIT( KMWPT0, "Multiline_IM_writing_pane_texts_Line_1( 0 )" ); |
|
662 DPLayout( KMWPT0, AppLayout::Multiline_IM_writing_pane_texts_Line_1( 0 ) ); |
|
663 DPLayout( KMWPT0, Multiline_IM_writing_pane_texts_Line_1( 0 ) ); |
|
664 |
|
665 _LIT( KMWPT1, "Multiline_IM_writing_pane_texts_Line_1( 1 )" ); |
|
666 DPLayout( KMWPT1, AppLayout::Multiline_IM_writing_pane_texts_Line_1( 1 ) ); |
|
667 DPLayout( KMWPT1, Multiline_IM_writing_pane_texts_Line_1( 1 ) ); |
|
668 |
|
669 _LIT( KMWPT2, "Multiline_IM_writing_pane_texts_Line_1( 2 )" ); |
|
670 DPLayout( KMWPT2, AppLayout::Multiline_IM_writing_pane_texts_Line_1( 2 ) ); |
|
671 DPLayout( KMWPT2, Multiline_IM_writing_pane_texts_Line_1( 2 ) ); |
|
672 |
|
673 _LIT( KWFL10, "IM_writing_field_elements_Line_1( 0 )" ); |
|
674 DPLayout( KWFL10, AppLayout::IM_writing_field_elements_Line_1( 0 ) ); |
|
675 DPLayout( KWFL10, IM_writing_field_elements_Line_1( 0 ) ); |
|
676 |
|
677 _LIT( KWFL11, "IM_writing_field_elements_Line_1( 1 )" ); |
|
678 DPLayout( KWFL11, AppLayout::IM_writing_field_elements_Line_1( 1 ) ); |
|
679 DPLayout( KWFL11, IM_writing_field_elements_Line_1( 1 ) ); |
|
680 |
|
681 _LIT( KWFL2, "IM_writing_field_elements_Line_2()" ); |
|
682 DPLayout( KWFL2, AppLayout::IM_writing_field_elements_Line_2() ); |
|
683 DPLayout( KWFL2, IM_writing_field_elements_Line_2() ); |
|
684 |
|
685 _LIT( KWFL30, "IM_writing_field_elements_Line_3( 0 )" ); |
|
686 DPLayout( KWFL30, AppLayout::IM_writing_field_elements_Line_3( 0 ) ); |
|
687 DPLayout( KWFL30, IM_writing_field_elements_Line_3( 0 ) ); |
|
688 |
|
689 _LIT( KWFL31, "IM_writing_field_elements_Line_3( 1 )" ); |
|
690 DPLayout( KWFL31, AppLayout::IM_writing_field_elements_Line_3( 1 ) ); |
|
691 DPLayout( KWFL31, IM_writing_field_elements_Line_3( 1 ) ); |
|
692 |
|
693 HBufC* myStr = HBufC::NewLC( 60 ); |
|
694 TPtr myPtr = myStr->Des(); |
|
695 |
|
696 _LIT( KNPTL, "IM_navi_pane_texts_Line_1( " ); |
|
697 _LIT( KNPTL0, "AppLayout::" ); |
|
698 _LIT( KNPTL1, ", 0 )" ); |
|
699 _LIT( KNPTL2, ", 1 )" ); |
|
700 TInt i( 0 ); |
|
701 for ( i = 0; i < 10; i++ ) |
|
702 { |
|
703 myPtr.Copy( KNPTL0() ); |
|
704 myPtr.Append( KNPTL() ); |
|
705 myPtr.AppendNum( i ); |
|
706 myPtr.Append( KNPTL1() ); |
|
707 DPLayout( myPtr, IM_navi_pane_texts_Line_1( i , 0 ) ); |
|
708 |
|
709 myPtr.Copy( KNPTL() ); |
|
710 myPtr.AppendNum( i ); |
|
711 myPtr.Append( KNPTL1() ); |
|
712 DPLayout( myPtr, IM_navi_pane_texts_Line_1( i , 0 ) ); |
|
713 } |
|
714 for ( i = 0; i < 10; i++ ) |
|
715 { |
|
716 myPtr.Copy( KNPTL0() ); |
|
717 myPtr.Append( KNPTL() ); |
|
718 myPtr.AppendNum( i ); |
|
719 myPtr.Append( KNPTL2() ); |
|
720 DPLayout( myPtr, IM_navi_pane_texts_Line_1( i , 1 ) ); |
|
721 |
|
722 myPtr.Copy( KNPTL() ); |
|
723 myPtr.AppendNum( i ); |
|
724 myPtr.Append( KNPTL2() ); |
|
725 DPLayout( myPtr, IM_navi_pane_texts_Line_1( i , 1 ) ); |
|
726 } |
|
727 |
|
728 CleanupStack::PopAndDestroy( myStr ); |
|
729 |
|
730 #endif // _DEBUG |
|
731 } |
|
732 |
|
733 // --------------------------------------------------------- |
|
734 // CCALayoutInfo::DPLayout |
|
735 // (other items were commented in a header). |
|
736 // --------------------------------------------------------- |
|
737 // |
|
738 void CCALayoutInfo::DPLayout( const TDesC& aStr, const TAknTextLineLayout aLayout ) |
|
739 { |
|
740 TPtrC myStr( aStr ); |
|
741 LAYOUT_DP( D_LAYOUT_LIT( |
|
742 "%S iC il ir iB iW iJ iFont iBaselineSkip iNumberOfLinesShown" ) |
|
743 , &myStr ); |
|
744 LAYOUT_DP( D_LAYOUT_LIT( "%d %d %d %d %d %d %d %d %d" ), aLayout.iC |
|
745 , aLayout.il |
|
746 , aLayout.ir |
|
747 , aLayout.iB |
|
748 , aLayout.iW |
|
749 , aLayout.iJ |
|
750 , aLayout.iFont |
|
751 , aLayout.iBaselineSkip |
|
752 , aLayout.iNumberOfLinesShown ); |
|
753 } |
|
754 |
|
755 // --------------------------------------------------------- |
|
756 // CCALayoutInfo::DPLayout |
|
757 // (other items were commented in a header). |
|
758 // --------------------------------------------------------- |
|
759 // |
|
760 void CCALayoutInfo::DPLayout( const TDesC& aStr, |
|
761 const TAknWindowLineLayout aLayout ) |
|
762 { |
|
763 TPtrC myStr( aStr ); |
|
764 LAYOUT_DP( D_LAYOUT_LIT( "%S iC il it ir ib iW iH" ), &myStr ); |
|
765 LAYOUT_DP( D_LAYOUT_LIT( "%d %d %d %d %d %d %d" ) |
|
766 , aLayout.iC |
|
767 , aLayout.il |
|
768 , aLayout.it |
|
769 , aLayout.ir |
|
770 , aLayout.ib |
|
771 , aLayout.iW |
|
772 , aLayout.iH ); |
|
773 } |
|
774 |
|
775 // --------------------------------------------------------- |
|
776 // CCALayoutInfo::DPRect |
|
777 // (other items were commented in a header). |
|
778 // --------------------------------------------------------- |
|
779 // |
|
780 void CCALayoutInfo::DPRect( const TDesC& aStr, const TRect& aRect ) |
|
781 { |
|
782 TPtrC myStr( aStr ); |
|
783 LAYOUT_DP( D_LAYOUT_LIT( "%S TRect %d %d %d %d" ), &myStr |
|
784 , aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY ); |
|
785 } |
|
786 |
|
787 // --------------------------------------------------------- |
|
788 // CCALayoutInfo::FillLayoutL |
|
789 // (other items were commented in a header). |
|
790 // --------------------------------------------------------- |
|
791 // |
|
792 void CCALayoutInfo::FillLayoutL() |
|
793 { |
|
794 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, iScreenRect ); |
|
795 if ( iLastScreenRect != iScreenRect ) |
|
796 { |
|
797 FillReadingPaneL(); |
|
798 FillWrittingPaneL(); |
|
799 FillReadingFieldL(); |
|
800 FillReadingPaneTextsLine1L(); |
|
801 FillReadingPaneTextsLine2(); |
|
802 FillIMTextElementsL(); |
|
803 FillWrittingPaneTextsLineL(); |
|
804 FillIMWritingFieldLine1L(); |
|
805 FillIMWritingFieldLine2(); |
|
806 FillIMWritingFieldLine3L(); |
|
807 FillIMNaviPaneTextsLineL(); |
|
808 } |
|
809 iLastScreenRect = iScreenRect; |
|
810 } |
|
811 |
|
812 // --------------------------------------------------------- |
|
813 // CCALayoutInfo::FillReadingPaneL |
|
814 // (other items were commented in a header). |
|
815 // --------------------------------------------------------- |
|
816 // |
|
817 void CCALayoutInfo::FillReadingPaneL() |
|
818 { |
|
819 if ( iReadingPane ) |
|
820 { |
|
821 iReadingPane->Reset(); |
|
822 delete iReadingPane; |
|
823 iReadingPane = NULL; |
|
824 } |
|
825 |
|
826 iReadingPane = new( ELeave )CArrayFixFlat<TAknWindowLineLayout>( 3 ); |
|
827 for ( TInt i( 0 ); i < 3; i++ ) |
|
828 { |
|
829 iReadingPane->AppendL( AppLayout::im_reading_pane( i ) ); |
|
830 } |
|
831 } |
|
832 |
|
833 // --------------------------------------------------------- |
|
834 // CCALayoutInfo::FillReadingFieldL |
|
835 // (other items were commented in a header). |
|
836 // --------------------------------------------------------- |
|
837 // |
|
838 void CCALayoutInfo::FillReadingFieldL() |
|
839 { |
|
840 if ( iReadingField ) |
|
841 { |
|
842 iReadingField->Reset(); |
|
843 delete iReadingField; |
|
844 iReadingField = NULL; |
|
845 } |
|
846 |
|
847 TAknLayoutScalableParameterLimits limits( |
|
848 AknLayoutScalable_Apps::list_im_single_pane_ParamLimits() ); |
|
849 |
|
850 // items from FirstRow to LastRow |
|
851 iReadingField = new( ELeave )CArrayFixFlat<TAknWindowLineLayout>( |
|
852 limits.LastRow() - limits.FirstRow() + 1 ); |
|
853 |
|
854 for ( TInt i( limits.FirstRow() ); i <= limits.LastRow(); ++i ) |
|
855 { |
|
856 iReadingField->AppendL( AppLayout::im_reading_field( i ) ); |
|
857 } |
|
858 } |
|
859 |
|
860 // --------------------------------------------------------- |
|
861 // CCALayoutInfo::FillReadingPaneTextsLine1 |
|
862 // (other items were commented in a header). |
|
863 // --------------------------------------------------------- |
|
864 // |
|
865 void CCALayoutInfo::FillReadingPaneTextsLine1L() |
|
866 { |
|
867 if ( iReadingPaneTextsLine1 ) |
|
868 { |
|
869 iReadingPaneTextsLine1->Reset(); |
|
870 delete iReadingPaneTextsLine1; |
|
871 iReadingPaneTextsLine1 = NULL; |
|
872 } |
|
873 |
|
874 iReadingPaneTextsLine1 = new( ELeave )CArrayFixFlat<TAknTextLineLayout>( 3 ); |
|
875 for ( TInt i( 0 ); i < 3; i++ ) |
|
876 { |
|
877 iReadingPaneTextsLine1->AppendL( |
|
878 AppLayout::IM_reading_pane_texts_Line_1( i ) ); |
|
879 } |
|
880 } |
|
881 |
|
882 // --------------------------------------------------------- |
|
883 // CCALayoutInfo::FillIMTextElementsL |
|
884 // (other items were commented in a header). |
|
885 // --------------------------------------------------------- |
|
886 // |
|
887 void CCALayoutInfo::FillIMTextElementsL() |
|
888 { |
|
889 if ( iIMTextElements ) |
|
890 { |
|
891 iIMTextElements->Reset(); |
|
892 delete iIMTextElements; |
|
893 iIMTextElements = NULL; |
|
894 } |
|
895 |
|
896 iIMTextElements = new( ELeave )CArrayFixFlat<TAknWindowLineLayout>( 3 ); |
|
897 for ( TInt i( 0 ); i < 3; i++ ) |
|
898 { |
|
899 iIMTextElements->AppendL( AppLayout::IM_text_elements( i ) ); |
|
900 } |
|
901 } |
|
902 |
|
903 // --------------------------------------------------------- |
|
904 // CCALayoutInfo::FillReadingPaneTextsLine2 |
|
905 // (other items were commented in a header). |
|
906 // --------------------------------------------------------- |
|
907 // |
|
908 void CCALayoutInfo::FillReadingPaneTextsLine2() |
|
909 { |
|
910 iReadingPaneTextsLine2 = AppLayout::IM_reading_pane_texts_Line_2(); |
|
911 } |
|
912 |
|
913 // --------------------------------------------------------- |
|
914 // CCALayoutInfo::FillWrittingPaneTextsLineL |
|
915 // (other items were commented in a header). |
|
916 // --------------------------------------------------------- |
|
917 // |
|
918 void CCALayoutInfo::FillWrittingPaneTextsLineL() |
|
919 { |
|
920 if ( iWrittingPaneTextsLine ) |
|
921 { |
|
922 iWrittingPaneTextsLine->Reset(); |
|
923 delete iWrittingPaneTextsLine; |
|
924 iWrittingPaneTextsLine = NULL; |
|
925 } |
|
926 |
|
927 iWrittingPaneTextsLine = new( ELeave )CArrayFixFlat<TAknMultiLineTextLayout>( 3 ); |
|
928 for ( TInt i( 0 ); i < 3; i++ ) |
|
929 { |
|
930 iWrittingPaneTextsLine->AppendL( |
|
931 AppLayout::Multiline_IM_writing_pane_texts_Line_1( i ) ); |
|
932 } |
|
933 } |
|
934 |
|
935 // --------------------------------------------------------- |
|
936 // CCALayoutInfo::FillIMWritingFieldLine1 |
|
937 // (other items were commented in a header). |
|
938 // --------------------------------------------------------- |
|
939 // |
|
940 void CCALayoutInfo::FillIMWritingFieldLine1L() |
|
941 { |
|
942 if ( iIMWritingFieldLine1 ) |
|
943 { |
|
944 iIMWritingFieldLine1->Reset(); |
|
945 delete iIMWritingFieldLine1; |
|
946 iIMWritingFieldLine1 = NULL; |
|
947 } |
|
948 |
|
949 iIMWritingFieldLine1 = new( ELeave )CArrayFixFlat<TAknWindowLineLayout>( 3 ); |
|
950 for ( TInt i( 0 ); i < 2; i++ ) |
|
951 { |
|
952 iIMWritingFieldLine1->AppendL( |
|
953 AppLayout::IM_writing_field_elements_Line_1( i ) ); |
|
954 } |
|
955 } |
|
956 |
|
957 // --------------------------------------------------------- |
|
958 // CCALayoutInfo::FillIMWritingFieldLine2 |
|
959 // (other items were commented in a header). |
|
960 // --------------------------------------------------------- |
|
961 // |
|
962 void CCALayoutInfo::FillIMWritingFieldLine2() |
|
963 { |
|
964 iIMWritingFieldLine2 = |
|
965 AppLayout::IM_writing_field_elements_Line_2(); |
|
966 iIMWritingFieldLine2.iH = 1; |
|
967 iIMWritingFieldLine2.iW = ELayoutP; |
|
968 iIMWritingFieldLine2.iC = 221; |
|
969 } |
|
970 |
|
971 // --------------------------------------------------------- |
|
972 // CCALayoutInfo::FillIMWritingFieldLine3L |
|
973 // (other items were commented in a header). |
|
974 // --------------------------------------------------------- |
|
975 // |
|
976 void CCALayoutInfo::FillIMWritingFieldLine3L() |
|
977 { |
|
978 if ( iIMWritingFieldLine3 ) |
|
979 { |
|
980 iIMWritingFieldLine3->Reset(); |
|
981 delete iIMWritingFieldLine3; |
|
982 iIMWritingFieldLine3 = NULL; |
|
983 } |
|
984 |
|
985 iIMWritingFieldLine3 = new ( ELeave ) CArrayFixFlat< TAknWindowLineLayout >( |
|
986 3 ); |
|
987 for ( TInt i( 0 ); i < 2; i++ ) |
|
988 { |
|
989 iIMWritingFieldLine3->AppendL( |
|
990 AppLayout::IM_writing_field_elements_Line_3( i ) ); |
|
991 } |
|
992 } |
|
993 |
|
994 // --------------------------------------------------------- |
|
995 // CCALayoutInfo::FillWrittingPaneL |
|
996 // (other items were commented in a header). |
|
997 // --------------------------------------------------------- |
|
998 // |
|
999 void CCALayoutInfo::FillWrittingPaneL() |
|
1000 { |
|
1001 if ( iWrittingPane ) |
|
1002 { |
|
1003 iWrittingPane->Reset(); |
|
1004 delete iWrittingPane; |
|
1005 iWrittingPane = NULL; |
|
1006 } |
|
1007 |
|
1008 iWrittingPane = new( ELeave )CArrayFixFlat<TAknWindowLineLayout>( 2 ); |
|
1009 for ( TInt i( 0 ); i < 2; i++ ) |
|
1010 { |
|
1011 iWrittingPane->AppendL( AppLayout::im_writing_pane( i ) ); |
|
1012 } |
|
1013 } |
|
1014 |
|
1015 // --------------------------------------------------------- |
|
1016 // CCALayoutInfo::FillIMNaviPaneTextsLine |
|
1017 // (other items were commented in a header). |
|
1018 // --------------------------------------------------------- |
|
1019 // |
|
1020 void CCALayoutInfo::FillIMNaviPaneTextsLineL() |
|
1021 { |
|
1022 // fader colors from LAF. These are hardcoded as the LAF (impl.) adviced. |
|
1023 const TInt16 colors[] = { 234, 232, 230, 228, 226, 0, 226, 227, 228, 229 }; |
|
1024 |
|
1025 if ( iIMNaviPaneTextsLine1 ) |
|
1026 { |
|
1027 iIMNaviPaneTextsLine1->Reset(); |
|
1028 delete iIMNaviPaneTextsLine1; |
|
1029 iIMNaviPaneTextsLine1 = NULL; |
|
1030 } |
|
1031 |
|
1032 iIMNaviPaneTextsLine1 = |
|
1033 new ( ELeave ) CArrayFixFlat<TAknTextLineLayout>( 10 ); |
|
1034 |
|
1035 TAknTextLineLayout text; |
|
1036 for ( TInt i( 0 ); i < 10; i++ ) |
|
1037 { |
|
1038 text = AknLayoutScalable_Apps::navi_pane_im_t1(); |
|
1039 text.iC = colors[ i ]; |
|
1040 iIMNaviPaneTextsLine1->AppendL( text ); |
|
1041 } |
|
1042 } |
|
1043 |
|
1044 // End of File |