mmsharing/mmshui/inc/musuizoomindicator.h
branchRCL_3
changeset 33 bc78a40cd63c
parent 0 f0cf47e981f9
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:  Class for displaying icons in viewfinder view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMUSUIZOOMINDICATORS_H
       
    20 #define CMUSUIZOOMINDICATORS_H
       
    21 
       
    22 // SYSTEM
       
    23 #include <AknsControlContext.h>
       
    24 #include <aknutils.h>
       
    25 #include <coecntrl.h>
       
    26 
       
    27 class MAknsSkinInstance;
       
    28 class CGulIcon;
       
    29 class MMusUiZoomIndicatorObserver;
       
    30 
       
    31 /** 
       
    32 * Class for displaying icons in viewfinder view
       
    33 * @since 2.8
       
    34 */
       
    35 class CMusUiZoomIndicator : public CCoeControl
       
    36     {
       
    37 
       
    38 
       
    39     public: // Constructors and destructor
       
    40         
       
    41         /**
       
    42         * Symbian OS two-phased constructor.
       
    43         * @since 2.8
       
    44         * @param aController reference to CCcorController
       
    45         */
       
    46         static CMusUiZoomIndicator* NewLC( 
       
    47         						TInt aZoomMin, 
       
    48         						TInt aZoomMax, 
       
    49         						MMusUiZoomIndicatorObserver* aObserver );
       
    50 
       
    51         /**
       
    52         * Symbian OS two-phased constructor.
       
    53         * @since 2.8
       
    54         * @param aController reference to CCcorController
       
    55         */
       
    56         static CMusUiZoomIndicator* NewL( 
       
    57         						TInt aZoomMin, 
       
    58         						TInt aZoomMax, 
       
    59         						MMusUiZoomIndicatorObserver* aObserver );
       
    60 
       
    61         /**
       
    62         * Destructor.
       
    63         */
       
    64         ~CMusUiZoomIndicator();
       
    65 
       
    66     public: // New functions
       
    67 
       
    68 		/**
       
    69 		*
       
    70 		* @since 3.2
       
    71 		*/
       
    72 		void SetZoomLevel( TInt aZoomLevel );
       
    73 
       
    74 		/**
       
    75 		*
       
    76 		* @since 3.2
       
    77 		*/
       
    78 		TInt GetZoomLevel();
       
    79 
       
    80 		/**
       
    81 		*
       
    82 		* @since 3.2
       
    83 		*/
       
    84 		void SetZoomMin( TInt aZoomMin );
       
    85 		
       
    86 		/**
       
    87 		*
       
    88 		* @since 3.2
       
    89 		*/
       
    90 		void SetZoomMax( TInt aZoomMax );
       
    91 		
       
    92 		/**
       
    93 		*
       
    94 		* @since 3.2
       
    95 		*/
       
    96 		void SetFullRect( const TRect aRect  );
       
    97 		
       
    98 		
       
    99 
       
   100 	private: // From CCoeConrol
       
   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         TInt CountComponentControls() const;
       
   116         
       
   117         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   118         
       
   119 
       
   120 
       
   121     private: // Constructors and destructor
       
   122 
       
   123         /**
       
   124         * C++ constructor
       
   125         * @since 2.8
       
   126         * @param aController reference to CCcorController
       
   127         */
       
   128         CMusUiZoomIndicator( TInt aZoomMin, 
       
   129         					 TInt aZoomMax, 
       
   130         					 MMusUiZoomIndicatorObserver* aObserver );
       
   131 
       
   132         /**
       
   133         * Symbian 2nd phase constructor.
       
   134         * @since 2.8
       
   135         */
       
   136         void ConstructL();
       
   137 
       
   138 
       
   139     private: // HELPERS
       
   140 
       
   141         /**
       
   142         * 
       
   143         */
       
   144 		void DrawIcons( const TRect& aRect );
       
   145        
       
   146         /**
       
   147         * 
       
   148         */
       
   149 		void UpdateZoomLayout();
       
   150 
       
   151         void  ConstructImageL( CEikImage* aImage,
       
   152                                MAknsSkinInstance* aSkin,
       
   153                                const TAknsItemID& aId,
       
   154                                TInt aBitmapId,
       
   155                                TInt aMaskId );
       
   156 
       
   157         /**
       
   158         * Callback for disable zoom indicator.
       
   159         * @since 2.8
       
   160         * @return KErrNone
       
   161         */
       
   162         static TInt DisableZoomIndicator( TAny* aThis );
       
   163 
       
   164         /**
       
   165         * 
       
   166         */
       
   167 		void DisableTimer();
       
   168 
       
   169         /**
       
   170         * 
       
   171         */
       
   172 		void EnableTimer();
       
   173 
       
   174 
       
   175     private: //data
       
   176 
       
   177         /**
       
   178         * 
       
   179         */
       
   180         TRect iParentRect;
       
   181 
       
   182         /**
       
   183         * 
       
   184         */
       
   185         TRect iViewfinderRect;
       
   186 
       
   187         /**
       
   188         * 
       
   189         */
       
   190 		TInt iZoomMin;
       
   191 
       
   192         /**
       
   193         * 
       
   194         */
       
   195 		TInt iZoomMax;
       
   196 		
       
   197         /**
       
   198         * 
       
   199         */
       
   200 		TInt iZoomLevel;
       
   201 
       
   202         /**
       
   203         * 
       
   204         */
       
   205         CPeriodic* iDisableZoomTimer;   // owned
       
   206 
       
   207         /**
       
   208         * 
       
   209         */
       
   210         TRgb iIconColor;
       
   211 
       
   212         /**
       
   213         * 
       
   214         */
       
   215 		CEikImage* iIconElevator;
       
   216 
       
   217         /**
       
   218         * 
       
   219         */
       
   220 		CEikImage* iIconMin;
       
   221 
       
   222         /**
       
   223         * 
       
   224         */
       
   225 		CEikImage* iIconMax;
       
   226 
       
   227         /**
       
   228         * 
       
   229         */
       
   230 		CEikImage* iIconBg;
       
   231 
       
   232         /**
       
   233         * 
       
   234         */
       
   235 		TInt iTopMargin;
       
   236 
       
   237         /**
       
   238         * 
       
   239         */
       
   240 		TInt iBottomMargin;
       
   241 		
       
   242         /**
       
   243         * 
       
   244         */
       
   245 		TInt iScaleStep;
       
   246 
       
   247         /**
       
   248         * 
       
   249         */
       
   250 		TInt iScaleY;
       
   251 		
       
   252         /**
       
   253         * 
       
   254         */
       
   255 		TInt iMiddle;
       
   256 		
       
   257         /**
       
   258         * NOT OWN!!!
       
   259         */
       
   260 		MMusUiZoomIndicatorObserver* iObserver; 
       
   261 
       
   262         TInt iElevatorWidth;
       
   263         
       
   264         TInt iElevatorHeight;
       
   265     
       
   266         TRect iFullRect;
       
   267     
       
   268 
       
   269     };
       
   270 
       
   271 
       
   272 #endif
       
   273 
       
   274 // End of File