menufw/menufwui/mmwidgets/inc/mmtemplatelibrary.h
changeset 1 5315654608de
parent 0 f72a12da539e
equal deleted inserted replaced
0:f72a12da539e 1:5315654608de
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  
    14 * Description:
    15 *  Version     : %version: MM_24.1.8 % << Don't touch! Updated by Synergy at check-out.
    15 *  Version     : %version: MM_24.1.9 % << Don't touch! Updated by Synergy at check-out.
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 #ifndef MMTEMPLATELIBRARY_H
    20 #ifndef MMTEMPLATELIBRARY_H
    41 
    41 
    42 // STRUCT DECLARATION
    42 // STRUCT DECLARATION
    43 
    43 
    44 /**
    44 /**
    45  *  Struct used to store template child data
    45  *  Struct used to store template child data
    46  * 
    46  *
    47  * @since S60 v5.0
    47  * @since S60 v5.0
    48  * @ingroup group_mmwidgets
    48  * @ingroup group_mmwidgets
    49  */
    49  */
    50 class TTemplateChild
    50 class TTemplateChild
    51     {
    51     {
    52     
    52 
    53 public:
    53 public:
    54 	
    54 
    55     /**
    55     /**
    56      * Rectangle of subcell according to position in item.
    56      * Rectangle of subcell according to position in item.
    57      */
    57      */
    58     TRect iRectAccordingToParent;
    58     TRect iRectAccordingToParent;
    59     
    59 
    60     /**
    60     /**
    61      * Data type represented by the subcell.
    61      * Data type represented by the subcell.
    62      */
    62      */
    63     TBufC8<64> iData;
    63     TBufC8<64> iData;
    64     
    64 
    65     /**
    65     /**
    66      * The LCT template used to calculate the subcell position.
    66      * The LCT template used to calculate the subcell position.
    67      */
    67      */
    68     TBufC8<64> iLct;
    68     TBufC8<64> iLct;
    69     
    69 
    70     /**
    70     /**
    71      * The variety for the lct template.
    71      * The variety for the lct template.
    72      */
    72      */
    73     TInt iVariety;
    73     TInt iVariety;
    74     
    74 
    75     /**
    75     /**
    76      * Depicts if the subcell is an image or text.
    76      * Depicts if the subcell is an image or text.
    77      */
    77      */
    78     TBool iIsImage;
    78     TBool iIsImage;
    79     
    79 
    80     /**
    80     /**
    81      * The font id used for displaying text.
    81      * The font id used for displaying text.
    82      */
    82      */
    83     TAknLogicalFontId iFontId;
    83     TAknLogicalFontId iFontId;
    84     
    84 
    85     /**
    85     /**
    86      * The type of align for the text.
    86      * The type of align for the text.
    87      */
    87      */
    88     CGraphicsContext::TTextAlign  iTextAlign;
    88     CGraphicsContext::TTextAlign  iTextAlign;
    89     
    89 
    90     /**
    90     /**
    91      * The additional Id for a subcell element used to differentiate it
    91      * The additional Id for a subcell element used to differentiate it
    92      * from others. e.g the backdrop image has a different visual id 
    92      * from others. e.g the backdrop image has a different visual id
    93      * since it is displayed only in edit mode.
    93      * since it is displayed only in edit mode.
    94      */
    94      */
    95     TImageVisualId iImageVisualId;
    95     TImageVisualId iImageVisualId;
    96     
    96 
    97     /**
    97     /**
    98      * The type of horizontal align for the icon.
    98      * The type of horizontal align for the icon.
    99      */
    99      */
   100     TManualAlign iHAlign;
   100     TManualAlign iHAlign;
   101 
   101 
   103 
   103 
   104 // CLASS DECLARATION
   104 // CLASS DECLARATION
   105 
   105 
   106 /**
   106 /**
   107  *  Used by Multimedia Menu to load template data.
   107  *  Used by Multimedia Menu to load template data.
   108  *  
   108  *
   109  *  @code
   109  *  @code
   110  *  @endcode
   110  *  @endcode
   111  *  @lib mmwidgets
   111  *  @lib mmwidgets
   112  *  @since S60 v3.0
   112  *  @since S60 v3.0
   113  *  @ingroup group_mmwidgets
   113  *  @ingroup group_mmwidgets
   114  */
   114  */
   115 NONSHARABLE_CLASS( CMmTemplateLibrary ) : public CBase
   115 NONSHARABLE_CLASS( CMmTemplateLibrary ) : public CBase
   116 	{
   116 	{
   117 public:
   117 public:
   118 	// Constructors and destructor
   118 	// Constructors and destructor
   119     
   119 
   120     /**
   120     /**
   121      * Destructor.
   121      * Destructor.
   122      */
   122      */
   123     ~CMmTemplateLibrary();
   123     ~CMmTemplateLibrary();
   124 
   124 
   125 	/**
   125 	/**
   126 	 * Two-phased constructor.
   126 	 * Two-phased constructor.
   127 	 */
   127 	 */
   128 	IMPORT_C static CMmTemplateLibrary* NewL();
   128 	IMPORT_C static CMmTemplateLibrary* NewL();
   129 	
   129 
   130 	/**
   130 	/**
   131      * Two-phased constructor.
   131      * Two-phased constructor.
   132      */
   132      */
   133 	IMPORT_C static CMmTemplateLibrary* NewLC();
   133 	IMPORT_C static CMmTemplateLibrary* NewLC();
   134 
   134 
   146 
   146 
   147 public:
   147 public:
   148 
   148 
   149 	/**
   149 	/**
   150 	 * Gets the size of template item according to highlight and orientation.
   150 	 * Gets the size of template item according to highlight and orientation.
   151 	 * 
   151 	 *
   152 	 * @since S60 v3.0
   152 	 * @since S60 v3.0
   153 	 * @param aWidgetType The widget type.
   153 	 * @param aWidgetType The widget type.
   154 	 * @param aTemplate The current template for the item. 
   154 	 * @param aTemplate The current template for the item.
   155 	 * @param aLandscapeOrientation Is view in landscape orientation.
   155 	 * @param aLandscapeOrientation Is view in landscape orientation.
   156 	 * @param aHighlighted Is item highlighted.
   156 	 * @param aHighlighted Is item highlighted.
   157 	 * @param aParentRect The bounding rect in which the item is drawn.
   157 	 * @param aParentRect The bounding rect in which the item is drawn.
   158 	 * 
   158 	 *
   159 	 * @return size of item
   159 	 * @return size of item
   160 	 */
   160 	 */
   161 	TSize GetSize( TMmWidgetType aWidgetType, const TDesC8& aTemplate, 
   161 	TSize GetSize( TMmWidgetType aWidgetType, const TDesC8& aTemplate,
   162 			TBool aLandscapeOrientation = 0, TBool aHighlighted = 0, 
   162 			TBool aLandscapeOrientation = 0, TBool aHighlighted = 0,
   163 			TRect aParentRect = TRect() );
   163 			TRect aParentRect = TRect() );
   164     
   164 
   165     /**
   165     /**
   166      * Gets the size of template.
   166      * Gets the size of template.
   167      * 
   167      *
   168      * @since S60 v3.0
   168      * @since S60 v3.0
   169      * @param aItemSize Item size to be set.
   169      * @param aItemSize Item size to be set.
   170      * @param aWidgetType The widget type.
   170      * @param aWidgetType The widget type.
   171 	 * @param aTemplate The current template for the item. 
   171 	 * @param aTemplate The current template for the item.
   172 	 * @param aLandscapeOrientation Is view in landscape orientation. 
   172 	 * @param aLandscapeOrientation Is view in landscape orientation.
   173 	 * @param aHighlighted Is item highlighted.
   173 	 * @param aHighlighted Is item highlighted.
   174 	 * @param aParentRect The bounding rect in which the item is drawn.
   174 	 * @param aParentRect The bounding rect in which the item is drawn.
   175 	 * 
   175 	 *
   176      * @return error code
   176      * @return error code
   177      */
   177      */
   178 	TInt GetSize(  TSize& aItemSize, TMmWidgetType aWidgetType, 
   178 	TInt GetSize(  TSize& aItemSize, TMmWidgetType aWidgetType,
   179 	        const TDesC8& aTemplate, TBool aLandscapeOrientation, 
   179 	        const TDesC8& aTemplate, TBool aLandscapeOrientation,
   180 	        TBool aHighlighted , TRect aParentRect = TRect() );
   180 	        TBool aHighlighted , TRect aParentRect = TRect() );
   181     
   181 
   182     /**
   182     /**
   183      * Get array of templates for subcells ( item children ). 
   183      * Get array of templates for subcells ( item children ).
   184      * 
   184      *
   185      * @since S60 v3.0
   185      * @since S60 v3.0
   186      * @param aWidgetType The widget type.
   186      * @param aWidgetType The widget type.
   187      * @param aArray The array of subcell children to be set.
   187      * @param aArray The array of subcell children to be set.
   188      * @param aTemplate The current template for the item.
   188      * @param aTemplate The current template for the item.
   189      * @param aLandscapeOrientation Is view in landscape orientation.
   189      * @param aLandscapeOrientation Is view in landscape orientation.
   190      * @param aHighlighted Is item highlighted.
   190      * @param aHighlighted Is item highlighted.
   191      * @param aIsEditMode Is in edit mode. 
   191      * @param aIsEditMode Is in edit mode.
   192      * 
   192      *
   193      */
   193      */
   194 	void GetChildrenL( TMmWidgetType aWidgetType,
   194 	void GetChildrenL( TMmWidgetType aWidgetType,
   195 			RArray< TTemplateChild >& aArray, const TDesC8& aTemplate, 
   195 			RArray< TTemplateChild >& aArray, const TDesC8& aTemplate,
   196 			TBool aLandscapeOrientation = 0, TBool aHighlighted = 0, TBool aIsEditMode = 0 );
   196 			TBool aLandscapeOrientation = 0, TBool aHighlighted = 0, TBool aIsEditMode = 0 );
   197     
   197 
   198     /**
   198     /**
   199      * Get the layout size ( Grid ) e.g. 3x4
   199      * Get the layout size ( Grid ) e.g. 3x4
   200      * 
   200      *
   201      * @since S60 v3.0
   201      * @since S60 v3.0
   202      * @param aWidgetType The widget type.
   202      * @param aWidgetType The widget type.
   203      * @param aTemplate The current template for the item.
   203      * @param aTemplate The current template for the item.
   204      * @param aLandscapeOrientation Is view in landscape orientation.
   204      * @param aLandscapeOrientation Is view in landscape orientation.
   205      * 
   205      *
   206      * @return the size of the layout.
   206      * @return the size of the layout.
   207      */
   207      */
   208 	TSize GetLayoutSizeL( TMmWidgetType aWidgetType, const TDesC8& aTemplate, 
   208 	TSize GetLayoutSizeL( TMmWidgetType aWidgetType, const TDesC8& aTemplate,
   209 			TBool aLandscapeOrientation );
   209 			TBool aLandscapeOrientation );
   210     
   210 
   211     /**
   211     /**
   212      * Get rect of move indicator according to item (as reference position).
   212      * Get rect of move indicator according to item (as reference position).
   213      * The rect is relevant to the item in point (0,0). 
   213      * The rect is relevant to the item in point (0,0).
   214      * e.g for item size 20x360 the rect can be (-5,-5):(365,25).
   214      * e.g for item size 20x360 the rect can be (-5,-5):(365,25).
   215      * 
   215      *
   216      * @since S60 v3.0
   216      * @since S60 v3.0
   217      * @param aWidgetType The widget type.
   217      * @param aWidgetType The widget type.
   218      * @param aTemplate The current template for the item.
   218      * @param aTemplate The current template for the item.
   219      * @param aLandscapeOrientation Is view in landscape orientation. 
   219      * @param aLandscapeOrientation Is view in landscape orientation.
   220      * @param aHighlighted Is item highlighted.
   220      * @param aHighlighted Is item highlighted.
   221      * 
   221      *
   222      * @return rect of move indicator area.
   222      * @return rect of move indicator area.
   223      */
   223      */
   224 	TRect GetMoveIndicatorRect( TMmWidgetType aWidgetType, const TDesC8& aTemplate, 
   224 	TRect GetMoveIndicatorRect( TMmWidgetType aWidgetType, const TDesC8& aTemplate,
   225 			TBool aLandscapeOrientation, TBool aHighlighted );
   225 			TBool aLandscapeOrientation, TBool aHighlighted );
   226     
   226 
   227     /**
   227     /**
   228      * Get children templates for move indicator. 
   228      * Get children templates for move indicator.
   229      * 
   229      *
   230      * @since S60 v3.0
   230      * @since S60 v3.0
   231      * @param aWidgetType The widget type.
   231      * @param aWidgetType The widget type.
   232      * @param aArray Array of children templates.
   232      * @param aArray Array of children templates.
   233      * @param aTemplate The current template for the item.
   233      * @param aTemplate The current template for the item.
   234      * @param aLandscapeOrientation Is view in landscape orientation.
   234      * @param aLandscapeOrientation Is view in landscape orientation.
   235      * @param aHighlighted Is item highlighted.
   235      * @param aHighlighted Is item highlighted.
   236      * 
   236      *
   237      */
   237      */
   238 	void GetMoveIndicatorChildrenL( TMmWidgetType aWidgetType,
   238 	void GetMoveIndicatorChildrenL( TMmWidgetType aWidgetType,
   239 			RArray< TTemplateChild >& aArray, const TDesC8& aTemplate, TBool aLandscapeOrientation, TBool aHighlighted );
   239 			RArray< TTemplateChild >& aArray, const TDesC8& aTemplate, TBool aLandscapeOrientation, TBool aHighlighted );
   240     
   240 
   241     /**
   241     /**
   242      * Get size of item for LCT template.
   242      * Get size of item for LCT template.
   243      * 
   243      *
   244      * @since S60 v3.0
   244      * @since S60 v3.0
   245      * @param aLCTTemplate The LCT template name.
   245      * @param aLCTTemplate The LCT template name.
   246      * @param aVariety The variety for aLCTTemplate.
   246      * @param aVariety The variety for aLCTTemplate.
   247      * @param aWindowLayout The window layout to be used to calculet the size.
   247      * @param aWindowLayout The window layout to be used to calculet the size.
   248      * @param aLandscapeOrientation ETrue if view in landscape orientation otherwise EFalse.
   248      * @param aLandscapeOrientation ETrue if view in landscape orientation otherwise EFalse.
   249      * 
   249      *
   250      * @return item size
   250      * @return item size
   251      */
   251      */
   252 	TSize GetLCTSize( const TDesC8& aLCTTemplate, TInt aVariety, TAknWindowLineLayout& aWindowLayout, TBool aLandscapeOrientation );
   252 	TSize GetLCTSize( const TDesC8& aLCTTemplate, TInt aVariety, TAknWindowLineLayout& aWindowLayout, TBool aLandscapeOrientation );
   253     
   253 
   254     /**
   254     /**
   255      * Clean the cache
   255      * Clean the cache
   256      * 
   256      *
   257      * @since S60 v3.0
   257      * @since S60 v3.0
   258      */
   258      */
   259 	void CleanAndClearCache( );
   259 	void CleanAndClearCache( );
   260 
   260 
   261     /**
   261     /**
   262      * The template content is loaded. LCT templates have highest priority. 
   262      * The template content is loaded. LCT templates have highest priority.
   263      * If there is no LCT template, a custom template is loaded.
   263      * If there is no LCT template, a custom template is loaded.
   264      * 
   264      *
   265      * @since S60 v3.0
   265      * @since S60 v3.0
   266      * @param aTemplate The current template for the item.
   266      * @param aTemplate The current template for the item.
   267      * @param aWidgetType The widget type.
   267      * @param aWidgetType The widget type.
   268      * @param aMmTemplateType Type of template (LCT/custom).
   268      * @param aMmTemplateType Type of template (LCT/custom).
   269      * 
   269      *
   270      * @return Template content.
   270      * @return Template content.
   271      */
   271      */
   272 	HBufC8* GetTemplateContentL( const TDesC8& aTemplate, TMmWidgetType aWidgetType, TMmTemplateType& aMmTemplateType );
   272 	HBufC8* GetTemplateContentL( const TDesC8& aTemplate, TMmWidgetType aWidgetType, TMmTemplateType& aMmTemplateType );
   273     
   273 
   274     /**
   274     /**
   275      * Sets scrollbar visibility so template library is aware.
   275      * Sets scrollbar visibility so template library is aware.
   276      * 
   276      *
   277      * @since S60 v3.0
   277      * @since S60 v3.0
   278      * @param aIsScrollbarVisible Is scrollbar visible.
   278      * @param aIsScrollbarVisible Is scrollbar visible.
   279      */
   279      */
   280     void SetScrollbarVisibilityL( TBool aIsScrollbarVisible );
   280     void SetScrollbarVisibilityL( TBool aIsScrollbarVisible );
   281     
   281 
   282     /**
   282     /**
   283      * Gets scrollbar visibility.
   283      * Gets scrollbar visibility.
   284      * 
   284      *
   285      * @since S60 v3.0
   285      * @since S60 v3.0
   286      * @return Is scrollbar visible.
   286      * @return Is scrollbar visible.
   287      */
   287      */
   288     TBool GetScrollbarVisibility();
   288     TBool GetScrollbarVisibility();
   289     
   289 
   290     /**
       
   291      * Sets the current zoom so template library can retrieve the appropriate templates.
       
   292      * 
       
   293      * @since S60 v3.0
       
   294      * @param aZoom Is The current zoom to be set.
       
   295      */
       
   296 	void SetZoom( TAknUiZoom aZoom =  EAknUiZoomAutomatic );
       
   297 	
       
   298 	/**
   290 	/**
   299      * Sets the scrollbar width so template library can calculate the width of the item correctly.
   291      * Sets the scrollbar width so template library can calculate the width of the item correctly.
   300      * 
   292      *
   301      * @since S60 v3.0
   293      * @since S60 v3.0
   302      * @param aScrollbarWidth The current width of the scrollbar.
   294      * @param aScrollbarWidth The current width of the scrollbar.
   303      */
   295      */
   304 	void SetScrollbarWidthL( TInt aScrollbarWidth );
   296 	void SetScrollbarWidthL( TInt aScrollbarWidth );
   305 	
   297 
   306 	/**
   298 	/**
   307 	 * Gets scrollbar width.
   299 	 * Gets scrollbar width.
   308 	 * 
   300 	 *
   309 	 * @since S60 v3.0
   301 	 * @since S60 v3.0
   310 	 * @return scrollbar width
   302 	 * @return scrollbar width
   311 	 */
   303 	 */
   312 	TInt ScrollbarWidth();
   304 	TInt ScrollbarWidth();
   313 	
   305 
   314 	/**
   306 	/**
   315      * Gets the parent rect for given orientation from which templates were calculated.
   307      * Gets the parent rect for given orientation from which templates were calculated.
   316      * 
   308      *
   317      * @since S60 v3.0
   309      * @since S60 v3.0
   318      * @param aLandscapeOrientation The current landscape orientation.
   310      * @param aLandscapeOrientation The current landscape orientation.
   319      * @return Parent rect for given orientation.
   311      * @return Parent rect for given orientation.
   320      */
   312      */
   321 	TRect GetParentRect( TBool aLandscapeOrientation );
   313 	TRect GetParentRect( TBool aLandscapeOrientation );
   322 	
   314 
   323 private:
   315 private:
   324 	/**
   316 	/**
   325 	 * Get the lookup text.
   317 	 * Get the lookup text.
   326 	 * 
   318 	 *
   327 	 * @since S60 v3.0
   319 	 * @since S60 v3.0
   328 	 * @param aTemplate The current template for the item.
   320 	 * @param aTemplate The current template for the item.
   329 	 * @param aWidgetType The widget type.
   321 	 * @param aWidgetType The widget type.
   330 	 * @param aLandscapeOrientation Is view in landscape orientation. 
   322 	 * @param aLandscapeOrientation Is view in landscape orientation.
   331 	 * @param aHighlighted Is item highlighted.
   323 	 * @param aHighlighted Is item highlighted.
   332 	 * 
   324 	 *
   333 	 * @return Lookup text. 
   325 	 * @return Lookup text.
   334 	 */
   326 	 */
   335 	HBufC8* LookupText( const TDesC8& aTemplate, TMmWidgetType aWidgetType,
   327 	HBufC8* LookupText( const TDesC8& aTemplate, TMmWidgetType aWidgetType,
   336         TAknUiZoom aZoom, TBool aLandscapeOrientation = EFalse, 
   328                         TBool aLandscapeOrientation = EFalse,
   337         TBool aHighlighted = EFalse );	
   329                         TBool aHighlighted = EFalse );
   338     
   330 
   339     /**
   331     /**
   340      * Get the lookup text for layout size.
   332      * Get the lookup text for layout size.
   341      * 
   333      *
   342      * @since S60 v3.0
   334      * @since S60 v3.0
   343      * @param aWidgetType The widget type.
   335      * @param aWidgetType The widget type.
   344      * @param aTemplate The current template for the item.
   336      * @param aTemplate The current template for the item.
   345      * @param aLandscapeOrientation Is view in landscape orientation. 
   337      * @param aLandscapeOrientation Is view in landscape orientation.
   346      * 
   338      *
   347      * @return lookup layout text.
   339      * @return lookup layout text.
   348      */
   340      */
   349 	HBufC8* LookupLayoutText( TMmWidgetType aWidgetType, TAknUiZoom aZoom, 
   341 	HBufC8* LookupLayoutText( TMmWidgetType aWidgetType,
   350         const TDesC8& aTemplate, TBool aLandscapeOrientation );
   342                               const TDesC8& aTemplate,
   351     
   343                               TBool aLandscapeOrientation );
       
   344 
   352 	/**
   345 	/**
   353      * Get the lookup text for move indicator.
   346      * Get the lookup text for move indicator.
   354      * 
   347      *
   355      * @since S60 v3.0
   348      * @since S60 v3.0
   356      * @param aLookupText The lookup text to be used to create the lookup indicator text.
   349      * @param aLookupText The lookup text to be used to create the lookup indicator text.
   357      * @return lookup Indicator text.
   350      * @return lookup Indicator text.
   358      */
   351      */
   359 	HBufC8* LookupIndicatorText( const TDesC8& aLookupText );
   352 	HBufC8* LookupIndicatorText( const TDesC8& aLookupText );
   360 
   353 
   361     /**
   354     /**
   362      * Load the template to cache.
   355      * Load the template to cache.
   363      * 
   356      *
   364      * @since S60 v3.0
   357      * @since S60 v3.0
   365      * @param aWidgetType The widget type.
   358      * @param aWidgetType The widget type.
   366      * @param aTemplate The current template for the item.
   359      * @param aTemplate The current template for the item.
   367 	 * @param aLandscapeOrientation The current orientation.
   360 	 * @param aLandscapeOrientation The current orientation.
   368      */
   361      */
   369 	void LoadTemplateL( TMmWidgetType aWidgetType, const TDesC8& aTemplate, 
   362 	void LoadTemplateL( TMmWidgetType aWidgetType, const TDesC8& aTemplate,
   370 			TBool aLandscapeOrientation );
   363 			TBool aLandscapeOrientation );
   371 	
   364 
   372     /**
   365     /**
   373      * Get template file content.
   366      * Get template file content.
   374      * 
   367      *
   375      * @since S60 v3.0
   368      * @since S60 v3.0
   376      * @param aContent Descriptor to which the file content should be set.
   369      * @param aContent Descriptor to which the file content should be set.
   377      * @param aTemplate The current template for the item.
   370      * @param aTemplate The current template for the item.
   378      * @param aWidgetType The widget type.
   371      * @param aWidgetType The widget type.
   379      * @param aMmTemplateType Type of template (LCT/custom).
   372      * @param aMmTemplateType Type of template (LCT/custom).
   380      * @param aLoadCustomTemplate Value to be set depending on template type loaded (LCT/custom).
   373      * @param aLoadCustomTemplate Value to be set depending on template type loaded (LCT/custom).
   381      */
   374      */
   382 	void GetTemplateFileContentL (HBufC8*& aContent, const TDesC8& aTemplate,
   375 	void GetTemplateFileContentL (HBufC8*& aContent, const TDesC8& aTemplate,
   383 		TMmWidgetType aWidgetType, TMmTemplateType& aMmTemplateType,
   376 		TMmWidgetType aWidgetType, TMmTemplateType& aMmTemplateType,
   384 		TBool aLoadCustomTemplate = EFalse);
   377 		TBool aLoadCustomTemplate = EFalse);
   385 		
   378 
   386     /**
   379     /**
   387      * Process xml element.
   380      * Process xml element.
   388      * 
   381      *
   389      * @since S60 v3.0
   382      * @since S60 v3.0
   390      * @param aMmTemplateType Type of template (LCT/custom).
   383      * @param aMmTemplateType Type of template (LCT/custom).
   391      * @param aElement Element ( xml ).
   384      * @param aElement Element ( xml ).
   392      * @param aTemplate The current template for the item.
   385      * @param aTemplate The current template for the item.
   393      * @param aLandscapeOrientation Is view in landscape orientation. 
   386      * @param aLandscapeOrientation Is view in landscape orientation.
   394      * @param aHighlighted Is item highlighted.
   387      * @param aHighlighted Is item highlighted.
   395      * 
   388      *
   396      */
   389      */
   397 	void ProcessElementL (TMmTemplateType aMmTemplateType,
   390 	void ProcessElementL (TMmTemplateType aMmTemplateType,
   398 		TXmlEngElement aElement, const TDesC8& aTemplate,
   391 		TXmlEngElement aElement, const TDesC8& aTemplate,
   399 		TBool aLandscapeOrientation, TBool aHighlighted);	
   392 		TBool aLandscapeOrientation, TBool aHighlighted);
   400     
   393 
   401 	/**
   394 	/**
   402      * Process the LCT template.
   395      * Process the LCT template.
   403      * 
   396      *
   404      * @since S60 v3.0
   397      * @since S60 v3.0
   405      * @param aElement Element (xml).
   398      * @param aElement Element (xml).
   406      * @param aTemplate The current template for the item.
   399      * @param aTemplate The current template for the item.
   407      * @param aLandscapeOrientation Is view in landscape orientation. 
   400      * @param aLandscapeOrientation Is view in landscape orientation.
   408      * @param aHighlighted Is item highlighted.
   401      * @param aHighlighted Is item highlighted.
   409      */
   402      */
   410 	void ProcessLCTTemplateElementL( TXmlEngElement aElement, 
   403 	void ProcessLCTTemplateElementL( TXmlEngElement aElement,
   411 	                                         const TDesC8& aTemplate, 
   404 	                                         const TDesC8& aTemplate,
   412 	                                         TBool aLandscapeOrientation,
   405 	                                         TBool aLandscapeOrientation,
   413 	                                         TBool aHighlighted );
   406 	                                         TBool aHighlighted );
   414 
   407 
   415     /**
   408     /**
   416      * Process the custom template.
   409      * Process the custom template.
   417      * 
   410      *
   418      * @since S60 v3.0
   411      * @since S60 v3.0
   419      * @param aElement Element (xml)
   412      * @param aElement Element (xml)
   420      * @param aTemplate The current template for the item.
   413      * @param aTemplate The current template for the item.
   421      * @param aLandscapeOrientation Is view in landscape orientation. 
   414      * @param aLandscapeOrientation Is view in landscape orientation.
   422      * @param aHighlighted Is item highlighted.
   415      * @param aHighlighted Is item highlighted.
   423      */
   416      */
   424 	void ProcessCustomTemplateElementL( TXmlEngElement aElement, 
   417 	void ProcessCustomTemplateElementL( TXmlEngElement aElement,
   425 	                                         const TDesC8& aTemplate, 
   418 	                                         const TDesC8& aTemplate,
   426 	                                         TBool aLandscapeOrientation,
   419 	                                         TBool aLandscapeOrientation,
   427 	                                         TBool aHighlighted );
   420 	                                         TBool aHighlighted );
   428 
   421 
   429     /**
   422     /**
   430      * Setup LCT template data.
   423      * Setup LCT template data.
   431      * 
   424      *
   432      * @since S60 v3.0
   425      * @since S60 v3.0
   433      * @param aChildTemplate Template where the data should be set up. 
   426      * @param aChildTemplate Template where the data should be set up.
   434      * @param aChildElement Element (xml).
   427      * @param aChildElement Element (xml).
   435      * @param aItemSize Item size.
   428      * @param aItemSize Item size.
   436      */
   429      */
   437 	void SetupLCTTemplateL(TTemplateChild& aChildTemplate, TXmlEngElement& aChildElement, TSize aItemSize );
   430 	void SetupLCTTemplateL(TTemplateChild& aChildTemplate, TXmlEngElement& aChildElement, TSize aItemSize );
   438     
   431 
   439 	/**
   432 	/**
   440      * Setup custom template. 
   433      * Setup custom template.
   441      * 
   434      *
   442      * @since S60 v3.0
   435      * @since S60 v3.0
   443      * @param aChildTemplate Template where the data should be set up. 
   436      * @param aChildTemplate Template where the data should be set up.
   444      * @param aChildElement Element (xml).
   437      * @param aChildElement Element (xml).
   445      */
   438      */
   446 	void SetupCustomTemplateL(TTemplateChild& aChildTemplate, TXmlEngElement& aChildElement );
   439 	void SetupCustomTemplateL(TTemplateChild& aChildTemplate, TXmlEngElement& aChildElement );
   447     
   440 
   448 	/**
   441 	/**
   449      * Set the template visual id.
   442      * Set the template visual id.
   450      * 
   443      *
   451      * @since S60 v3.0
   444      * @since S60 v3.0
   452      * @param aChildTemplate Template data.
   445      * @param aChildTemplate Template data.
   453      */
   446      */
   454 	void SetupTemplateVisualId(TTemplateChild& aChildTemplate );
   447 	void SetupTemplateVisualId(TTemplateChild& aChildTemplate );
   455     
   448 
   456 	/**
   449 	/**
   457      * Setup the item children template data for move indicator and cache the data.
   450      * Setup the item children template data for move indicator and cache the data.
   458      * 
   451      *
   459      * @since S60 v3.0
   452      * @since S60 v3.0
   460      * @param aLookupString Lookup string.
   453      * @param aLookupString Lookup string.
   461      * @param aItemSize Item size.
   454      * @param aItemSize Item size.
   462      */
   455      */
   463 	void SetupMoveIndicatorTemplateChildrenL( const TDesC8& aLookupString, TSize aItemSize );
   456 	void SetupMoveIndicatorTemplateChildrenL( const TDesC8& aLookupString, TSize aItemSize );
   464     
   457 
   465 	/**
   458 	/**
   466      * Adjusts the item size loaded to template cache according to layout size and orientation.
   459      * Adjusts the item size loaded to template cache according to layout size and orientation.
   467      * This method adjusts the item width so that items occupy the view correctly.
   460      * This method adjusts the item width so that items occupy the view correctly.
   468      * 
   461      *
   469      * @since S60 v3.0
   462      * @since S60 v3.0
   470      * @param aSize The size of the item to be adjusted. 
   463      * @param aSize The size of the item to be adjusted.
   471      * @param aLayoutSize The layout of the widget e.g 3x4 
   464      * @param aLayoutSize The layout of the widget e.g 3x4
   472      * @param aLandscapeOrientation The orientation of the template being processed.
   465      * @param aLandscapeOrientation The orientation of the template being processed.
   473      */
   466      */
   474 	void AdjustItemWidth( TSize& aSize, TSize aLayoutSize, TBool aLandscapeOrientation );
   467 	void AdjustItemWidth( TSize& aSize, TSize aLayoutSize, TBool aLandscapeOrientation );
   475 
   468 
   476 	/**
   469 	/**
   477      * Updates the parent rect according to orientation.
   470      * Updates the parent rect according to orientation.
   478      * 
   471      *
   479      * @since S60 v3.0
   472      * @since S60 v3.0
   480      * @param aParentRect The current parent rectangle.
   473      * @param aParentRect The current parent rectangle.
   481      * @param aLandscapeOrientation The current orientation.
   474      * @param aLandscapeOrientation The current orientation.
   482      */
   475      */
   483 	void UpdateParentRect( TRect aParentRect, TBool aLandscapeOrientation );
   476 	void UpdateParentRect( TRect aParentRect, TBool aLandscapeOrientation );
   484     
   477 
   485 	/**
   478 	/**
   486      * Sets the parent rect for given orientation.
   479      * Sets the parent rect for given orientation.
   487      * 
   480      *
   488      * @since S60 v3.0
   481      * @since S60 v3.0
   489      * @param aLandscapeOrientation Orientation for which parent rect shoul be set.
   482      * @param aLandscapeOrientation Orientation for which parent rect shoul be set.
   490      * @param aParentRect The parent rect of current orientation.
   483      * @param aParentRect The parent rect of current orientation.
   491      */
   484      */
   492 	void SetParentRect( TBool aLandscapeOrientation, TRect aParentRect);
   485 	void SetParentRect( TBool aLandscapeOrientation, TRect aParentRect);
   493     
   486 
   494 	/**
   487 	/**
   495      * Appends the edit mode template (backdrop icon) to the array of template children passed to the item drawer for drawing.
   488      * Appends the edit mode template (backdrop icon) to the array of template children passed to the item drawer for drawing.
   496      * 
   489      *
   497      * @since S60 v3.0
   490      * @since S60 v3.0
   498      * @param aTemplateArray The template array to which the edit mode template is appended.
   491      * @param aTemplateArray The template array to which the edit mode template is appended.
   499      * @param aSize The size of the item for which the edit mode template should be calculated.
   492      * @param aSize The size of the item for which the edit mode template should be calculated.
   500      */
   493      */
   501 	void AppendEditModeTemplateL( RArray< TTemplateChild >& aTemplateArray, TSize aSize );
   494 	void AppendEditModeTemplateL( RArray< TTemplateChild >& aTemplateArray, TSize aSize );
   502     
   495 
   503 	/**
   496 	/**
   504      * Adjusts the item size according to layout, LCT item size and orientation.
   497      * Adjusts the item size according to layout, LCT item size and orientation.
   505      * 
   498      *
   506      * @since S60 v3.0
   499      * @since S60 v3.0
   507      * @param aItemSize The LCT item size.
   500      * @param aItemSize The LCT item size.
   508      * @param aLayoutSize The layout size to be used to calculate item size.
   501      * @param aLayoutSize The layout size to be used to calculate item size.
   509      * @param aLandscapeOrientation The orientation for which the template is loaded.
   502      * @param aLandscapeOrientation The orientation for which the template is loaded.
   510      */
   503      */
   511 	void AdjustItemSize(TSize& aItemSize,  TSize aLayoutSize, TBool aLandscapeOrientation );
   504 	void AdjustItemSize(TSize& aItemSize,  TSize aLayoutSize, TBool aLandscapeOrientation );
   512     
   505 
   513 	/**
       
   514      * Get the current zoom for displaying templates.
       
   515      * 
       
   516      * @since S60 v3.0
       
   517      * @return The current zoom.
       
   518      */
       
   519 	TAknUiZoom Zoom( );
       
   520     
       
   521 	/**
   506 	/**
   522      * Caches the layout size
   507      * Caches the layout size
   523      * 
   508      *
   524      * @since S60 v3.0
   509      * @since S60 v3.0
   525      * @param aLayoutSize The layout size to ba cached.
   510      * @param aLayoutSize The layout size to ba cached.
   526      * @param aTemplate The template for the cached layout size.
   511      * @param aTemplate The template for the cached layout size.
   527      * @param aLandscapeOrientation The orientation for which the template is loaded.
   512      * @param aLandscapeOrientation The orientation for which the template is loaded.
   528      * @return The current zoom.
       
   529      */
   513      */
   530 	void CacheLayoutSizeL( TSize aLayoutSize, const TDesC8& aTemplate, TBool aLandscapeOrientation );
   514 	void CacheLayoutSizeL( TSize aLayoutSize, const TDesC8& aTemplate, TBool aLandscapeOrientation );
   531 	
   515 
   532 	/**
   516 	/**
   533      * Adjusts icon's align to layout (left, center, right).
   517      * Adjusts icon's align to layout (left, center, right).
   534      * 
   518      *
   535      * @since S60 v5.0
   519      * @since S60 v5.0
   536      * @param aParentSize The LCT parent item size.
   520      * @param aParentSize The LCT parent item size.
   537      * @param aTemplateChild Template data.
   521      * @param aTemplateChild Template data.
   538      */
   522      */
   539     void AdjustIconPosition(TSize aParentSize,
   523     void AdjustIconPosition(TSize aParentSize,
   543 
   527 
   544 	/**
   528 	/**
   545 	 * Widget type of template being loaded.
   529 	 * Widget type of template being loaded.
   546 	 */
   530 	 */
   547     TMmWidgetType iWidgetType;
   531     TMmWidgetType iWidgetType;
   548     
   532 
   549     /**
   533     /**
   550      * Template type which is being loaded (LCT/custom).
   534      * Template type which is being loaded (LCT/custom).
   551      */
   535      */
   552     TMmTemplateType iMmTemplateType;
   536     TMmTemplateType iMmTemplateType;
   553     
   537 
   554     /**
   538     /**
   555      * Template sizes map.
   539      * Template sizes map.
   556      */
   540      */
   557     RHashMap< HBufC8*, TSize> iTemplateSizesMap;
   541     RHashMap< HBufC8*, TSize> iTemplateSizesMap;
   558     
   542 
   559     /**
   543     /**
   560      * Item children template map.
   544      * Item children template map.
   561      */
   545      */
   562     RHashMap< HBufC8*, RArray<TTemplateChild> > iTemplateChildrenMap;
   546     RHashMap< HBufC8*, RArray<TTemplateChild> > iTemplateChildrenMap;
   563     
   547 
   564     /**
   548     /**
   565      * Move indicator rects map.
   549      * Move indicator rects map.
   566      */
   550      */
   567     RHashMap< HBufC8*, TRect> iMoveIndicatorRectsMap;
   551     RHashMap< HBufC8*, TRect> iMoveIndicatorRectsMap;
   568     
   552 
   569     /**
   553     /**
   570      * Parent bounding rect.
   554      * Parent bounding rect.
   571      */
   555      */
   572     TRect iParentRectPortrait;
   556     TRect iParentRectPortrait;
   573 	
   557 
   574     /**
   558     /**
   575      * Parent bounding rect.
   559      * Parent bounding rect.
   576      */
   560      */
   577     TRect iParentRectLandscape;
   561     TRect iParentRectLandscape;
   578     
   562 
   579     /**
   563     /**
   580      * Scrollbar is visible.
   564      * Scrollbar is visible.
   581      */
   565      */
   582     TBool iIsScrollbarVisible;
   566     TBool iIsScrollbarVisible;
   583 	
   567 
   584     /**
   568     /**
   585      * Scrollbar width.
   569      * Scrollbar width.
   586      */
   570      */
   587     TInt iScrollbarWidth;
   571     TInt iScrollbarWidth;
   588 	
       
   589     /**
       
   590      * Zoom type.
       
   591      */
       
   592     TAknUiZoom iZoom;
       
   593 
   572 
   594 	};
   573 	};
   595 #endif // MMTEMPLATELIBRARY_H
   574 #endif // MMTEMPLATELIBRARY_H