mmsharing/mmshui/inc/musuinavimediadecorator.h
branchRCL_3
changeset 33 bc78a40cd63c
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
       
     1 /*
       
     2 * Copyright (c) 2005 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MUSUINAVIMEDIADECORATOR_H
       
    21 #define MUSUINAVIMEDIADECORATOR_H
       
    22 
       
    23 #include "musuidefinitions.h"
       
    24 #include "musuinavimediaanimatorobserver.h"
       
    25 
       
    26 #include <coecntrl.h>
       
    27 #include <AknUtils.h>
       
    28 
       
    29 class CAknIconArray;
       
    30 class CMusUiNaviMediaAnimator;
       
    31 class MAknsSkinInstance;
       
    32 
       
    33 /**
       
    34  * CMusUiNaviMediaDecorator
       
    35  *
       
    36  * @lib musui.exe
       
    37  */
       
    38 class CMusUiNaviMediaDecorator : public CCoeControl, 
       
    39                                  public MMusUiNaviMediaAnimatorObserver
       
    40     {
       
    41 
       
    42 	public:  // constructors and destructor
       
    43 
       
    44 	    /**
       
    45 	     * Two-phased constructor.
       
    46 	     *
       
    47 	     */
       
    48 	    static CMusUiNaviMediaDecorator* NewL();
       
    49 
       
    50 	    /**
       
    51 	     * 
       
    52 	     *
       
    53 	     */
       
    54 	    virtual ~CMusUiNaviMediaDecorator();
       
    55 
       
    56 
       
    57 	private: // constructors
       
    58 
       
    59 	    /**
       
    60 	     * C++ default constructor.
       
    61 	     *
       
    62 	     */
       
    63 	    CMusUiNaviMediaDecorator();
       
    64 
       
    65 	    /**
       
    66 	     * By default Symbian second-phase constructor is private.
       
    67 	     *
       
    68 	     */
       
    69 	    void ConstructL();
       
    70 
       
    71 
       
    72 	public: // API
       
    73 
       
    74 	    /**
       
    75 	     * Updates left label (usually time string) in navi pane.
       
    76 		 *
       
    77 	     * @param aLabel New label
       
    78 	     */
       
    79 	    void SetLeftLabelL( const TDesC& aLabel );
       
    80 
       
    81 	    /**
       
    82 	     * Updates right label (usually time string) in navi pane.
       
    83 		 *
       
    84 	     * @param aLabel New label
       
    85 	     */
       
    86 	    void SetRightLabelL( const TDesC& aLabel );
       
    87 	    
       
    88 		/**
       
    89 		* Selects icon show
       
    90 		*
       
    91 		*/
       
    92 		void ShowIcon( TMusUiNaviMediaDecorator aIcon );
       
    93 
       
    94 
       
    95 	protected: // from MMusUiNaviMediaAnimatorObserver
       
    96 	
       
    97         void SetIcon( CGulIcon* aIcon );
       
    98 
       
    99 
       
   100 	protected: // from CCoeControl
       
   101 
       
   102 	    /**
       
   103 	     * Handles the size change events.
       
   104 	     *
       
   105 	     */
       
   106 	    void SizeChanged();
       
   107 
       
   108 	    /**
       
   109 	     * Draws the control.
       
   110 	     *
       
   111 	     * @param aRect The region of the control to be redrawn.
       
   112 	     */
       
   113 	    void Draw( const TRect& aRect ) const;
       
   114 
       
   115 
       
   116 	private: // HELPERS 
       
   117 	
       
   118 	    /**
       
   119 	     * Layouts the text depending on current situation.
       
   120 	     *
       
   121 	     */
       
   122 		void DoLayoutText();
       
   123 
       
   124 
       
   125         void LoadImagesL();
       
   126 
       
   127         void  ConstructImageL( MAknsSkinInstance* aSkin,
       
   128                                                 const TAknsItemID& aId,
       
   129                                                 TInt aBitmapId,
       
   130                                                 TInt aMaskId,
       
   131                                                 TParse parse,
       
   132                                                 TBool aIconHasOwnColor = ETrue);
       
   133 
       
   134 
       
   135 	private: // DATA
       
   136 
       
   137 	    /**
       
   138 	    *
       
   139 	    *
       
   140 	    */
       
   141 	    HBufC* iLeftLabel;
       
   142 
       
   143 	    /**
       
   144 	    *
       
   145 	    *
       
   146 	    */
       
   147 	    HBufC* iRightLabel;
       
   148 
       
   149 
       
   150         CAknLayoutFont *iFont;
       
   151 
       
   152 	    /**
       
   153 	    *
       
   154 	    *
       
   155 	    */
       
   156 	    TAknLayoutText iLeftTextLayout;
       
   157 
       
   158 	    /**
       
   159 	    *
       
   160 	    *
       
   161 	    */
       
   162 	    TAknLayoutText iRightTextLayout;
       
   163 
       
   164 	    /**
       
   165 	    *
       
   166 	    *
       
   167 	    */
       
   168 	    TAknLayoutRect iIconLayout;    
       
   169 	    
       
   170 	    /**
       
   171 	    *
       
   172 	    *
       
   173 	    */
       
   174 	    CAknIconArray* iIconArray;
       
   175 	    
       
   176 	    /**
       
   177 	    *
       
   178 	    *
       
   179 	    */
       
   180 	    TInt iMiddle;
       
   181 	    
       
   182 	    TInt iIconLeft;
       
   183 	    
       
   184 	    /**
       
   185 	    *
       
   186 	    *
       
   187 	    */
       
   188 	    TSize iLeftTextSize;
       
   189 
       
   190 	    /**
       
   191 	    *
       
   192 	    *
       
   193 	    */
       
   194 	    TSize iRightTextSize;
       
   195 	    
       
   196 	    /**
       
   197 	    *
       
   198 	    *
       
   199 	    */
       
   200 	    CGulIcon* iIcon;
       
   201 	    
       
   202 	    /**
       
   203 	    * resource file location ( eq. Z or C )
       
   204 	    */
       
   205         TBool iResourceRam;
       
   206 	    
       
   207     
       
   208         CMusUiNaviMediaAnimator* iAnimation;
       
   209         
       
   210         TSize iImageSize;
       
   211     
       
   212     };
       
   213 
       
   214 #endif // MUSUINAVIMEDIADECORATOR_H
       
   215 
       
   216 // end of file