64
|
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: FreestyleEmailUi layout data handler implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// SYSTEM INCLUDE FILES
|
|
20 |
#include "emailtrace.h"
|
|
21 |
#include <alf/alftextstylemanager.h>
|
|
22 |
#include <AknsUtils.h>
|
|
23 |
#include <AknsSkinInstance.h>
|
|
24 |
#include <alf/alfstatic.h>
|
|
25 |
|
|
26 |
#include <aknlayoutscalable_apps.cdl.h>
|
|
27 |
#include <aknlayoutscalable_avkon.cdl.h>
|
|
28 |
#include <layoutmetadata.cdl.h>
|
|
29 |
#include <fslayoutmanager.h>
|
|
30 |
|
|
31 |
// For generic treelist layout data setting
|
|
32 |
#include "fstreelist.h"
|
|
33 |
|
|
34 |
// INTERNAL INCLUDE FILES
|
|
35 |
#include "FreestyleEmailUiLayoutHandler.h"
|
|
36 |
#include "FreestyleEmailUiLayoutData.h"
|
|
37 |
|
|
38 |
const TInt KPopupMargin = 8;
|
|
39 |
|
|
40 |
// -----------------------------------------------------------------------------
|
|
41 |
// GeneralHash
|
|
42 |
// -----------------------------------------------------------------------------
|
|
43 |
//
|
|
44 |
template< typename T >
|
|
45 |
TUint32 GeneralHash( const T& aValue )
|
|
46 |
{
|
|
47 |
return DefaultHash::Des8( TPckgC< T >( aValue ) );
|
|
48 |
}
|
|
49 |
|
|
50 |
// -----------------------------------------------------------------------------
|
|
51 |
// GeneralPtrIdentity
|
|
52 |
// -----------------------------------------------------------------------------
|
|
53 |
//
|
|
54 |
template< typename T >
|
|
55 |
TBool GeneralPtrIdentity( const T& aP1, const T& aP2 )
|
|
56 |
{
|
|
57 |
return TPckgC< T >( aP1 ) == TPckgC< T >( aP2 );
|
|
58 |
}
|
|
59 |
|
|
60 |
// -----------------------------------------------------------------------------
|
|
61 |
// CFSEmailUiLayoutHandler::CFSEmailUiLayoutHandler
|
|
62 |
// Base construction. May not leave.
|
|
63 |
// -----------------------------------------------------------------------------
|
|
64 |
//
|
|
65 |
CFSEmailUiLayoutHandler::CFSEmailUiLayoutHandler( CAlfEnv& aEnv )
|
|
66 |
: iEnv(aEnv),
|
|
67 |
iTextStyleMap( THashFunction32< TAknTextComponentLayout >( GeneralHash ),
|
|
68 |
TIdentityRelation< TAknTextComponentLayout >( GeneralPtrIdentity< TAknTextComponentLayout > ) )
|
|
69 |
{
|
|
70 |
FUNC_LOG;
|
|
71 |
}
|
|
72 |
|
|
73 |
// -----------------------------------------------------------------------------
|
|
74 |
// CFSEmailUiLayoutHandler::NewL
|
|
75 |
// First phase construction function.
|
|
76 |
// -----------------------------------------------------------------------------
|
|
77 |
//
|
|
78 |
CFSEmailUiLayoutHandler* CFSEmailUiLayoutHandler::NewL( CAlfEnv& aEnv )
|
|
79 |
{
|
|
80 |
FUNC_LOG;
|
|
81 |
CFSEmailUiLayoutHandler* self = new ( ELeave ) CFSEmailUiLayoutHandler( aEnv );
|
|
82 |
CleanupStack::PushL( self );
|
|
83 |
self->ConstructL();
|
|
84 |
CleanupStack::Pop( self );
|
|
85 |
return self;
|
|
86 |
}
|
|
87 |
|
|
88 |
// -----------------------------------------------------------------------------
|
|
89 |
// CFSEmailUiLayoutHandler::ConstructL
|
|
90 |
// Symbian second phase construction. May leave.
|
|
91 |
// -----------------------------------------------------------------------------
|
|
92 |
//
|
|
93 |
void CFSEmailUiLayoutHandler::ConstructL()
|
|
94 |
{
|
|
95 |
FUNC_LOG;
|
|
96 |
}
|
|
97 |
|
|
98 |
// -----------------------------------------------------------------------------
|
|
99 |
// CFSEmailUiLayoutHandler::~CFSEmailUiLayoutHandler
|
|
100 |
// D'tor
|
|
101 |
// -----------------------------------------------------------------------------
|
|
102 |
//
|
|
103 |
CFSEmailUiLayoutHandler::~CFSEmailUiLayoutHandler()
|
|
104 |
{
|
|
105 |
FUNC_LOG;
|
|
106 |
DeleteTextStyles();
|
|
107 |
}
|
|
108 |
|
|
109 |
// -----------------------------------------------------------------------------
|
|
110 |
// CFSEmailUiLayoutHandler::ScreenOrientation
|
|
111 |
// Function can be used to fetch orientation of the current screen resolution
|
|
112 |
// -----------------------------------------------------------------------------
|
|
113 |
//
|
|
114 |
TScreenOrientation CFSEmailUiLayoutHandler::ScreenOrientation() const
|
|
115 |
{
|
|
116 |
FUNC_LOG;
|
|
117 |
return Layout_Meta_Data::IsLandscapeOrientation() ? ELandscape : EPortrait;
|
|
118 |
}
|
|
119 |
|
|
120 |
// -----------------------------------------------------------------------------
|
|
121 |
// CFSEmailUiLayoutHandler::GridRowsInThisResolution
|
|
122 |
// -----------------------------------------------------------------------------
|
|
123 |
//
|
|
124 |
TInt CFSEmailUiLayoutHandler::GridRowsInThisResolution() const
|
|
125 |
{
|
|
126 |
FUNC_LOG;
|
|
127 |
const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 );
|
|
128 |
return AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastRow() + 1;
|
|
129 |
}
|
|
130 |
|
|
131 |
|
|
132 |
// -----------------------------------------------------------------------------
|
|
133 |
// CFSEmailUiLayoutHandler::GridColumnsInThisResolution
|
|
134 |
// -----------------------------------------------------------------------------
|
|
135 |
//
|
|
136 |
TInt CFSEmailUiLayoutHandler::GridColumnsInThisResolution() const
|
|
137 |
{
|
|
138 |
FUNC_LOG;
|
|
139 |
const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 );
|
|
140 |
return AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastColumn() + 1;
|
|
141 |
}
|
|
142 |
|
|
143 |
// -----------------------------------------------------------------------------
|
|
144 |
// CFSEmailUiLayoutHandler::GridIconSize
|
|
145 |
// -----------------------------------------------------------------------------
|
|
146 |
//
|
|
147 |
TRgb CFSEmailUiLayoutHandler::GridNormalStateTextSkinColor() const
|
|
148 |
{
|
|
149 |
FUNC_LOG;
|
|
150 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
151 |
TRgb textColor;
|
|
152 |
// Should use EAknsCIFsTextColorsCG3 if background is white
|
|
153 |
if ( AknsUtils::GetCachedColor( skin, textColor,
|
|
154 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
|
|
155 |
{
|
|
156 |
textColor = KRgbBlack;
|
|
157 |
}
|
|
158 |
return textColor;
|
|
159 |
}
|
|
160 |
|
|
161 |
// -----------------------------------------------------------------------------
|
|
162 |
// CFSEmailUiLayoutHandler::GridIconSize
|
|
163 |
// -----------------------------------------------------------------------------
|
|
164 |
//
|
|
165 |
TSize CFSEmailUiLayoutHandler::GridIconSize() const
|
|
166 |
{
|
|
167 |
FUNC_LOG;
|
|
168 |
// <cmail> Use layout data instead of hard-coded values
|
|
169 |
TRect mainPaneRect;
|
|
170 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
171 |
|
|
172 |
TAknLayoutRect scrollBarRect;
|
|
173 |
scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::aid_size_touch_scroll_bar());
|
|
174 |
TRect gridRect = mainPaneRect;
|
|
175 |
gridRect.iBr.iX -= scrollBarRect.Rect().Width();
|
|
176 |
|
|
177 |
TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0;
|
|
178 |
TAknLayoutRect itemRect;
|
|
179 |
itemRect.LayoutRect(gridRect, AknLayoutScalable_Apps::cell_cmail_l_pane(var,0,0));
|
|
180 |
|
|
181 |
TAknLayoutRect gridIconLRect;
|
|
182 |
gridIconLRect.LayoutRect( itemRect.Rect(), AknLayoutScalable_Apps::cell_cmail_l_pane_g1( 0 ) );
|
|
183 |
TSize iconSize = gridIconLRect.Rect().Size();
|
|
184 |
return iconSize;
|
|
185 |
}
|
|
186 |
|
|
187 |
|
|
188 |
TSize CFSEmailUiLayoutHandler::MailIconSizeInThisResolution() const
|
|
189 |
{
|
|
190 |
FUNC_LOG;
|
|
191 |
TAknLayoutRect rect;
|
|
192 |
rect.LayoutRect( TRect( 0, 0, 0, 0 ),
|
|
193 |
AknLayoutScalable_Apps::list_single_dyc_row_pane_g1( 0 ).LayoutLine() );
|
|
194 |
return rect.Rect().Size();
|
|
195 |
}
|
|
196 |
|
|
197 |
|
|
198 |
// -----------------------------------------------------------------------------
|
|
199 |
// CFSEmailUiLayoutHandler::SetListMarqueeBehaviour
|
|
200 |
// Function sets FS Email UI default values for marquee behavioutr for treelist object
|
|
201 |
// -----------------------------------------------------------------------------
|
|
202 |
//
|
|
203 |
void CFSEmailUiLayoutHandler::SetListMarqueeBehaviour( CFsTreeList* aTreeList ) const
|
|
204 |
{
|
|
205 |
FUNC_LOG;
|
|
206 |
if ( aTreeList ) // Safety check
|
|
207 |
{
|
|
208 |
aTreeList->SetTextMarqueeType( KListTextMarqueeType );
|
|
209 |
aTreeList->SetTextMarqueeSpeed ( KListTextMarqueeSpeed );
|
|
210 |
aTreeList->SetTextMarqueeStartDelay ( KListTextMarqueeStartDelay );
|
|
211 |
aTreeList->SetTextMarqueeRepetitions ( KListTextMarqueeSpeedRepeats );
|
|
212 |
}
|
|
213 |
}
|
|
214 |
|
|
215 |
// -----------------------------------------------------------------------------
|
|
216 |
// CFSEmailUiLayoutHandler::FolderListIconSizeInThisResolution
|
|
217 |
// Folder list icon size, calculated based on the item size
|
|
218 |
// -----------------------------------------------------------------------------
|
|
219 |
//
|
|
220 |
TSize CFSEmailUiLayoutHandler::FolderListIconSize( const TBool aPopup ) const
|
|
221 |
{
|
|
222 |
FUNC_LOG;
|
|
223 |
if ( aPopup )
|
|
224 |
{
|
|
225 |
TAknWindowComponentLayout g1Layout( TAknWindowComponentLayout::Compose(
|
|
226 |
AknLayoutScalable_Apps::list_single_dyc_row_pane( 0 ),
|
|
227 |
AknLayoutScalable_Apps::list_single_dyc_row_pane_g1( 0 ) ) );
|
|
228 |
TAknLayoutRect paneG1;
|
|
229 |
paneG1.LayoutRect( DropDownMenuListRect( ELeft, EFalse ), g1Layout.LayoutLine() );
|
|
230 |
return paneG1.Rect().Size();
|
|
231 |
}
|
|
232 |
else
|
|
233 |
{
|
|
234 |
TRect mainPaneRect;
|
|
235 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
236 |
|
|
237 |
TAknLayoutRect scrollBarRect;
|
|
238 |
scrollBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Avkon::scroll_pane());
|
|
239 |
TRect gridRect = mainPaneRect;
|
|
240 |
gridRect.iBr.iX -= scrollBarRect.Rect().Width();
|
|
241 |
|
|
242 |
TAknLayoutRect itemRect;
|
|
243 |
itemRect.LayoutRect( gridRect, AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1( 0 ).LayoutLine() );
|
|
244 |
|
|
245 |
return itemRect.Rect().Size();
|
|
246 |
}
|
|
247 |
}
|
|
248 |
|
|
249 |
// -----------------------------------------------------------------------------
|
|
250 |
// CFSEmailUiLayoutHandler::FolderListPaneRectInThisResolution
|
|
251 |
// Folder list pane rect, taken from Avkon layouts
|
|
252 |
// -----------------------------------------------------------------------------
|
|
253 |
//
|
|
254 |
TRect CFSEmailUiLayoutHandler::FolderListPaneRectInThisResolution( const TRect& aParent) const
|
|
255 |
{
|
|
256 |
FUNC_LOG;
|
|
257 |
TAknLayoutRect itemRect;
|
|
258 |
itemRect.LayoutRect(aParent, AknLayoutScalable_Avkon::listscroll_gen_pane(0,0,0));
|
|
259 |
return itemRect.Rect();
|
|
260 |
}
|
|
261 |
|
|
262 |
// -----------------------------------------------------------------------------
|
|
263 |
// CFSEmailUiLayoutHandler::FolderListIndentation
|
|
264 |
// Folder list pane indentation in pixels, taken from Avkon layouts
|
|
265 |
// -----------------------------------------------------------------------------
|
|
266 |
//
|
|
267 |
TInt CFSEmailUiLayoutHandler::FolderListIndentation( const TRect& aParent ) const
|
|
268 |
{
|
|
269 |
FUNC_LOG;
|
|
270 |
TAknLayoutRect layoutRect;
|
|
271 |
layoutRect.LayoutRect( aParent,
|
|
272 |
AknLayoutScalable_Avkon::aid_indentation_list_msg().LayoutLine() );
|
|
273 |
return layoutRect.Rect().Width();
|
|
274 |
}
|
|
275 |
|
|
276 |
// -----------------------------------------------------------------------------
|
|
277 |
// CFSEmailUiLayoutHandler::FolderListItemSizeInThisResolution
|
|
278 |
// Folder list item size, taken from Avkon layouts
|
|
279 |
// -----------------------------------------------------------------------------
|
|
280 |
//
|
|
281 |
TSize CFSEmailUiLayoutHandler::FolderListItemSizeInThisResolution( const TRect& aParent ) const
|
|
282 |
{
|
|
283 |
FUNC_LOG;
|
|
284 |
TAknLayoutRect itemRect;
|
|
285 |
itemRect.LayoutRect( aParent, // Only zero variety with this one
|
|
286 |
AknLayoutScalable_Avkon::list_single_large_graphic_pane( 0, 0 ,0 ) );
|
|
287 |
|
|
288 |
return itemRect.Rect().Size();
|
|
289 |
}
|
|
290 |
|
|
291 |
// -----------------------------------------------------------------------------
|
|
292 |
// CFSEmailUiLayoutHandler::DropDownMenuListRect
|
|
293 |
// Selector ring image visual size
|
|
294 |
// -----------------------------------------------------------------------------
|
|
295 |
//
|
|
296 |
TRect CFSEmailUiLayoutHandler::DropDownMenuListRect(
|
|
297 |
const TDropDownMenuSide aSide, TBool aStretch ) const
|
|
298 |
{
|
|
299 |
FUNC_LOG;
|
|
300 |
TRect mainPaneRect;
|
|
301 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
|
|
302 |
mainPaneRect );
|
|
303 |
mainPaneRect.Move( 0, -mainPaneRect.iTl.iY );
|
|
304 |
TInt variety( aSide == ELeft ? 0 : 1 );
|
|
305 |
TBool landscape = Layout_Meta_Data::IsLandscapeOrientation();
|
|
306 |
if ( landscape )
|
|
307 |
{
|
|
308 |
// landscape orientation variety is portrait + 2
|
|
309 |
variety += 2;
|
|
310 |
}
|
|
311 |
|
|
312 |
TAknWindowComponentLayout ddMenuPane(
|
|
313 |
TAknWindowComponentLayout::Compose(
|
|
314 |
AknLayoutScalable_Apps::main_sp_fs_email_pane(),
|
|
315 |
AknLayoutScalable_Apps::popup_sp_fs_action_menu_pane_cp01( variety )
|
|
316 |
) );
|
|
317 |
|
|
318 |
TAknLayoutRect menuPane;
|
|
319 |
menuPane.LayoutRect( mainPaneRect, ddMenuPane.LayoutLine() );
|
|
320 |
TRect rect = menuPane.Rect();
|
|
321 |
if ( aStretch )
|
|
322 |
{
|
|
323 |
rect.iBr.iY = mainPaneRect.iBr.iY;
|
|
324 |
|
|
325 |
if( !landscape ) // landscape layout occupy the right side of the display
|
|
326 |
{
|
|
327 |
rect.iBr.iY -= ControlBarHeight();
|
|
328 |
}
|
|
329 |
}
|
|
330 |
|
|
331 |
// Calculate the placement next to the button (below or left side)
|
|
332 |
TRect buttonRect;
|
|
333 |
TRect cbr = GetControlBarRect();
|
|
334 |
if( aSide == ELeft )
|
|
335 |
{
|
|
336 |
buttonRect = GetControlBarFolderListButtonRect();
|
|
337 |
}
|
|
338 |
else
|
|
339 |
{
|
|
340 |
buttonRect = GetControlBarSortButtonRect();
|
|
341 |
}
|
|
342 |
buttonRect.Move( cbr.iTl ); // relative to control bar
|
|
343 |
|
|
344 |
if( landscape )
|
|
345 |
{
|
|
346 |
TSize menuSize = rect.Size();
|
|
347 |
if ( !CFsLayoutManager::IsMirrored() )
|
|
348 |
{
|
|
349 |
// position left from the button
|
|
350 |
rect.SetRect( TPoint( buttonRect.iTl.iX - menuSize.iWidth,
|
|
351 |
buttonRect.Center().iY - menuSize.iHeight / 2 ), menuSize );
|
|
352 |
}
|
|
353 |
else
|
|
354 |
{
|
|
355 |
// position right from the button
|
|
356 |
rect.SetRect( TPoint( buttonRect.Width(),
|
|
357 |
buttonRect.Center().iY - menuSize.iHeight / 2 ), menuSize );
|
|
358 |
}
|
|
359 |
}
|
|
360 |
else
|
|
361 |
{
|
|
362 |
// position below the button
|
|
363 |
rect.Move( 0, buttonRect.iBr.iY - rect.iTl.iY );
|
|
364 |
}
|
|
365 |
|
|
366 |
// keep the popup menu inside the screen area
|
|
367 |
if( landscape )
|
|
368 |
{
|
|
369 |
if( rect.iTl.iX < KPopupMargin )
|
|
370 |
{
|
|
371 |
rect.Move( KPopupMargin - rect.iTl.iX , 0 );
|
|
372 |
}
|
|
373 |
if( rect.iBr.iY > mainPaneRect.iBr.iY - KPopupMargin )
|
|
374 |
{
|
|
375 |
rect.Move( 0, mainPaneRect.iBr.iY - rect.iBr.iY - KPopupMargin );
|
|
376 |
}
|
|
377 |
}
|
|
378 |
if( rect.iTl.iY < KPopupMargin )
|
|
379 |
{
|
|
380 |
rect.iTl.iY = KPopupMargin;
|
|
381 |
}
|
|
382 |
return rect;
|
|
383 |
}
|
|
384 |
|
|
385 |
// -----------------------------------------------------------------------------
|
|
386 |
// CFSEmailUiLayoutHandler::OneLineListNodeHeight
|
|
387 |
// List node item height
|
|
388 |
// -----------------------------------------------------------------------------
|
|
389 |
//
|
|
390 |
TInt CFSEmailUiLayoutHandler::OneLineListNodeHeight() const
|
|
391 |
{
|
|
392 |
FUNC_LOG;
|
|
393 |
TRect mainPaneRect;
|
|
394 |
TAknLayoutRect listItem;
|
|
395 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
396 |
listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 0 ) );
|
|
397 |
return listItem.Rect().Height();
|
|
398 |
}
|
|
399 |
|
|
400 |
// -----------------------------------------------------------------------------
|
|
401 |
// CFSEmailUiLayoutHandler::OneLineListItemHeight
|
|
402 |
// List item height
|
|
403 |
// -----------------------------------------------------------------------------
|
|
404 |
//
|
|
405 |
TInt CFSEmailUiLayoutHandler::OneLineListItemHeight() const
|
|
406 |
{
|
|
407 |
FUNC_LOG;
|
|
408 |
TRect mainPaneRect;
|
|
409 |
TAknLayoutRect listItem;
|
|
410 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
411 |
listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 0 ) );
|
|
412 |
return listItem.Rect().Height();
|
|
413 |
}
|
|
414 |
|
|
415 |
TInt CFSEmailUiLayoutHandler::TwoLineListItemHeight() const
|
|
416 |
{
|
|
417 |
TRect mainPaneRect;
|
|
418 |
TAknLayoutRect listItem;
|
|
419 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
420 |
listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 1 ) );
|
|
421 |
return listItem.Rect().Height();
|
|
422 |
}
|
|
423 |
|
|
424 |
// -----------------------------------------------------------------------------
|
|
425 |
// CFSEmailUiLayoutHandler::FolderListOneLineItemHeight
|
|
426 |
// List item height for folder list
|
|
427 |
// -----------------------------------------------------------------------------
|
|
428 |
//
|
|
429 |
TInt CFSEmailUiLayoutHandler::FolderListOneLineItemHeight(
|
|
430 |
const TBool& aFullscreen ) const
|
|
431 |
{
|
|
432 |
FUNC_LOG;
|
|
433 |
if ( aFullscreen )
|
|
434 |
{
|
|
435 |
return OneLineListItemHeight();
|
|
436 |
}
|
|
437 |
return 0;
|
|
438 |
}
|
|
439 |
|
|
440 |
// -----------------------------------------------------------------------------
|
|
441 |
// CFSEmailUiLayoutHandler::ControlBarHeight
|
|
442 |
// Control bar height
|
|
443 |
// -----------------------------------------------------------------------------
|
|
444 |
//
|
|
445 |
TInt CFSEmailUiLayoutHandler::ControlBarHeight() const
|
|
446 |
{
|
|
447 |
FUNC_LOG;
|
|
448 |
TRect mainPaneRect;
|
|
449 |
TAknLayoutRect ctrlBarRect;
|
|
450 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
451 |
ctrlBarRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane( 0 ) );
|
|
452 |
return ctrlBarRect.Rect().Height();
|
|
453 |
}
|
|
454 |
|
|
455 |
// -----------------------------------------------------------------------------
|
|
456 |
// CFSEmailUiLayoutHandler::ControlBarListPadding
|
|
457 |
// -----------------------------------------------------------------------------
|
|
458 |
TPoint CFSEmailUiLayoutHandler::ControlBarListPadding() const
|
|
459 |
{
|
|
460 |
FUNC_LOG;
|
|
461 |
return KControlBarListPadding;
|
|
462 |
}
|
|
463 |
|
|
464 |
// -----------------------------------------------------------------------------
|
|
465 |
// CFSEmailUiLayoutHandler::ControlBarListBorderRoundingSize
|
|
466 |
// -----------------------------------------------------------------------------
|
|
467 |
TInt CFSEmailUiLayoutHandler::ControlBarListBorderRoundingSize() const
|
|
468 |
{
|
|
469 |
FUNC_LOG;
|
|
470 |
return KControlBarListBorderRoundingSize;
|
|
471 |
}
|
|
472 |
|
|
473 |
// -----------------------------------------------------------------------------
|
|
474 |
// CFSEmailUiLayoutHandler::ControlBarButtonBgRoundingSize
|
|
475 |
// -----------------------------------------------------------------------------
|
|
476 |
TInt CFSEmailUiLayoutHandler::ControlBarButtonBgRoundingSize() const
|
|
477 |
{
|
|
478 |
FUNC_LOG;
|
|
479 |
return KControlBarbuttonBorderRoundingSize;
|
|
480 |
}
|
|
481 |
|
|
482 |
// -----------------------------------------------------------------------------
|
|
483 |
// CFSEmailUiLayoutHandler::ListFadeInEffectTime
|
|
484 |
// -----------------------------------------------------------------------------
|
|
485 |
TInt CFSEmailUiLayoutHandler::ListFadeInEffectTime() const
|
|
486 |
{
|
|
487 |
FUNC_LOG;
|
|
488 |
return KListFadeInEffectTime;
|
|
489 |
}
|
|
490 |
|
|
491 |
// -----------------------------------------------------------------------------
|
|
492 |
// CFSEmailUiLayoutHandler::ListFadeOutEffectTime
|
|
493 |
// -----------------------------------------------------------------------------
|
|
494 |
TInt CFSEmailUiLayoutHandler::ListFadeOutEffectTime() const
|
|
495 |
{
|
|
496 |
FUNC_LOG;
|
|
497 |
return KListFadeOutEffectTime;
|
|
498 |
}
|
|
499 |
|
|
500 |
// -----------------------------------------------------------------------------
|
|
501 |
// CFSEmailUiLayoutHandler::StatusIndicatorFadeEffectTime
|
|
502 |
// -----------------------------------------------------------------------------
|
|
503 |
TInt CFSEmailUiLayoutHandler::StatusIndicatorFadeEffectTime() const
|
|
504 |
{
|
|
505 |
FUNC_LOG;
|
|
506 |
return KStatusIndicatorFadeEffectTime;
|
|
507 |
}
|
|
508 |
|
|
509 |
// -----------------------------------------------------------------------------
|
|
510 |
// CFSEmailUiLayoutHandler::CtrlBarListFadeEffectTime
|
|
511 |
// -----------------------------------------------------------------------------
|
|
512 |
TInt CFSEmailUiLayoutHandler::CtrlBarListFadeEffectTime() const
|
|
513 |
{
|
|
514 |
FUNC_LOG;
|
|
515 |
return KCtrlBarListFadeEffectTime;
|
|
516 |
}
|
|
517 |
|
|
518 |
// -----------------------------------------------------------------------------
|
|
519 |
// CFSEmailUiLayoutHandler::ViewSlideEffectActive
|
|
520 |
// -----------------------------------------------------------------------------
|
|
521 |
TBool CFSEmailUiLayoutHandler::ViewSlideEffectActive() const
|
|
522 |
{
|
|
523 |
FUNC_LOG;
|
|
524 |
return KListSlideEffectActive;
|
|
525 |
}
|
|
526 |
|
|
527 |
// -----------------------------------------------------------------------------
|
|
528 |
// CFSEmailUiLayoutHandler::ViewFadeEffectActive
|
|
529 |
// -----------------------------------------------------------------------------
|
|
530 |
TBool CFSEmailUiLayoutHandler::ViewFadeEffectActive() const
|
|
531 |
{
|
|
532 |
FUNC_LOG;
|
|
533 |
return KListFadeEffectActive;
|
|
534 |
}
|
|
535 |
|
|
536 |
// -----------------------------------------------------------------------------
|
|
537 |
// CFSEmailUiLayoutHandler::ViewSlideEffectTime
|
|
538 |
// -----------------------------------------------------------------------------
|
|
539 |
TInt CFSEmailUiLayoutHandler::ViewSlideEffectTime() const
|
|
540 |
{
|
|
541 |
FUNC_LOG;
|
|
542 |
return KListSlideEffectTime;
|
|
543 |
}
|
|
544 |
|
|
545 |
// -----------------------------------------------------------------------------
|
|
546 |
// CFSEmailUiLayoutHandler::ViewFadeInEffectTime
|
|
547 |
// -----------------------------------------------------------------------------
|
|
548 |
TInt CFSEmailUiLayoutHandler::ViewFadeInEffectTime() const
|
|
549 |
{
|
|
550 |
FUNC_LOG;
|
|
551 |
return KListFadeInEffectTime;
|
|
552 |
}
|
|
553 |
|
|
554 |
// -----------------------------------------------------------------------------
|
|
555 |
// CFSEmailUiLayoutHandler::ViewFadeOutEffectTime
|
|
556 |
// -----------------------------------------------------------------------------
|
|
557 |
TInt CFSEmailUiLayoutHandler::ViewFadeOutEffectTime() const
|
|
558 |
{
|
|
559 |
FUNC_LOG;
|
|
560 |
return KListFadeOutEffectTime;
|
|
561 |
}
|
|
562 |
|
|
563 |
// -----------------------------------------------------------------------------
|
|
564 |
// CFSEmailUiLayoutHandler::ListScrollingTime
|
|
565 |
// -----------------------------------------------------------------------------
|
|
566 |
TInt CFSEmailUiLayoutHandler::ListScrollingTime() const
|
|
567 |
{
|
|
568 |
FUNC_LOG;
|
|
569 |
return KListScrollingTime;
|
|
570 |
}
|
|
571 |
|
|
572 |
// -----------------------------------------------------------------------------
|
|
573 |
// CFSEmailUiLayoutHandler::ListItemExpansionDelay
|
|
574 |
// -----------------------------------------------------------------------------
|
|
575 |
TInt CFSEmailUiLayoutHandler::ListItemExpansionDelay() const
|
|
576 |
{
|
|
577 |
FUNC_LOG;
|
|
578 |
return KListItemExpansionDelay;
|
|
579 |
}
|
|
580 |
|
|
581 |
// -----------------------------------------------------------------------------
|
|
582 |
// CFSEmailUiLayoutHandler::ListFocusedStateTextSkinColor
|
|
583 |
// -----------------------------------------------------------------------------
|
|
584 |
TRgb CFSEmailUiLayoutHandler::ListFocusedStateTextSkinColor() const
|
|
585 |
{
|
|
586 |
FUNC_LOG;
|
|
587 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
588 |
TRgb textColor;
|
|
589 |
if( AknsUtils::GetCachedColor( skin, textColor,
|
|
590 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ) != KErrNone )
|
|
591 |
{
|
|
592 |
textColor = KRgbBlack;
|
|
593 |
}
|
|
594 |
return textColor;
|
|
595 |
}
|
|
596 |
|
|
597 |
// -----------------------------------------------------------------------------
|
|
598 |
// CFSEmailUiLayoutHandler::ListNormalStateTextSkinColor
|
|
599 |
// -----------------------------------------------------------------------------
|
|
600 |
TRgb CFSEmailUiLayoutHandler::ListNormalStateTextSkinColor() const
|
|
601 |
{
|
|
602 |
FUNC_LOG;
|
|
603 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
604 |
TRgb textColor;
|
|
605 |
if ( AknsUtils::GetCachedColor( skin, textColor,
|
|
606 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
|
|
607 |
{
|
|
608 |
textColor = KRgbBlack;
|
|
609 |
}
|
|
610 |
return textColor;
|
|
611 |
}
|
|
612 |
|
|
613 |
// -----------------------------------------------------------------------------
|
|
614 |
// CFSEmailUiLayoutHandler::ListNodeBackgroundColor
|
|
615 |
// -----------------------------------------------------------------------------
|
|
616 |
TRgb CFSEmailUiLayoutHandler::ListNodeBackgroundColor() const
|
|
617 |
{
|
|
618 |
FUNC_LOG;
|
|
619 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
620 |
TRgb nodeBgColor;
|
|
621 |
if ( AknsUtils::GetCachedColor( skin, nodeBgColor,
|
|
622 |
KAknsIIDFsOtherColors, EAknsCIFsOtherColorsCG19 ) != KErrNone )
|
|
623 |
{
|
|
624 |
nodeBgColor = KRgbDarkGray;
|
|
625 |
}
|
|
626 |
return nodeBgColor;
|
|
627 |
}
|
|
628 |
|
|
629 |
// -----------------------------------------------------------------------------
|
|
630 |
// CFSEmailUiLayoutHandler::ListNodeTextColor
|
|
631 |
// -----------------------------------------------------------------------------
|
|
632 |
TRgb CFSEmailUiLayoutHandler::ListNodeTextColor() const
|
|
633 |
{
|
|
634 |
FUNC_LOG;
|
|
635 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
636 |
TRgb nodeTextColor;
|
|
637 |
if ( AknsUtils::GetCachedColor( skin, nodeTextColor,
|
|
638 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
|
|
639 |
{
|
|
640 |
nodeTextColor = KRgbWhite;
|
|
641 |
}
|
|
642 |
return nodeTextColor;
|
|
643 |
}
|
|
644 |
|
|
645 |
// -----------------------------------------------------------------------------
|
|
646 |
// CFSEmailUiLayoutHandler::ListHeaderBackgroundColor
|
|
647 |
// -----------------------------------------------------------------------------
|
|
648 |
TRgb CFSEmailUiLayoutHandler::ListHeaderBackgroundColor() const
|
|
649 |
{
|
|
650 |
FUNC_LOG;
|
|
651 |
// The header item bg color is gained by mixing 50/50 node bg color
|
|
652 |
// and list item bg color.
|
|
653 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
654 |
TRgb listItemBgColor;
|
|
655 |
if ( AknsUtils::GetCachedColor( skin, listItemBgColor,
|
|
656 |
KAknsIIDQsnLineColors, EAknsCIFsTextColorsCG3 ) != KErrNone )
|
|
657 |
{
|
|
658 |
listItemBgColor = KRgbWhite;
|
|
659 |
}
|
|
660 |
TRgb nodeItemBgColor = ListNodeBackgroundColor();
|
|
661 |
TRgb headerBgColor;
|
|
662 |
headerBgColor.SetRed( (listItemBgColor.Red()+nodeItemBgColor.Red()) / 2 );
|
|
663 |
headerBgColor.SetGreen( (listItemBgColor.Green()+nodeItemBgColor.Green()) / 2 );
|
|
664 |
headerBgColor.SetBlue( (listItemBgColor.Blue()+nodeItemBgColor.Blue()) / 2 );
|
|
665 |
return headerBgColor;
|
|
666 |
}
|
|
667 |
|
|
668 |
// -----------------------------------------------------------------------------
|
|
669 |
// CFSEmailUiLayoutHandler::DropdownMenuTextColor
|
|
670 |
// -----------------------------------------------------------------------------
|
|
671 |
TRgb CFSEmailUiLayoutHandler::DropdownMenuTextColor() const
|
|
672 |
{
|
|
673 |
FUNC_LOG;
|
|
674 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
675 |
TRgb textColor;
|
|
676 |
if ( AknsUtils::GetCachedColor( skin, textColor,
|
|
677 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
|
|
678 |
{
|
|
679 |
textColor = KRgbBlack;
|
|
680 |
}
|
|
681 |
return textColor;
|
|
682 |
}
|
|
683 |
|
|
684 |
// -----------------------------------------------------------------------------
|
|
685 |
// CFSEmailUiLayoutHandler::ListItemFontHeightInTwips
|
|
686 |
// -----------------------------------------------------------------------------
|
|
687 |
TInt CFSEmailUiLayoutHandler::ListItemFontHeightInTwips( const TBool aPopup ) const
|
|
688 |
{
|
|
689 |
FUNC_LOG;
|
|
690 |
if ( aPopup )
|
|
691 |
{
|
|
692 |
TRect mainPaneRect;
|
|
693 |
TAknLayoutText itemText;
|
|
694 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
695 |
itemText.LayoutText( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_ddmenu_pane_t1( 0 ) );
|
|
696 |
return itemText.Font()->FontSpecInTwips().iHeight;
|
|
697 |
}
|
|
698 |
else
|
|
699 |
{
|
|
700 |
TRect mainPaneRect;
|
|
701 |
TAknLayoutText itemText;
|
|
702 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
703 |
itemText.LayoutText( mainPaneRect, AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 0 ) );
|
|
704 |
return itemText.Font()->FontSpecInTwips().iHeight;
|
|
705 |
}
|
|
706 |
}
|
|
707 |
|
|
708 |
// -----------------------------------------------------------------------------
|
|
709 |
// CFSEmailUiLayoutHandler::ViewerTitleFontAknLogicalFontId
|
|
710 |
// -----------------------------------------------------------------------------
|
|
711 |
TAknLogicalFontId CFSEmailUiLayoutHandler::ViewerTitleFontAknLogicalFontId() const
|
|
712 |
{
|
|
713 |
FUNC_LOG;
|
|
714 |
return KViewerLogicalTitleFontId;
|
|
715 |
}
|
|
716 |
|
|
717 |
// -----------------------------------------------------------------------------
|
|
718 |
// CFSEmailUiLayoutHandler::ViewerTextFontAknLogicalFontId
|
|
719 |
// -----------------------------------------------------------------------------
|
|
720 |
TAknLogicalFontId CFSEmailUiLayoutHandler::ViewerTextFontAknLogicalFontId() const
|
|
721 |
{
|
|
722 |
FUNC_LOG;
|
|
723 |
return KViewerLogicalTextFontId;
|
|
724 |
}
|
|
725 |
|
|
726 |
// -----------------------------------------------------------------------------
|
|
727 |
// CFSEmailUiLayoutHandler::ViewerTitleFontHeight
|
|
728 |
// -----------------------------------------------------------------------------
|
|
729 |
TInt CFSEmailUiLayoutHandler::ViewerTitleFontHeight() const
|
|
730 |
{
|
|
731 |
FUNC_LOG;
|
|
732 |
TAknLayoutRect labelRect;
|
|
733 |
labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane() );
|
|
734 |
TAknLayoutText layoutText;
|
|
735 |
layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() );
|
|
736 |
return layoutText.Font()->FontMaxHeight();
|
|
737 |
}
|
|
738 |
|
|
739 |
// -----------------------------------------------------------------------------
|
|
740 |
// CFSEmailUiLayoutHandler::ViewerTextFontHeight
|
|
741 |
// -----------------------------------------------------------------------------
|
|
742 |
TInt CFSEmailUiLayoutHandler::ViewerTextFontHeight() const
|
|
743 |
{
|
|
744 |
FUNC_LOG;
|
|
745 |
TAknLayoutRect labelRect;
|
|
746 |
labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
|
|
747 |
TAknLayoutText layoutText;
|
|
748 |
layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_t1( 0 ) );
|
|
749 |
return layoutText.Font()->FontMaxHeight();
|
|
750 |
}
|
|
751 |
|
|
752 |
// -----------------------------------------------------------------------------
|
|
753 |
// CFSEmailUiLayoutHandler::ViewerTopMostSpaceHeight
|
|
754 |
// -----------------------------------------------------------------------------
|
|
755 |
TInt CFSEmailUiLayoutHandler::ViewerTopMostSpaceHeight() const
|
|
756 |
{
|
|
757 |
FUNC_LOG;
|
|
758 |
TAknLayoutRect labelRect;
|
|
759 |
labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane( 0 ) );
|
|
760 |
return labelRect.Rect().Height();
|
|
761 |
}
|
|
762 |
// -----------------------------------------------------------------------------
|
|
763 |
// CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight
|
|
764 |
// -----------------------------------------------------------------------------
|
|
765 |
TInt CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight() const
|
|
766 |
{
|
|
767 |
FUNC_LOG;
|
|
768 |
TAknLayoutRect labelRect;
|
|
769 |
labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
|
|
770 |
return labelRect.Rect().Height();
|
|
771 |
}
|
|
772 |
|
|
773 |
// -----------------------------------------------------------------------------
|
|
774 |
// CFSEmailUiLayoutHandler::ViewerHeaderInfoSpaceHeight
|
|
775 |
// -----------------------------------------------------------------------------
|
|
776 |
TInt CFSEmailUiLayoutHandler::ViewerHeaderInfoSpaceHeight() const
|
|
777 |
{
|
|
778 |
FUNC_LOG;
|
|
779 |
return ViewerTopMostSpaceHeight();
|
|
780 |
}
|
|
781 |
|
|
782 |
// -----------------------------------------------------------------------------
|
|
783 |
// CFSEmailUiLayoutHandler::ViewerBottomMostSpaceHeight
|
|
784 |
// -----------------------------------------------------------------------------
|
|
785 |
TInt CFSEmailUiLayoutHandler::ViewerBottomMostSpaceHeight() const
|
|
786 |
{
|
|
787 |
FUNC_LOG;
|
|
788 |
return ViewerRecipientSpaceHeight();
|
|
789 |
}
|
|
790 |
|
|
791 |
// -----------------------------------------------------------------------------
|
|
792 |
// CFSEmailUiLayoutHandler::ViewerMaxRecipientLineCount
|
|
793 |
// -----------------------------------------------------------------------------
|
|
794 |
TInt CFSEmailUiLayoutHandler::ViewerMaxRecipientLineCount() const
|
|
795 |
{
|
|
796 |
FUNC_LOG;
|
|
797 |
return KViewerMaxRecipientLineCount;
|
|
798 |
}
|
|
799 |
|
|
800 |
// -----------------------------------------------------------------------------
|
|
801 |
// CFSEmailUiLayoutHandler::ViewerMaxSubjectLineCount
|
|
802 |
// -----------------------------------------------------------------------------
|
|
803 |
TInt CFSEmailUiLayoutHandler::ViewerMaxSubjectLineCount() const
|
|
804 |
{
|
|
805 |
FUNC_LOG;
|
|
806 |
return KViewerMaxSubjectLineCount;
|
|
807 |
}
|
|
808 |
|
|
809 |
// -----------------------------------------------------------------------------
|
|
810 |
// CFSEmailUiLayoutHandler::ViewerTitleTextColor
|
|
811 |
// -----------------------------------------------------------------------------
|
|
812 |
TRgb CFSEmailUiLayoutHandler::ViewerTitleTextColor() const
|
|
813 |
{
|
|
814 |
FUNC_LOG;
|
|
815 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
816 |
TRgb textColor;
|
|
817 |
if (AknsUtils::GetCachedColor( skin, textColor,
|
|
818 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
|
|
819 |
{
|
|
820 |
textColor = KBlackFallbackTextColor;
|
|
821 |
}
|
|
822 |
return textColor;
|
|
823 |
}
|
|
824 |
|
|
825 |
// -----------------------------------------------------------------------------
|
|
826 |
// CFSEmailUiLayoutHandler::ViewerTextTextColor
|
|
827 |
// -----------------------------------------------------------------------------
|
|
828 |
TRgb CFSEmailUiLayoutHandler::ViewerTextTextColor() const
|
|
829 |
{
|
|
830 |
FUNC_LOG;
|
|
831 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
832 |
TRgb textColor;
|
|
833 |
if (AknsUtils::GetCachedColor( skin, textColor,
|
|
834 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
|
|
835 |
{
|
|
836 |
textColor = KBlackFallbackTextColor;
|
|
837 |
}
|
|
838 |
return textColor;
|
|
839 |
}
|
|
840 |
|
|
841 |
// -----------------------------------------------------------------------------
|
|
842 |
// CFSEmailUiLayoutHandler::ViewerBodyTextColor
|
|
843 |
// -----------------------------------------------------------------------------
|
|
844 |
TRgb CFSEmailUiLayoutHandler::ViewerBodyTextColor() const
|
|
845 |
{
|
|
846 |
FUNC_LOG;
|
|
847 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
848 |
TRgb textColor;
|
|
849 |
if ( AknsUtils::GetCachedColor( skin, textColor,
|
|
850 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG13 ) != KErrNone )
|
|
851 |
{
|
|
852 |
textColor = KBlackFallbackTextColor;
|
|
853 |
}
|
|
854 |
return textColor;
|
|
855 |
}
|
|
856 |
|
|
857 |
// -----------------------------------------------------------------------------
|
|
858 |
// CFSEmailUiLayoutHandler::ViewerNormalHotspotTextColor
|
|
859 |
// -----------------------------------------------------------------------------
|
|
860 |
TRgb CFSEmailUiLayoutHandler::ViewerNormalHotspotTextColor() const
|
|
861 |
{
|
|
862 |
FUNC_LOG;
|
|
863 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
864 |
TRgb textColor;
|
|
865 |
if ( AknsUtils::GetCachedColor( skin, textColor,
|
|
866 |
KAknsIIDQsnHighlightColors,
|
|
867 |
EAknsCIQsnHighlightColorsCG3 ) != KErrNone )
|
|
868 |
{
|
|
869 |
textColor = KLightBlueFallbackTextColor;
|
|
870 |
}
|
|
871 |
return textColor;
|
|
872 |
}
|
|
873 |
|
|
874 |
// -----------------------------------------------------------------------------
|
|
875 |
// CFSEmailUiLayoutHandler::ViewerHighlightedHotspotTextColor
|
|
876 |
// -----------------------------------------------------------------------------
|
|
877 |
TRgb CFSEmailUiLayoutHandler::ViewerHighlightedHotspotTextColor() const
|
|
878 |
{
|
|
879 |
FUNC_LOG;
|
|
880 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
881 |
TRgb textColor;
|
|
882 |
if ( AknsUtils::GetCachedColor( skin, textColor,
|
|
883 |
KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG3 )
|
|
884 |
!= KErrNone )
|
|
885 |
{
|
|
886 |
textColor = KLightBlueFallbackTextColor;
|
|
887 |
}
|
|
888 |
return textColor;
|
|
889 |
}
|
|
890 |
// -----------------------------------------------------------------------------
|
|
891 |
// CFSEmailUiLayoutHandler::ViewerSentTextColor
|
|
892 |
// -----------------------------------------------------------------------------
|
|
893 |
TRgb CFSEmailUiLayoutHandler::ViewerSentTextColor() const
|
|
894 |
{
|
|
895 |
FUNC_LOG;
|
|
896 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
897 |
TRgb textColor;
|
|
898 |
if ( AknsUtils::GetCachedColor( skin, textColor,
|
|
899 |
KAknsIIDFsTextColors, EAknsCIFsTextColorsCG8 ) != KErrNone )
|
|
900 |
{
|
|
901 |
textColor = KBlackFallbackTextColor;
|
|
902 |
}
|
|
903 |
return textColor;
|
|
904 |
}
|
|
905 |
|
|
906 |
// -----------------------------------------------------------------------------
|
|
907 |
// CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject
|
|
908 |
// -----------------------------------------------------------------------------
|
|
909 |
TInt CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject() const
|
|
910 |
{
|
|
911 |
FUNC_LOG;
|
|
912 |
const TRect cmailPaneRect( ListCmailPaneRect() );
|
|
913 |
TAknLayoutRect layoutRect;
|
|
914 |
layoutRect.LayoutRect( cmailPaneRect, AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
|
|
915 |
TAknLayoutRect iconRect;
|
|
916 |
iconRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g1( 0 ) );
|
|
917 |
if (AknLayoutUtils::LayoutMirrored())
|
|
918 |
{
|
|
919 |
return cmailPaneRect.iBr.iX - iconRect.Rect().iBr.iX;
|
|
920 |
}
|
|
921 |
else
|
|
922 |
{
|
|
923 |
return Abs( cmailPaneRect.iTl.iX - iconRect.Rect().iTl.iX );
|
|
924 |
}
|
|
925 |
}
|
|
926 |
|
|
927 |
// -----------------------------------------------------------------------------
|
|
928 |
// CFSEmailUiLayoutHandler::ViewerIconSize
|
|
929 |
// -----------------------------------------------------------------------------
|
|
930 |
TSize CFSEmailUiLayoutHandler::ViewerIconSize() const
|
|
931 |
{
|
|
932 |
FUNC_LOG;
|
|
933 |
TAknLayoutRect layoutRect;
|
|
934 |
layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
|
|
935 |
layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g1( 2 ) );
|
|
936 |
return layoutRect.Rect().Size();
|
|
937 |
}
|
|
938 |
// -----------------------------------------------------------------------------
|
|
939 |
// CFSEmailUiLayoutHandler::ViewerIndentationIconSize
|
|
940 |
// -----------------------------------------------------------------------------
|
|
941 |
TSize CFSEmailUiLayoutHandler::ViewerIndentationIconSize() const
|
|
942 |
{
|
|
943 |
FUNC_LOG;
|
|
944 |
return ViewerIconSize();
|
|
945 |
}
|
|
946 |
// -----------------------------------------------------------------------------
|
|
947 |
// CFSEmailUiLayoutHandler::ViewerActionMenuIconSize
|
|
948 |
// -----------------------------------------------------------------------------
|
|
949 |
TSize CFSEmailUiLayoutHandler::ViewerActionMenuIconSize() const
|
|
950 |
{
|
|
951 |
FUNC_LOG;
|
|
952 |
TAknLayoutRect layoutRect;
|
|
953 |
layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
|
|
954 |
layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g2( 0 ) );
|
|
955 |
return layoutRect.Rect().Size();
|
|
956 |
}
|
|
957 |
|
|
958 |
// -----------------------------------------------------------------------------
|
|
959 |
// CFSEmailUiLayoutHandler::ViewerActionMenuIconMargin
|
|
960 |
// -----------------------------------------------------------------------------
|
|
961 |
TInt CFSEmailUiLayoutHandler::ViewerActionMenuIconMargin() const
|
|
962 |
{
|
|
963 |
FUNC_LOG;
|
|
964 |
if (AknLayoutUtils::LayoutMirrored())
|
|
965 |
{
|
|
966 |
TAknLayoutRect layoutRect;
|
|
967 |
layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
|
|
968 |
TInt x( layoutRect.Rect().iTl.iX );
|
|
969 |
layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g2( 0 ) );
|
|
970 |
return Abs( layoutRect.Rect().iTl.iX - x );
|
|
971 |
}
|
|
972 |
else
|
|
973 |
{
|
|
974 |
TAknLayoutRect layoutRect;
|
|
975 |
layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
|
|
976 |
TInt x( layoutRect.Rect().iBr.iX );
|
|
977 |
layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g2( 0 ) );
|
|
978 |
return Abs( x - layoutRect.Rect().iBr.iX );
|
|
979 |
}
|
|
980 |
}
|
|
981 |
|
|
982 |
// -----------------------------------------------------------------------------
|
|
983 |
// CFSEmailUiLayoutHandler::ViewerSelectorOpacity
|
|
984 |
// -----------------------------------------------------------------------------
|
|
985 |
TReal CFSEmailUiLayoutHandler::ViewerSelectorOpacity() const
|
|
986 |
{
|
|
987 |
FUNC_LOG;
|
|
988 |
return KViewerSelectorOpacity;
|
|
989 |
}
|
|
990 |
|
|
991 |
// -----------------------------------------------------------------------------
|
|
992 |
// CFSEmailUiLayoutHandler::ViewerRightMarginInPixels
|
|
993 |
// -----------------------------------------------------------------------------
|
|
994 |
TInt CFSEmailUiLayoutHandler::ViewerRightMarginInPixels() const
|
|
995 |
{
|
|
996 |
FUNC_LOG;
|
|
997 |
const TRect cmailPaneRect( ListCmailPaneRect() );
|
|
998 |
TAknLayoutRect layoutRect;
|
|
999 |
layoutRect.LayoutRect( cmailPaneRect, AknLayoutScalable_Apps::list_single_cmail_header_caption_pane() );
|
|
1000 |
TAknLayoutText captionTextRect;
|
|
1001 |
captionTextRect.LayoutText( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() );
|
|
1002 |
return Abs( cmailPaneRect.iBr.iX - captionTextRect.TextRect().iBr.iX );
|
|
1003 |
}
|
|
1004 |
|
|
1005 |
// -----------------------------------------------------------------------------
|
|
1006 |
// CFSEmailUiLayoutHandler::ViewerLeftMarginInPixels
|
|
1007 |
// -----------------------------------------------------------------------------
|
|
1008 |
TInt CFSEmailUiLayoutHandler::ViewerLeftMarginInPixels() const
|
|
1009 |
{
|
|
1010 |
FUNC_LOG;
|
|
1011 |
const TRect cmailPaneRect( ListCmailPaneRect() );
|
|
1012 |
TAknLayoutRect layoutRect;
|
|
1013 |
layoutRect.LayoutRect( cmailPaneRect, AknLayoutScalable_Apps::list_single_cmail_header_caption_pane() );
|
|
1014 |
TAknLayoutText captionTextRect;
|
|
1015 |
captionTextRect.LayoutText( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() );
|
|
1016 |
return Abs( cmailPaneRect.iTl.iX - captionTextRect.TextRect().iTl.iX );
|
|
1017 |
}
|
|
1018 |
|
|
1019 |
// -----------------------------------------------------------------------------
|
|
1020 |
// CFSEmailUiLayoutHandler::ComposerFieldBorderColor
|
|
1021 |
// -----------------------------------------------------------------------------
|
|
1022 |
TRgb CFSEmailUiLayoutHandler::ComposerFieldBorderColor() const
|
|
1023 |
{
|
|
1024 |
FUNC_LOG;
|
|
1025 |
return GetSkinColor( KAknsIIDFsOtherColors, EAknsCIFsOtherColorsCG14, KRgbBlack );
|
|
1026 |
}
|
|
1027 |
// -----------------------------------------------------------------------------
|
|
1028 |
// CFSEmailUiLayoutHandler::ComposerFieldBackgroundColor
|
|
1029 |
// -----------------------------------------------------------------------------
|
|
1030 |
TRgb CFSEmailUiLayoutHandler::ComposerFieldBackgroundColor() const
|
|
1031 |
{
|
|
1032 |
FUNC_LOG;
|
|
1033 |
return GetSkinColor( KAknsIIDFsOtherColors, EAknsCIFsOtherColorsCG12, KRgbWhite );
|
|
1034 |
}
|
|
1035 |
|
|
1036 |
// -----------------------------------------------------------------------------
|
|
1037 |
// CFSEmailUiLayoutHandler::ComposerHeaderFieldTextColor
|
|
1038 |
// -----------------------------------------------------------------------------
|
|
1039 |
TRgb CFSEmailUiLayoutHandler::ComposerHeaderFieldTextColor() const
|
|
1040 |
{
|
|
1041 |
FUNC_LOG;
|
|
1042 |
return GetSkinColor( KAknsIIDFsTextColors, EAknsCIFsTextColorsCG4, KRgbBlack );
|
|
1043 |
}
|
|
1044 |
|
|
1045 |
// -----------------------------------------------------------------------------
|
|
1046 |
// CFSEmailUiLayoutHandler::ComposerBodyFieldTextColor
|
|
1047 |
// -----------------------------------------------------------------------------
|
|
1048 |
TRgb CFSEmailUiLayoutHandler::ComposerBodyFieldTextColor() const
|
|
1049 |
{
|
|
1050 |
FUNC_LOG;
|
|
1051 |
return GetSkinColor( KAknsIIDFsTextColors, EAknsCIFsTextColorsCG3, KRgbBlack );
|
|
1052 |
}
|
|
1053 |
|
|
1054 |
// -----------------------------------------------------------------------------
|
|
1055 |
// CFSEmailUiLayoutHandler::ComposerDimmedTextColor
|
|
1056 |
// -----------------------------------------------------------------------------
|
|
1057 |
TRgb CFSEmailUiLayoutHandler::ComposerDimmedTextColor() const
|
|
1058 |
{
|
|
1059 |
FUNC_LOG;
|
|
1060 |
return GetSkinColor( KAknsIIDFsTextColors, EAknsCIFsTextColorsCG18, KRgbGray );
|
|
1061 |
}
|
|
1062 |
|
|
1063 |
// -----------------------------------------------------------------------------
|
|
1064 |
// CFSEmailUiLayoutHandler::MaxPcsMatches
|
|
1065 |
// -----------------------------------------------------------------------------
|
|
1066 |
TInt CFSEmailUiLayoutHandler::MaxPcsMatches() const
|
|
1067 |
{
|
|
1068 |
FUNC_LOG;
|
|
1069 |
return KMaxPcsMatches;
|
|
1070 |
}
|
|
1071 |
|
|
1072 |
// -----------------------------------------------------------------------------
|
|
1073 |
// CFSEmailUiLayoutHandler::PcsPopupDimmedFontTransparency
|
|
1074 |
// -----------------------------------------------------------------------------
|
|
1075 |
TInt CFSEmailUiLayoutHandler::PcsPopupDimmedFontTransparency() const
|
|
1076 |
{
|
|
1077 |
FUNC_LOG;
|
|
1078 |
return KPcsPopupDimmedFontTransparency;
|
|
1079 |
}
|
|
1080 |
|
|
1081 |
// -----------------------------------------------------------------------------
|
|
1082 |
// CFSEmailUiLayoutHandler::ListTextureNodeExpandedSize
|
|
1083 |
// -----------------------------------------------------------------------------
|
|
1084 |
TInt CFSEmailUiLayoutHandler::ListTextureNodeExpandedSize() const
|
|
1085 |
{
|
|
1086 |
FUNC_LOG;
|
|
1087 |
TRect mainPaneRect;
|
|
1088 |
TAknLayoutRect listItem;
|
|
1089 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
1090 |
listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_dyc_row_pane_g1( 0 ) );
|
|
1091 |
return listItem.Rect().Height();
|
|
1092 |
}
|
|
1093 |
|
|
1094 |
// -----------------------------------------------------------------------------
|
|
1095 |
// CFSEmailUiLayoutHandler::SearchLookingGlassIconSize
|
|
1096 |
// -----------------------------------------------------------------------------
|
|
1097 |
TInt CFSEmailUiLayoutHandler::SearchLookingGlassIconSize() const
|
|
1098 |
{
|
|
1099 |
FUNC_LOG;
|
|
1100 |
return KSearchLookingGlassIconSize;
|
|
1101 |
}
|
|
1102 |
|
|
1103 |
// -----------------------------------------------------------------------------
|
|
1104 |
// CFSEmailUiLayoutHandler::statusPaneIconSize
|
|
1105 |
// -----------------------------------------------------------------------------
|
|
1106 |
TSize CFSEmailUiLayoutHandler::statusPaneIconSize() const
|
|
1107 |
{
|
|
1108 |
FUNC_LOG;
|
|
1109 |
TRect titlePaneRect;
|
|
1110 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::ETitlePane, titlePaneRect);
|
|
1111 |
TAknLayoutRect iconRect;
|
|
1112 |
iconRect.LayoutRect(titlePaneRect, AknLayoutScalable_Avkon::title_pane_g2(0));
|
|
1113 |
return iconRect.Rect().Size();
|
|
1114 |
}
|
|
1115 |
|
|
1116 |
// -----------------------------------------------------------------------------
|
|
1117 |
// CFSEmailUiLayoutHandler::ListControlBarMailboxDefaultIconSize
|
|
1118 |
// -----------------------------------------------------------------------------
|
|
1119 |
TInt CFSEmailUiLayoutHandler::ListControlBarMailboxDefaultIconSize() const
|
|
1120 |
{
|
|
1121 |
FUNC_LOG;
|
|
1122 |
return GetControlBarMailboxIconRect().Size().iWidth;
|
|
1123 |
}
|
|
1124 |
|
|
1125 |
// -----------------------------------------------------------------------------
|
|
1126 |
// CFSEmailUiLayoutHandler::EMailListBarBgIconSize
|
|
1127 |
// -----------------------------------------------------------------------------
|
|
1128 |
TInt CFSEmailUiLayoutHandler::EMailListBarBgIconSize() const
|
|
1129 |
{
|
|
1130 |
FUNC_LOG;
|
|
1131 |
return GetControlBarRect().Size().iHeight;
|
|
1132 |
}
|
|
1133 |
|
|
1134 |
// -----------------------------------------------------------------------------
|
|
1135 |
// CFSEmailUiLayoutHandler::ListTextureMailboxDefaultIconSize
|
|
1136 |
// -----------------------------------------------------------------------------
|
|
1137 |
TInt CFSEmailUiLayoutHandler::ListTextureMailboxDefaultIconSize() const
|
|
1138 |
{
|
|
1139 |
FUNC_LOG;
|
|
1140 |
return KListTextureMailboxDefaultIconSize;
|
|
1141 |
}
|
|
1142 |
|
|
1143 |
// -----------------------------------------------------------------------------
|
|
1144 |
// CFSEmailUiLayoutHandler::EListTextureSelectorSize
|
|
1145 |
// -----------------------------------------------------------------------------
|
|
1146 |
TInt CFSEmailUiLayoutHandler::EListTextureSelectorSize() const
|
|
1147 |
{
|
|
1148 |
FUNC_LOG;
|
|
1149 |
return OneLineListItemHeight();
|
|
1150 |
}
|
|
1151 |
|
|
1152 |
// -----------------------------------------------------------------------------
|
|
1153 |
// CFSEmailUiLayoutHandler::ListControlMenuIconSize
|
|
1154 |
// -----------------------------------------------------------------------------
|
|
1155 |
TInt CFSEmailUiLayoutHandler::ListControlMenuIconSize() const
|
|
1156 |
{
|
|
1157 |
FUNC_LOG;
|
|
1158 |
TRect mainPaneRect;
|
|
1159 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
1160 |
mainPaneRect.Move(-mainPaneRect.iTl);
|
|
1161 |
TAknLayoutRect controlBarRect;
|
|
1162 |
controlBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane(0));
|
|
1163 |
TAknLayoutRect iconRect;
|
|
1164 |
iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1(0));
|
|
1165 |
return iconRect.Rect().Height();
|
|
1166 |
}
|
|
1167 |
|
|
1168 |
// -----------------------------------------------------------------------------
|
|
1169 |
// CFSEmailUiLayoutHandler::AttachmentIconSize
|
|
1170 |
// -----------------------------------------------------------------------------
|
|
1171 |
TSize CFSEmailUiLayoutHandler::AttachmentIconSize() const
|
|
1172 |
{
|
|
1173 |
FUNC_LOG;
|
|
1174 |
TAknLayoutRect rect;
|
|
1175 |
rect.LayoutRect( TRect(0,0,0,0),
|
|
1176 |
AknLayoutScalable_Apps::list_single_dyc_row_pane_g1( 0 ).LayoutLine() );
|
|
1177 |
return rect.Rect().Size();
|
|
1178 |
}
|
|
1179 |
|
|
1180 |
// -----------------------------------------------------------------------------
|
|
1181 |
// CFSEmailUiLayoutHandler::ViewerHighlightTextureSize
|
|
1182 |
// -----------------------------------------------------------------------------
|
|
1183 |
TInt CFSEmailUiLayoutHandler::ViewerHighlightTextureSize() const
|
|
1184 |
{
|
|
1185 |
FUNC_LOG;
|
|
1186 |
return KViewerHighlightTextureSize;
|
|
1187 |
}
|
|
1188 |
|
|
1189 |
// -----------------------------------------------------------------------------
|
|
1190 |
// CFSEmailUiLayoutHandler::ControlBarArrowTextureXSize
|
|
1191 |
// -----------------------------------------------------------------------------
|
|
1192 |
TInt CFSEmailUiLayoutHandler::ControlBarArrowTextureXSize() const
|
|
1193 |
{
|
|
1194 |
FUNC_LOG;
|
|
1195 |
return KControlBarArrowTextureXSize;
|
|
1196 |
}
|
|
1197 |
|
|
1198 |
// -----------------------------------------------------------------------------
|
|
1199 |
// CFSEmailUiLayoutHandler::ControlBarArrowTextureYSize
|
|
1200 |
// -----------------------------------------------------------------------------
|
|
1201 |
TInt CFSEmailUiLayoutHandler::ControlBarArrowTextureYSize() const
|
|
1202 |
{
|
|
1203 |
FUNC_LOG;
|
|
1204 |
return KControlBarArrowTextureYSize;
|
|
1205 |
}
|
|
1206 |
|
|
1207 |
// -----------------------------------------------------------------------------
|
|
1208 |
// CFSEmailUiLayoutHandler::GetSkinColor
|
|
1209 |
// -----------------------------------------------------------------------------
|
|
1210 |
TRgb CFSEmailUiLayoutHandler::GetSkinColor( const TAknsItemID& aId,
|
|
1211 |
TInt aIndex, const TRgb& aFallbackColor ) const
|
|
1212 |
{
|
|
1213 |
FUNC_LOG;
|
|
1214 |
TRgb color;
|
|
1215 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
1216 |
|
|
1217 |
TInt err = AknsUtils::GetCachedColor(
|
|
1218 |
skin,
|
|
1219 |
color,
|
|
1220 |
aId,
|
|
1221 |
aIndex );
|
|
1222 |
if ( err != KErrNone )
|
|
1223 |
{
|
|
1224 |
color = aFallbackColor;
|
|
1225 |
}
|
|
1226 |
|
|
1227 |
return color;
|
|
1228 |
}
|
|
1229 |
|
|
1230 |
// -----------------------------------------------------------------------------
|
|
1231 |
// CFSEmailUiLayoutHandler::GetControlBarMailboxIconRect
|
|
1232 |
// -----------------------------------------------------------------------------
|
|
1233 |
TRect CFSEmailUiLayoutHandler::GetControlBarMailboxIconRect() const
|
|
1234 |
{
|
|
1235 |
FUNC_LOG;
|
|
1236 |
TRect mainPaneRect;
|
|
1237 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
1238 |
mainPaneRect.Move(-mainPaneRect.iTl);
|
|
1239 |
TAknLayoutRect controlBarRect;
|
|
1240 |
controlBarRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane(0));
|
|
1241 |
TAknLayoutRect iconRect;
|
|
1242 |
if ( Layout_Meta_Data::IsLandscapeOrientation() )
|
|
1243 |
{
|
|
1244 |
iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_g2(0));
|
|
1245 |
}
|
|
1246 |
else
|
|
1247 |
{
|
|
1248 |
if ( AknLayoutUtils::LayoutMirrored() )
|
|
1249 |
{
|
|
1250 |
iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g2(0));
|
|
1251 |
}
|
|
1252 |
else
|
|
1253 |
{
|
|
1254 |
iconRect.LayoutRect(controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1(0));
|
|
1255 |
}
|
|
1256 |
}
|
|
1257 |
return iconRect.Rect();
|
|
1258 |
}
|
|
1259 |
|
|
1260 |
// -----------------------------------------------------------------------------
|
|
1261 |
TRect CFSEmailUiLayoutHandler::GetControlBarNewEmailButtonRect() const
|
|
1262 |
{
|
|
1263 |
FUNC_LOG;
|
|
1264 |
TAknLayoutRect iconRect;
|
|
1265 |
TRect cbr = GetControlBarRect();
|
|
1266 |
if( Layout_Meta_Data::IsLandscapeOrientation() )
|
|
1267 |
{
|
|
1268 |
iconRect.LayoutRect( cbr,
|
|
1269 |
AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane(3) );
|
|
1270 |
}
|
|
1271 |
else
|
|
1272 |
{
|
|
1273 |
if ( AknLayoutUtils::LayoutMirrored() )
|
|
1274 |
{
|
|
1275 |
iconRect.LayoutRect( cbr,
|
|
1276 |
AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane(2) );
|
|
1277 |
}
|
|
1278 |
else
|
|
1279 |
{
|
|
1280 |
iconRect.LayoutRect( cbr,
|
|
1281 |
AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane(2) );
|
|
1282 |
}
|
|
1283 |
}
|
|
1284 |
|
|
1285 |
TRect rect = iconRect.Rect();
|
|
1286 |
rect.Move( -cbr.iTl );
|
|
1287 |
return rect;
|
|
1288 |
}
|
|
1289 |
|
|
1290 |
// -----------------------------------------------------------------------------
|
|
1291 |
// CFSEmailUiLayoutHandler::GetControlBarFolderListButtonRect
|
|
1292 |
// -----------------------------------------------------------------------------
|
|
1293 |
TRect CFSEmailUiLayoutHandler::GetControlBarFolderListButtonRect() const
|
|
1294 |
{
|
|
1295 |
FUNC_LOG;
|
|
1296 |
|
|
1297 |
TAknLayoutRect folderListButtonRect;
|
|
1298 |
TRect cbr = GetControlBarRect();
|
|
1299 |
if( Layout_Meta_Data::IsLandscapeOrientation() )
|
|
1300 |
{
|
|
1301 |
folderListButtonRect.LayoutRect( cbr,
|
|
1302 |
AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_cp1(3) );
|
|
1303 |
}
|
|
1304 |
else
|
|
1305 |
{
|
|
1306 |
folderListButtonRect.LayoutRect( cbr,
|
|
1307 |
AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane(2) );
|
|
1308 |
}
|
|
1309 |
|
|
1310 |
TRect rect = folderListButtonRect.Rect();
|
|
1311 |
rect.Move( -cbr.iTl );
|
|
1312 |
return rect;
|
|
1313 |
}
|
|
1314 |
|
|
1315 |
// -----------------------------------------------------------------------------
|
|
1316 |
// CFSEmailUiLayoutHandler::GetControlBarSortButtonRect
|
|
1317 |
// -----------------------------------------------------------------------------
|
|
1318 |
TRect CFSEmailUiLayoutHandler::GetControlBarSortButtonRect() const
|
|
1319 |
{
|
|
1320 |
FUNC_LOG;
|
|
1321 |
|
|
1322 |
TAknLayoutRect sortButtonRect;
|
|
1323 |
TRect cbr = GetControlBarRect();
|
|
1324 |
if( Layout_Meta_Data::IsLandscapeOrientation() )
|
|
1325 |
{
|
|
1326 |
sortButtonRect.LayoutRect( cbr,
|
|
1327 |
AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_cp2(3) );
|
|
1328 |
}
|
|
1329 |
else
|
|
1330 |
{
|
|
1331 |
if ( AknLayoutUtils::LayoutMirrored() )
|
|
1332 |
{
|
|
1333 |
sortButtonRect.LayoutRect( cbr,
|
|
1334 |
AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane(2) );
|
|
1335 |
}
|
|
1336 |
else
|
|
1337 |
{
|
|
1338 |
sortButtonRect.LayoutRect( cbr,
|
|
1339 |
AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane(2) );
|
|
1340 |
}
|
|
1341 |
}
|
|
1342 |
|
|
1343 |
TRect r = sortButtonRect.Rect();
|
|
1344 |
r.Move( -cbr.iTl );
|
|
1345 |
return r;
|
|
1346 |
}
|
|
1347 |
|
|
1348 |
// -----------------------------------------------------------------------------
|
|
1349 |
// CFSEmailUiLayoutHandler::GetControlBarConnectionIconRect
|
|
1350 |
// -----------------------------------------------------------------------------
|
|
1351 |
TRect CFSEmailUiLayoutHandler::GetControlBarConnectionIconRect() const
|
|
1352 |
{
|
|
1353 |
FUNC_LOG;
|
|
1354 |
TRect mainPaneRect;
|
|
1355 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
1356 |
mainPaneRect.Move(-mainPaneRect.iTl);
|
|
1357 |
TAknLayoutRect controlBarRect;
|
|
1358 |
controlBarRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane(0 ) );
|
|
1359 |
TAknLayoutRect iconRect;
|
|
1360 |
|
|
1361 |
if ( AknLayoutUtils::LayoutMirrored() )
|
|
1362 |
{
|
|
1363 |
iconRect.LayoutRect( controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1( 0 ) );
|
|
1364 |
}
|
|
1365 |
else
|
|
1366 |
{
|
|
1367 |
iconRect.LayoutRect( controlBarRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g2( 0 ) );
|
|
1368 |
}
|
|
1369 |
|
|
1370 |
return iconRect.Rect();
|
|
1371 |
}
|
|
1372 |
|
|
1373 |
// -----------------------------------------------------------------------------
|
|
1374 |
// CFSEmailUiLayoutHandler::GetControlBarRect
|
|
1375 |
// -----------------------------------------------------------------------------
|
|
1376 |
TRect CFSEmailUiLayoutHandler::GetControlBarRect() const
|
|
1377 |
{
|
|
1378 |
FUNC_LOG;
|
|
1379 |
TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 3 : 2;
|
|
1380 |
|
|
1381 |
TRect mainPaneRect;
|
|
1382 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
1383 |
mainPaneRect.Move(-mainPaneRect.iTl);
|
|
1384 |
|
|
1385 |
TRect emailRect = mainPaneRect;
|
|
1386 |
TAknLayoutRect emailPaneRect;
|
|
1387 |
emailPaneRect.LayoutRect(mainPaneRect,
|
|
1388 |
AknLayoutScalable_Apps::main_sp_fs_email_pane());
|
|
1389 |
emailRect = emailPaneRect.Rect();
|
|
1390 |
|
|
1391 |
TAknLayoutRect controlBarRect;
|
|
1392 |
controlBarRect.LayoutRect( emailRect,
|
|
1393 |
AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane(var));
|
|
1394 |
TRect rect = controlBarRect.Rect();
|
|
1395 |
|
|
1396 |
return rect;
|
|
1397 |
}
|
|
1398 |
|
|
1399 |
// -----------------------------------------------------------------------------
|
|
1400 |
// CFSEmailUiLayoutHandler::GetListRect
|
|
1401 |
// -----------------------------------------------------------------------------
|
|
1402 |
TRect CFSEmailUiLayoutHandler::GetListRect( TBool aControlsOnTop ) const
|
|
1403 |
{
|
|
1404 |
FUNC_LOG;
|
|
1405 |
TBool landscape = Layout_Meta_Data::IsLandscapeOrientation();
|
|
1406 |
TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 3 : 2;
|
|
1407 |
|
|
1408 |
TRect mainPaneRect;
|
|
1409 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
1410 |
mainPaneRect.Move(-mainPaneRect.iTl);
|
|
1411 |
|
|
1412 |
TAknLayoutRect listRect;
|
|
1413 |
listRect.LayoutRect( mainPaneRect,
|
|
1414 |
AknLayoutScalable_Apps::main_sp_fs_listscroll_pane_te_cp01( var ));
|
|
1415 |
TRect rect = listRect.Rect();
|
|
1416 |
|
|
1417 |
// if control bar is required, reserve space on top of the listbox
|
|
1418 |
if( aControlsOnTop && landscape )
|
|
1419 |
{
|
|
1420 |
listRect.LayoutRect( mainPaneRect,
|
|
1421 |
AknLayoutScalable_Apps::main_sp_fs_listscroll_pane_te_cp01( 0 ));
|
|
1422 |
rect = listRect.Rect();
|
|
1423 |
}
|
|
1424 |
|
|
1425 |
return rect;
|
|
1426 |
}
|
|
1427 |
|
|
1428 |
// -----------------------------------------------------------------------------
|
|
1429 |
// CFSEmailUiLayoutHandler::GetSearchListHeaderTextLayout
|
|
1430 |
// -----------------------------------------------------------------------------
|
|
1431 |
TAknLayoutText CFSEmailUiLayoutHandler::GetSearchListHeaderTextLayout() const
|
|
1432 |
{
|
|
1433 |
FUNC_LOG;
|
|
1434 |
TRect mainPaneRect;
|
|
1435 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
1436 |
mainPaneRect.Move(-mainPaneRect.iTl);
|
|
1437 |
TAknLayoutRect headerRect;
|
|
1438 |
headerRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane());
|
|
1439 |
TAknLayoutText textLayout;
|
|
1440 |
textLayout.LayoutText(headerRect.Rect(), AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1());
|
|
1441 |
return textLayout;
|
|
1442 |
}
|
|
1443 |
|
|
1444 |
// -----------------------------------------------------------------------------
|
|
1445 |
// CFSEmailUiLayoutHandler::FSTextStyleFromLayoutL
|
|
1446 |
// -----------------------------------------------------------------------------
|
|
1447 |
CAlfTextStyle& CFSEmailUiLayoutHandler::FSTextStyleFromLayoutL( const TAknTextComponentLayout& aLayout )
|
|
1448 |
{
|
|
1449 |
FUNC_LOG;
|
|
1450 |
CAlfTextStyle** findResult = iTextStyleMap.Find( aLayout );
|
|
1451 |
CAlfTextStyle* style = NULL;
|
|
1452 |
if( !findResult )
|
|
1453 |
{
|
|
1454 |
TInt fontStyle(0);
|
|
1455 |
fontStyle = CAlfStatic::Env().TextStyleManager().CreatePlatformTextStyleL( aLayout.Font(), EAlfTextStyleNormal );
|
|
1456 |
style = CAlfStatic::Env().TextStyleManager().TextStyle( fontStyle );
|
|
1457 |
TInt insertError( iTextStyleMap.Insert( aLayout, style ) );
|
|
1458 |
if( insertError )
|
|
1459 |
{
|
|
1460 |
CAlfStatic::Env().TextStyleManager().DeleteTextStyle( style->Id() );
|
|
1461 |
User::Leave( insertError );
|
|
1462 |
}
|
|
1463 |
TAknLayoutText textLayout;
|
|
1464 |
textLayout.LayoutText(TRect(0,0,0,0), aLayout);
|
|
1465 |
style->SetBold(textLayout.Font()->FontSpecInTwips().iFontStyle.StrokeWeight());
|
|
1466 |
style->SetItalic(textLayout.Font()->FontSpecInTwips().iFontStyle.Posture());
|
|
1467 |
}
|
|
1468 |
else
|
|
1469 |
{
|
|
1470 |
style = *findResult;
|
|
1471 |
}
|
|
1472 |
return *style;
|
|
1473 |
}
|
|
1474 |
|
|
1475 |
// -----------------------------------------------------------------------------
|
|
1476 |
// CFSEmailUiLayoutHandler::DeleteTextStyles
|
|
1477 |
// -----------------------------------------------------------------------------
|
|
1478 |
void CFSEmailUiLayoutHandler::DeleteTextStyles()
|
|
1479 |
{
|
|
1480 |
FUNC_LOG;
|
|
1481 |
THashMapIter< TAknTextComponentLayout, CAlfTextStyle* >
|
|
1482 |
mapIterator( iTextStyleMap );
|
|
1483 |
CAlfTextStyle** value = mapIterator.CurrentValue();
|
|
1484 |
while( value )
|
|
1485 |
{
|
|
1486 |
CAlfStatic::Env().TextStyleManager().DeleteTextStyle( ( *value )->Id() );
|
|
1487 |
mapIterator.RemoveCurrent();
|
|
1488 |
mapIterator.NextValue();
|
|
1489 |
value = mapIterator.CurrentValue();
|
|
1490 |
}
|
|
1491 |
iTextStyleMap.Close();
|
|
1492 |
}
|
|
1493 |
|
|
1494 |
// -----------------------------------------------------------------------------
|
|
1495 |
// CFSEmailUiLayoutHandler::ListCmailPaneRect
|
|
1496 |
// -----------------------------------------------------------------------------
|
|
1497 |
TRect CFSEmailUiLayoutHandler::ListCmailPaneRect() const
|
|
1498 |
{
|
|
1499 |
FUNC_LOG;
|
|
1500 |
|
|
1501 |
TRect mainPaneRect;
|
|
1502 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
1503 |
TAknLayoutRect layoutRect;
|
|
1504 |
layoutRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_email_pane() );
|
|
1505 |
layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::listscroll_cmail_pane() );
|
|
1506 |
layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_cmail_pane() );
|
|
1507 |
return layoutRect.Rect();
|
|
1508 |
}
|
|
1509 |
|
|
1510 |
// -----------------------------------------------------------------------------
|
|
1511 |
// CFSEmailUiLayoutHandler::TitleCaptionPadding
|
|
1512 |
//
|
|
1513 |
// Returns padding value for title caption visual
|
|
1514 |
// -----------------------------------------------------------------------------
|
|
1515 |
TInt CFSEmailUiLayoutHandler::TitleCaptionPadding() const
|
|
1516 |
{
|
|
1517 |
TRect mainPaneRect;
|
|
1518 |
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
|
|
1519 |
|
|
1520 |
TAknLayoutRect ctrlBarPane;
|
|
1521 |
ctrlBarPane.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane( 0 ) );
|
|
1522 |
const TRect ctrlBarPaneRect( ctrlBarPane.Rect() );
|
|
1523 |
|
|
1524 |
TAknLayoutText ctrlBarPaneT1;
|
|
1525 |
ctrlBarPaneT1.LayoutText( ctrlBarPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_t1( 0 ) );
|
|
1526 |
const TRect ctrlBarPaneT1Rect( ctrlBarPaneT1.TextRect() );
|
|
1527 |
|
|
1528 |
return Abs( ctrlBarPaneRect.iTl.iY - ctrlBarPaneT1Rect.iTl.iY );
|
|
1529 |
}
|
|
1530 |
|
|
1531 |
// -----------------------------------------------------------------------------
|
|
1532 |
// CFSEmailUiLayoutHandler::SeparatorGraphicSizeInThisResolution
|
|
1533 |
// -----------------------------------------------------------------------------
|
|
1534 |
//
|
|
1535 |
TSize CFSEmailUiLayoutHandler::SeparatorGraphicSizeInThisResolution() const
|
|
1536 |
{
|
|
1537 |
FUNC_LOG;
|
|
1538 |
|
|
1539 |
TRect mainPaneRect;
|
|
1540 |
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
|
|
1541 |
|
|
1542 |
TAknLayoutRect listRect;
|
|
1543 |
listRect.LayoutRect(mainPaneRect, AknLayoutScalable_Apps::list_cmail_pane());
|
|
1544 |
|
|
1545 |
TAknLayoutRect bodyRect;
|
|
1546 |
bodyRect.LayoutRect(listRect.Rect(), AknLayoutScalable_Apps::list_cmail_body_pane());
|
|
1547 |
|
|
1548 |
TAknLayoutRect itemRect;
|
|
1549 |
itemRect.LayoutRect(bodyRect.Rect(), AknLayoutScalable_Apps::list_cmail_body_pane_g1());
|
|
1550 |
|
|
1551 |
return itemRect.Rect().Size();
|
|
1552 |
}
|
|
1553 |
|
|
1554 |
// -----------------------------------------------------------------------------
|
|
1555 |
// CFSEmailUiLayoutHandler::SeparatorLineColor
|
|
1556 |
// -----------------------------------------------------------------------------
|
|
1557 |
//
|
|
1558 |
TRgb CFSEmailUiLayoutHandler::SeparatorLineColor() const
|
|
1559 |
{
|
|
1560 |
FUNC_LOG;
|
|
1561 |
return ViewerNormalHotspotTextColor();
|
|
1562 |
}
|
|
1563 |
|
|
1564 |
// -----------------------------------------------------------------------------
|
|
1565 |
// CFSEmailUiLayoutHandler::DropDownMenuListPadding
|
|
1566 |
// -----------------------------------------------------------------------------
|
|
1567 |
//
|
|
1568 |
TInt CFSEmailUiLayoutHandler::DropDownMenuListPadding() const
|
|
1569 |
{
|
|
1570 |
FUNC_LOG;
|
|
1571 |
// main pane
|
|
1572 |
TRect mainPaneRect;
|
|
1573 |
AknLayoutUtils::LayoutMetricsRect(
|
|
1574 |
AknLayoutUtils::EMainPane, mainPaneRect );
|
|
1575 |
|
|
1576 |
// menu pane
|
|
1577 |
TAknLayoutRect menuPane;
|
|
1578 |
menuPane.LayoutRect( mainPaneRect,
|
|
1579 |
AknLayoutScalable_Apps::popup_sp_fs_action_menu_pane( 2 ) );
|
|
1580 |
const TRect menuPaneRect( menuPane.Rect() );
|
|
1581 |
|
|
1582 |
// Menu gene pane
|
|
1583 |
TAknLayoutRect menuListPane;
|
|
1584 |
menuListPane.LayoutRect( menuPaneRect,
|
|
1585 |
AknLayoutScalable_Apps::sp_fs_action_menu_list_pane( 0 ) );
|
|
1586 |
const TRect menuListPaneRect( menuListPane.Rect() );
|
|
1587 |
|
|
1588 |
return Abs( menuListPaneRect.iTl.iY - menuPaneRect.iTl.iY );
|
|
1589 |
}
|
|
1590 |
|
|
1591 |
// End of file
|
|
1592 |
|