emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h
branchRCL_3
changeset 64 3533d4323edc
child 73 c8382f7b54ef
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     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 definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FREESTYLEEMAILUI_LAYOUTHANDLER_H__
       
    20 #define __FREESTYLEEMAILUI_LAYOUTHANDLER_H__
       
    21 
       
    22 // SYSTEM INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <e32hashtab.h>
       
    25 #include <alf/alfenv.h>
       
    26 #include <alf/alftextstyle.h>
       
    27 #include <AknLayout2ScalableDef.h>
       
    28 #include <AknUtils.h>
       
    29 // INTERNAL INCLUDES
       
    30 #include "FreestyleEmailUiLayoutData.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CFsTreeList;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 class CFSEmailUiLayoutHandler : public CBase
       
    37     {
       
    38 	public:
       
    39     
       
    40         /*
       
    41          * Side parameter for drop down menu
       
    42          */
       
    43         enum TDropDownMenuSide 
       
    44             {
       
    45             ELeft,
       
    46             ERight
       
    47             };
       
    48 
       
    49     public: 
       
    50     	static CFSEmailUiLayoutHandler* NewL( CAlfEnv& aEnv  );
       
    51     	~CFSEmailUiLayoutHandler();
       
    52 				
       
    53 		// Function returns orientation of the currect screen resolution
       
    54 		TScreenOrientation ScreenOrientation() const;
       
    55 
       
    56 		// Main UI grid icon size
       
    57 		TSize GridIconSize() const;
       
    58 
       
    59 		// Grid rows and columns
       
    60 		TInt GridRowsInThisResolution() const;
       
    61 		TInt GridColumnsInThisResolution() const;
       
    62 
       
    63 		// Grid normal state text color, same as focused
       
    64 		TRgb GridNormalStateTextSkinColor() const;
       
    65 		
       
    66 		// One line node and item height
       
    67 		TInt OneLineListNodeHeight() const;
       
    68 		TInt OneLineListItemHeight() const;
       
    69 		TInt TwoLineListItemHeight() const;
       
    70     	// <cmail>
       
    71 		// Folder list item heigh
       
    72 		TInt FolderListOneLineItemHeight( const TBool& aFullscreen ) const;
       
    73 		
       
    74 		// Mail icon size
       
    75 		TSize MailIconSizeInThisResolution() const;
       
    76 
       
    77 		// For setting list marquee behaviour 
       
    78 		void SetListMarqueeBehaviour( CFsTreeList* aTreeList ) const;
       
    79 
       
    80         // Folder list icon size
       
    81 		TSize FolderListIconSize( const TBool aPopup = EFalse ) const;
       
    82 
       
    83 		// List pane size including scroll pane
       
    84 	    TRect FolderListPaneRectInThisResolution( const TRect& aParent ) const;
       
    85 
       
    86 		// Scroll pane list item size
       
    87 		TSize FolderListItemSizeInThisResolution( const TRect& aParent ) const;
       
    88 		
       
    89         // Drop down menu rect
       
    90 		TRect DropDownMenuListRect( const TDropDownMenuSide aSide, TBool aStretch = ETrue ) const;
       
    91     	// </cmail>
       
    92 
       
    93 		// Folder list pane indentation in pixels
       
    94 		TInt FolderListIndentation( const TRect& aParent ) const;
       
    95 
       
    96 		// Selector ring size for the current resolution
       
    97 		TSize SelectorVisualSizeInThisResolution() const;
       
    98 
       
    99 		// FS Email UI fonts, returns font style. Calling
       
   100 		// View may set text visual style using SetTextStyle( CAlfTextStyle.Id() )
       
   101 		CAlfTextStyle* FSTextStyleFromIdL( TFSEmailFont aFontId );
       
   102 		
       
   103 		// Control bar list padding
       
   104 		TPoint ControlBarListPadding() const;
       
   105 
       
   106 		// Control bar list border rounding size in pixels, used e.g. to
       
   107 		// calculate the background image border size
       
   108 		TInt ControlBarListBorderRoundingSize() const;
       
   109 
       
   110 		// Control bar button bg rounding size
       
   111 		TInt ControlBarButtonBgRoundingSize() const;
       
   112 
       
   113 		// Control bar height
       
   114 		TInt ControlBarHeight() const;
       
   115 
       
   116 		// List fade effect times
       
   117         TInt ListFadeInEffectTime() const;
       
   118         TInt ListFadeOutEffectTime() const;
       
   119 
       
   120 		// Status indicator fade effect time
       
   121 		TInt StatusIndicatorFadeEffectTime() const;
       
   122 
       
   123 		// Control bar list fade effect time
       
   124 		TInt CtrlBarListFadeEffectTime() const;
       
   125 
       
   126 		// View cross fade effect
       
   127 		TBool ViewFadeEffectActive() const;
       
   128 		TInt ViewFadeInEffectTime() const;
       
   129         TInt ViewFadeOutEffectTime() const;
       
   130 		
       
   131 		// View slide effect time
       
   132 		TBool ViewSlideEffectActive() const;
       
   133 		TInt ViewSlideEffectTime() const;
       
   134 
       
   135 		// List scrolling delay
       
   136 		TInt ListScrollingTime() const;
       
   137 		
       
   138 		// List item expansion delay
       
   139 		TInt ListItemExpansionDelay() const;
       
   140 
       
   141 		// Time to wait before previous view is hide
       
   142 		// (to enable enough time for transition effect)
       
   143 		TInt ViewHidingDelay() const;
       
   144 
       
   145 		// List focused state text color
       
   146 		TRgb ListFocusedStateTextSkinColor() const;
       
   147 
       
   148 		// List normal state text color
       
   149 		TRgb ListNormalStateTextSkinColor() const;
       
   150 		
       
   151 		// List node background color
       
   152 		TRgb ListNodeBackgroundColor() const;
       
   153 
       
   154 		// List node text color
       
   155 		TRgb ListNodeTextColor() const;
       
   156 		
       
   157 		// List header item bacground color
       
   158 		TRgb ListHeaderBackgroundColor() const;
       
   159 		
       
   160 		// List text style based on global zoom level
       
   161 		TInt ListTextStyle() const;
       
   162 
       
   163 		// Dropdown menu normal state text color
       
   164 		TRgb DropdownMenuTextColor() const;
       
   165 
       
   166 		// Text viewer font heigjht in twips global zoom level
       
   167 		TInt ViewerFontHeightInTwips() const;
       
   168 
       
   169 		// List items font heigjht in twips global zoom level
       
   170 		TInt ListItemFontHeightInTwips( const TBool aPopup = EFalse ) const;
       
   171 		
       
   172  		// Logical font id's for viewer fonts 		
       
   173 		TAknLogicalFontId ViewerTitleFontAknLogicalFontId() const;
       
   174 		TAknLogicalFontId ViewerTextFontAknLogicalFontId() const;
       
   175 
       
   176 		// Viewer font heights based on global zoom level
       
   177 		TInt ViewerTitleFontHeight() const;
       
   178 		TInt ViewerTextFontHeight() const;
       
   179 
       
   180 		// Viewer layout related heights between lines based on global zoom level
       
   181 		TInt ViewerTopMostSpaceHeight() const;
       
   182 		TInt ViewerRecipientSpaceHeight() const;
       
   183 		TInt ViewerHeaderInfoSpaceHeight() const;
       
   184 		TInt ViewerBottomMostSpaceHeight() const;
       
   185  
       
   186 		// Maximum number of addresses shown in the To, Cc, and Bcc fields
       
   187 		TInt ViewerMaxRecipientLineCount() const;
       
   188 		
       
   189 		// Maximum number of lines used to show the message subject
       
   190 		TInt ViewerMaxSubjectLineCount() const;
       
   191 		
       
   192 		// Viewer text colors. These methods 
       
   193 		// returns automatically fallback color if skin doesn't provide color
       
   194  		TRgb ViewerTitleTextColor() const;
       
   195  		TRgb ViewerTextTextColor() const;
       
   196  		TRgb ViewerBodyTextColor() const;
       
   197  		TRgb ViewerNormalHotspotTextColor() const;
       
   198  		TRgb ViewerHighlightedHotspotTextColor() const;
       
   199  		TRgb ViewerSentTextColor() const;
       
   200  
       
   201  		// Viewer pixels between msg status and follow up icons and subject text
       
   202 		TInt ViewerPixelsBetweenMsgStatusIconAndSubject() const;
       
   203 		
       
   204 		// Viewer message status and follow up icon sizes in 
       
   205 		TSize ViewerIconSize() const;
       
   206 		
       
   207 		// Viewer transparent indentation icon size which is used to get
       
   208 		// certain amouth of pixel identation
       
   209 		TSize ViewerIndentationIconSize() const;
       
   210 
       
   211 		// Arrow icon used to indicate action menu
       
   212 		TSize ViewerActionMenuIconSize() const;
       
   213         TInt ViewerActionMenuIconMargin() const;
       
   214 		
       
   215 		// Viewer right and left margins
       
   216 		TInt ViewerRightMarginInPixels() const;
       
   217 		TInt ViewerLeftMarginInPixels() const;
       
   218 		
       
   219 		// Viewer hotspot selector
       
   220 		TReal ViewerSelectorOpacity() const;
       
   221 		
       
   222 		// Viewer watermark size and place from bottom right corner for current resolution
       
   223 		TSize ViewerWaterMarkSizeInThisResolution() const;
       
   224 		TPoint ViewerWaterMarkPlaceFromBottomRightCornerInThisResolution() const;
       
   225 		
       
   226 		// Composer address, subject, and attachment field colors
       
   227 		TRgb ComposerFieldBorderColor() const;
       
   228 		TRgb ComposerFieldBackgroundColor() const;
       
   229 		
       
   230 		// Composer text colors
       
   231 		TRgb ComposerHeaderFieldTextColor() const;
       
   232 		TRgb ComposerBodyFieldTextColor() const;
       
   233 		TRgb ComposerDimmedTextColor() const;
       
   234 		
       
   235 		// Predictive contact search popup
       
   236 		TInt MaxPcsMatches() const;
       
   237 		TInt PcsPopupDimmedFontTransparency() const;
       
   238 		
       
   239 		//To retrieve respecitve Icon Sizes
       
   240 		TInt ListTextureNodeExpandedSize() const;
       
   241 		TInt SearchLookingGlassIconSize() const;
       
   242 		TSize statusPaneIconSize() const;
       
   243 		TInt ListControlBarMailboxDefaultIconSize() const;
       
   244 		TInt EMailListBarBgIconSize() const;
       
   245 		TInt ListTextureMailboxDefaultIconSize() const;
       
   246 		TInt EListTextureSelectorSize() const;
       
   247 		TInt ListControlMenuIconSize() const;
       
   248 		//<cmail>
       
   249 		TSize AttachmentIconSize() const;
       
   250         //</cmail>
       
   251 		TInt ViewerHighlightTextureSize() const;
       
   252 		TInt ControlBarArrowTextureXSize() const;
       
   253 		TInt ControlBarArrowTextureYSize() const;
       
   254 
       
   255 		TRect GetControlBarMailboxIconRect() const;
       
   256 		TRect GetControlBarNewEmailButtonRect() const;
       
   257 		TRect GetControlBarFolderListButtonRect() const;
       
   258         TRect GetControlBarSortButtonRect() const;
       
   259         TRect GetControlBarConnectionIconRect() const;
       
   260 
       
   261         TRect GetControlBarRect() const;
       
   262 
       
   263         TRect GetListRect( TBool aControlsOnTop = EFalse ) const;
       
   264 
       
   265 		CAlfTextStyle& FSTextStyleFromLayoutL( const TAknTextComponentLayout& aLayout  );
       
   266 		TInt TitleCaptionPadding() const;
       
   267         TRect ListCmailPaneRect() const;
       
   268 
       
   269 		TAknLayoutText GetSearchListHeaderTextLayout() const;
       
   270 
       
   271 		// Separator size
       
   272         TSize SeparatorGraphicSizeInThisResolution() const;
       
   273         
       
   274 		// Separator line color
       
   275         TRgb CFSEmailUiLayoutHandler::SeparatorLineColor() const;        
       
   276 
       
   277 		// Padding value for drop down menu
       
   278         TInt DropDownMenuListPadding() const;
       
   279 
       
   280     private:
       
   281 		CFSEmailUiLayoutHandler( CAlfEnv& aEnv );
       
   282      	void ConstructL(); 
       
   283  
       
   284      	TRgb GetSkinColor( const TAknsItemID& aID, TInt aIndex, const TRgb& aFallbackColor ) const;
       
   285         void DeleteTextStyles();
       
   286 
       
   287 	private:
       
   288 		CAlfEnv& iEnv;
       
   289 		RHashMap< TAknTextComponentLayout, CAlfTextStyle* > iTextStyleMap;
       
   290 	};
       
   291 
       
   292 #endif //__FREESTYLEEMAILUI_LAYOUTHANDLER_H__
       
   293 
       
   294 // End of File
       
   295 
       
   296