uifw/AvKon/inc/AknTabGrpGraphics.h
branchRCL_3
changeset 51 fcdfafb36fe7
parent 0 2f259fa3e83a
child 55 aecbbf00d063
equal deleted inserted replaced
50:a1caeb42b3a3 51:fcdfafb36fe7
   113     *
   113     *
   114     * @param  aParent  Parent rectangle
   114     * @param  aParent  Parent rectangle
   115     */
   115     */
   116     void SetTabGroupBackgroundParent( TRect aParent );
   116     void SetTabGroupBackgroundParent( TRect aParent );
   117 
   117 
   118 #if 0 // not used
       
   119     /**
       
   120     * This method draws the tab background bitmap using SVG graphics.
       
   121     * The tab combination is given as bitmap id which refers to old style
       
   122     * tab bitmaps.
       
   123     *
       
   124     * @param  aAvkonBitmapId  Bitmap index (@see avkon.mbg).
       
   125     *
       
   126     * @return  Struct which contains both the bitmap and the mask.
       
   127     *          Ownership is transferred to the caller.
       
   128     */
       
   129     CAknTabGroupGraphics::SAknTabGroupBackground CreateTabGroupBackgroundL(
       
   130         TInt aAvkonBitmapId );
       
   131         
       
   132 #endif
       
   133     /**
   118     /**
   134     * Draw modes of the tab background graphics.
   119     * Draw modes of the tab background graphics.
   135     */ 
   120     */ 
   136     enum TTabDrawMode
   121     enum TTabDrawMode
   137         {
   122         {
   185     *                          @c EFalse, then the layout is calculated
   170     *                          @c EFalse, then the layout is calculated
   186     *                          to the @c aLayout. 
   171     *                          to the @c aLayout. 
   187     * @param  aTabsHidden      Specifies where hidden tabs are drawn.
   172     * @param  aTabsHidden      Specifies where hidden tabs are drawn.
   188     * @param  aAnimation       Specifies the used animation.
   173     * @param  aAnimation       Specifies the used animation.
   189     */
   174     */
   190     void DrawTabGroupBackgroundL(
   175     void DrawTabGroupBackground(
   191         TTabDrawMode aTabDrawMode,
   176         TTabDrawMode aTabDrawMode,
   192         TBool aLongTabs,
   177         TBool aLongTabs,
   193         TInt aNumberOfTabs,
   178         TInt aNumberOfTabs,
   194         TInt aActiveTab,
   179         TInt aActiveTab,
   195         CBitmapContext* aGc,
   180         CBitmapContext* aGc,
   196         SAknTabGroupBackgroundLayout& aLayout,
   181         SAknTabGroupBackgroundLayout& aLayout,
   197         TTabsHidden aTabsHidden,
   182         TTabsHidden aTabsHidden,
   198         TTabAnimationType aAnimation = ENoAnimation ) const;
   183         TTabAnimationType aAnimation = ENoAnimation,
       
   184         TInt aHighlightTab = 0 ) const;
   199 
   185 
   200     /**
   186     /**
   201     * Draws narrow tab background from given parameters.
   187     * Draws narrow tab background from given parameters.
   202     * 
   188     * 
   203     * @param  aTabDrawMode     Mode with which the background is drawn.
   189     * @param  aTabDrawMode     Mode with which the background is drawn.
   211     * @param  aLayout[in,out]  Tab group background layout used in drawing.
   197     * @param  aLayout[in,out]  Tab group background layout used in drawing.
   212     *                          If the @c aLayout's @c iUse parameter is
   198     *                          If the @c aLayout's @c iUse parameter is
   213     *                          @c EFalse, then the layout is calculated
   199     *                          @c EFalse, then the layout is calculated
   214     *                          to the @c aLayout. 
   200     *                          to the @c aLayout. 
   215     */
   201     */
   216     void DrawTabGroupNarrowBackgroundL(
   202     void DrawTabGroupNarrowBackground(
   217         TTabDrawMode aTabDrawMode,
   203         TTabDrawMode aTabDrawMode,
   218         TBool aLongTabs,
   204         TBool aLongTabs,
   219         TInt aNumberOfTabs,
   205         TInt aNumberOfTabs,
   220         TInt aActiveTab,
   206         TInt aActiveTab,
   221         CBitmapContext* aGc,
   207         CBitmapContext* aGc,
   335         TwoLongTabNarrowBackground( TInt aActiveTab ) const;
   321         TwoLongTabNarrowBackground( TInt aActiveTab ) const;
   336 
   322 
   337     CAknTabGroupGraphics::SAknTabGroupBackgroundLayout
   323     CAknTabGroupGraphics::SAknTabGroupBackgroundLayout
   338         ThreeLongTabNarrowBackground( TInt aActiveTab ) const;
   324         ThreeLongTabNarrowBackground( TInt aActiveTab ) const;
   339 
   325 
   340     /**
       
   341     * Methods to draw normal tab backgrounds.
       
   342     */
       
   343     void DrawTwoTabBackground( TTabDrawMode aDrawMode,
       
   344                                TInt aActiveTab,
       
   345                                CBitmapContext* aGc,
       
   346                                SAknTabGroupBackgroundLayout& aLayout ) const;
       
   347 
       
   348     void DrawThreeTabBackground( TTabDrawMode aDrawMode,
       
   349                                  TInt aActiveTab,
       
   350                                  CBitmapContext* aGc,
       
   351                                  SAknTabGroupBackgroundLayout& aLayout,
       
   352                                  TTabsHidden aTabsHidden,
       
   353                                  TTabAnimationType aAnimation = ENoAnimation ) const;
       
   354 
       
   355     void DrawFourTabBackground( TTabDrawMode aDrawMode,
       
   356                                 TInt aActiveTab,
       
   357                                 CBitmapContext* aGc,
       
   358                                 SAknTabGroupBackgroundLayout& aLayout ) const;
       
   359 
       
   360     void DrawTwoLongTabBackground(
       
   361         TTabDrawMode aDrawMode,
       
   362         TInt aActiveTab,
       
   363         CBitmapContext* aGc,
       
   364         SAknTabGroupBackgroundLayout& aLayout ) const;
       
   365 
       
   366     void DrawThreeLongTabBackground(
       
   367         TTabDrawMode aDrawMode,
       
   368         TInt aActiveTab,
       
   369         CBitmapContext* aGc,
       
   370         SAknTabGroupBackgroundLayout& aLayout ) const;
       
   371 
       
   372     /**
       
   373     * Methods to draw narrow tab backgrounds.
       
   374     */
       
   375     void DrawTwoTabNarrowBackground(
       
   376         TTabDrawMode aDrawMode,
       
   377         TInt aActiveTab,
       
   378         CBitmapContext* aGc,
       
   379         SAknTabGroupBackgroundLayout& aLayout ) const;
       
   380 
       
   381     void DrawThreeTabNarrowBackground(
       
   382         TTabDrawMode aDrawMode,
       
   383         TInt aActiveTab,
       
   384         CBitmapContext* aGc,
       
   385         SAknTabGroupBackgroundLayout& aLayout ) const;
       
   386 
       
   387     void DrawFourTabNarrowBackground(
       
   388         TTabDrawMode aDrawMode,
       
   389         TInt aActiveTab,
       
   390         CBitmapContext* aGc,
       
   391         SAknTabGroupBackgroundLayout& aLayout ) const;
       
   392 
       
   393     void DrawTwoLongTabNarrowBackground(
       
   394         TTabDrawMode aDrawMode,
       
   395         TInt aActiveTab,
       
   396         CBitmapContext* aGc,
       
   397         SAknTabGroupBackgroundLayout& aLayout ) const;
       
   398 
       
   399     void DrawThreeLongTabNarrowBackground(
       
   400         TTabDrawMode aDrawMode,
       
   401         TInt aActiveTab,
       
   402         CBitmapContext* aGc,
       
   403         SAknTabGroupBackgroundLayout& aLayout ) const;
       
   404 
   326 
   405     /**
   327     /**
   406     * Draws single tab graphics for an active tab.
   328     * Draws single tab graphics for an active tab.
   407     * 
   329     * 
   408     * @param  aDrawMode  Mode with which the background is drawn.
   330     * @param  aDrawMode  Mode with which the background is drawn.
   433                          TRect aRight,
   355                          TRect aRight,
   434                          CBitmapContext* aGc,
   356                          CBitmapContext* aGc,
   435                          TBool aFaded = EFalse ) const;
   357                          TBool aFaded = EFalse ) const;
   436     
   358     
   437     /**
   359     /**
       
   360      * Draws single tab graphics for a Highlight tab.
       
   361      * 
       
   362      * @param  aDrawMode  Mode with which the background is drawn.
       
   363      * @param  aLeft      Rectangle of the left part of the tab.
       
   364      * @param  aMiddle    Rectangle of the middle part of the tab.
       
   365      * @param  aRight     Rectangle of the right part of the tab.
       
   366      * @param  aGc        Graphics context used in drawing.
       
   367      */
       
   368     void DrawHighlightTabL( TTabDrawMode aDrawMode,
       
   369                             TRect aLeft,
       
   370                             TRect aMiddle,
       
   371                             TRect aRight,
       
   372                             CBitmapContext* aGc ) const;
       
   373     
       
   374     /**
   438     * Draws single tab part graphics for a passive tab.
   375     * Draws single tab part graphics for a passive tab.
   439     * Used in drawing the hidden tab bits.
   376     * Used in drawing the hidden tab bits.
   440     * 
   377     * 
   441     * @param  aDrawMode  Mode with which the background is drawn.
   378     * @param  aDrawMode  Mode with which the background is drawn.
   442     * @param  aTabPart   Part of the tab graphics to draw.
   379     * @param  aTabPart   Part of the tab graphics to draw.
   456 
   393 
   457     /**
   394     /**
   458     * Helper method to get the narrow tab container rect.
   395     * Helper method to get the narrow tab container rect.
   459     */
   396     */
   460     TRect NarrowParentRect() const;
   397     TRect NarrowParentRect() const;
       
   398     
       
   399     /**
       
   400     * Sets the layout for tab background according to specified parameters. 
       
   401     * Used in DrawTabGroupBackground/DrawTabGroupNarrowBackground
       
   402     * 
       
   403     * @param  aLayout[in,out]  Tab group background layout used in drawing.
       
   404     *                          If the @c aLayout's @c iUse parameter is
       
   405     *                          @c EFalse, then the layout is calculated
       
   406     *                          to the @c aLayout. 
       
   407     * @param  aNumberOfTabs    Number of tabs visible in the tab group (not
       
   408     *                          the total number of tabs in the tab group).
       
   409     * @param  aLongTabs        Active tab number in relation to the first tab
       
   410     *                          shown. This value can be from one to
       
   411     *                          @c aNumberOfTabs.
       
   412     * @param  aLongTabs        Specifies whether or not long tabs are used.
       
   413     * @param  aIsNarrow        Specifies whether or not narrow tabs are used.
       
   414     * @param  aAnimation       Specifies the used animation.
       
   415     */
       
   416     void CAknTabGroupGraphics::ReviseLayoutForTabBackground(
       
   417             SAknTabGroupBackgroundLayout& aLayout,
       
   418             TInt aNumberOfTabs,
       
   419             TBool aLongTabs,
       
   420             TInt aActiveTab,
       
   421             TBool aIsNarrow,
       
   422             TTabAnimationType aAnimation
       
   423             ) const;
       
   424     
       
   425     /**
       
   426     * Sets active tab flag for the layout. 
       
   427     * Used in DrawTabGroupBackground/DrawTabGroupNarrowBackground
       
   428     * 
       
   429     * @param  aLayout[in,out]  Tab group background layout used in drawing.
       
   430     *                          If the @c aLayout's @c iUse parameter is
       
   431     *                          @c EFalse, then the layout is calculated
       
   432     *                          to the @c aLayout. 
       
   433     * @param  aActiveTab       Active tab number in relation to the first tab
       
   434     *                          shown. This value can be from one to
       
   435     *                          @c aNumberOfTabs.
       
   436     */
       
   437     void ReviseLayoutUseFlag(
       
   438             SAknTabGroupBackgroundLayout& aLayout,
       
   439             TInt aActiveTab
       
   440             ) const;
       
   441     
       
   442     /**
       
   443     * Processes the instructions and draw the tab background according to instructions.
       
   444     * Instructions are created according to drawing sequence.
       
   445     * Used in DrawTabGroupBackground/DrawTabGroupNarrowBackground
       
   446     * 
       
   447     * @param aInstructions      The instructions for drawing tabs.
       
   448     * @param aNumOfIns          The number of instructions.
       
   449     * @param aTabDrawMode       Mode with which the background is drawn.
       
   450     * @param aLayout[in,out]    Tab group background layout used in drawing.
       
   451     *                           If the @c aLayout's @c iUse parameter is
       
   452     *                           @c EFalse, then the layout is calculated
       
   453     *                           to the @c aLayout.       
       
   454     * @param  aGc               Graphics context used in drawing the background.
       
   455     * 
       
   456     */
       
   457     void ProcessDrawTabInstructions(
       
   458             struct TTabInstruction *aInstructions,
       
   459             TInt aNumOfIns,
       
   460             TTabDrawMode aTabDrawMode,
       
   461             SAknTabGroupBackgroundLayout& aLayout,
       
   462             CBitmapContext* aGc
       
   463             ) const;
       
   464     
   461 
   465 
   462 private: // Member data.
   466 private: // Member data.
   463 
   467 
   464     CFbsBitmap*   iActiveTabLeft;
   468     CFbsBitmap*   iActiveTabLeft;
   465     CFbsBitmap*   iActiveTabLeftMask;
   469     CFbsBitmap*   iActiveTabLeftMask;