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