mmsharing/mmshui/inc/musuilevelindicator.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:  Class for displaying icons in viewfinder view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSUILEVELINDICATOR_H
       
    20 #define MUSUILEVELINDICATOR_H
       
    21 
       
    22 #include "musuidefinitions.h"
       
    23 #include "musuiactivetimerobserver.h"
       
    24 
       
    25 // SYSTEM
       
    26 #include <AknsControlContext.h>
       
    27 #include <AknUtils.h>
       
    28 #include <coecntrl.h>
       
    29 
       
    30 class MAknsSkinInstance;
       
    31 class CGulIcon;
       
    32 class MMusUiLevelIndicatorObserver;
       
    33 class CAknSlider;
       
    34 
       
    35 /** 
       
    36 * Class for displaying icons in viewfinder view
       
    37 */
       
    38 class CMusUiLevelIndicator : public CCoeControl,
       
    39                              public MCoeControlObserver,
       
    40                              public MMusUiActiveTimerObserver
       
    41     {
       
    42 
       
    43 
       
    44     public: // Constructors and destructor
       
    45         
       
    46         /**
       
    47         * Symbian OS two-phased constructor.
       
    48         * @param aController reference to CCcorController
       
    49         */
       
    50         static CMusUiLevelIndicator* NewL(
       
    51                                 TAknOrientation aLayout, 
       
    52         						TInt aMinLevel, 
       
    53         						TInt aMaxLevel, 
       
    54                                 CCoeControl* aParent,
       
    55                                 const TRect& aRect,
       
    56         						MMusUiLevelIndicatorObserver* aObserver );
       
    57         						
       
    58         /**
       
    59         * Symbian OS two-phased constructor.
       
    60         * @param aController reference to CCcorController
       
    61         */
       
    62         static CMusUiLevelIndicator* NewLC(
       
    63                                 TAknOrientation aLayout,
       
    64         						TInt aMinLevel, 
       
    65         						TInt aMaxLevel, 
       
    66                                 CCoeControl* aParent,
       
    67                                 const TRect& aRect,
       
    68         						MMusUiLevelIndicatorObserver* aObserver );
       
    69 
       
    70         /**
       
    71         * Destructor.
       
    72         */
       
    73         ~CMusUiLevelIndicator();
       
    74         
       
    75 
       
    76     public: // New functions
       
    77 
       
    78 		/**
       
    79 		*
       
    80 		*/
       
    81 		void SetLevelL( TMusUiIndicatorType aType, 
       
    82 		                TInt aLevel, 
       
    83 		                TBool aUseTimer );
       
    84 
       
    85 		/**
       
    86 		*
       
    87 		*/
       
    88 		TInt GetLevel(TMusUiIndicatorType aType);
       
    89 
       
    90 		/**
       
    91 		*
       
    92 		*/
       
    93 		void SetRange( TInt aMinLevel, TInt aMaxLevel, TBool aUseTimer);
       
    94 		
       
    95 		/**
       
    96 		*
       
    97 		*/
       
    98 		void SetIndicatorType( TMusUiIndicatorType aType );
       
    99 		
       
   100 		/**
       
   101 		*
       
   102 		*/
       
   103 		TMusUiIndicatorType GetIndicatorType();
       
   104 			
       
   105 		
       
   106 	private: // From CCoeControl
       
   107 
       
   108 	    /**
       
   109 	     * Handles the size change events.
       
   110 	     *
       
   111 	     */
       
   112 	    virtual void SizeChanged();
       
   113 	    
       
   114 		virtual void Draw(const TRect& aRect) const;
       
   115 
       
   116         virtual TInt CountComponentControls() const;
       
   117         
       
   118         virtual CCoeControl* ComponentControl( TInt aIndex ) const;
       
   119 
       
   120         virtual void HandleResourceChange( TInt aType );
       
   121 
       
   122 
       
   123     private: // From CCoeControlObserver
       
   124     
       
   125         virtual void HandleControlEventL( CCoeControl* aControl,
       
   126                                           TCoeEvent aEventType );
       
   127         
       
   128         
       
   129     private: // From MMusUiActiveTimerObserver    
       
   130     
       
   131         virtual void TimerComplete( CMusUiActiveTimer* aTimer );
       
   132 
       
   133 
       
   134     private: // Constructors and destructor
       
   135 
       
   136         /**
       
   137         * C++ constructor
       
   138         */
       
   139         CMusUiLevelIndicator( TInt aMinLevel, 
       
   140         					  TInt aMaxLevel, 
       
   141         					  MMusUiLevelIndicatorObserver* aObserver );
       
   142 
       
   143         /**
       
   144         * Symbian 2nd phase constructor.
       
   145         */
       
   146         void ConstructL( TAknOrientation aLayout, 
       
   147                          CCoeControl* aParent,
       
   148                          const TRect& aRect );
       
   149 
       
   150 
       
   151     private: // HELPERS
       
   152 
       
   153         void  ConstructImageL( CEikImage* aImage,
       
   154                                MAknsSkinInstance* aSkin,
       
   155                                const TAknsItemID& aId,
       
   156                                TInt aBitmapId,
       
   157                                TInt aMaskId,
       
   158                                TParse aParse );
       
   159 
       
   160         /**
       
   161         * Callback for disable level indicator.
       
   162         * @since 2.8
       
   163         * @return KErrNone
       
   164         */
       
   165         //static TInt DisableLevelIndicator( TAny* aThis );
       
   166 		//void DisableTimer();        
       
   167 		//void EnableTimer();
       
   168 
       
   169 
       
   170     private: //data
       
   171 
       
   172       
       
   173         TRect iParentRect;
       
   174 
       
   175         TRect iViewfinderRect;
       
   176 
       
   177 		TInt iMinLevel;
       
   178 
       
   179 		TInt iMaxLevel;
       
   180 		
       
   181 		TInt iZoomLevel;
       
   182 		
       
   183 		TInt iBrightnessLevel;
       
   184 		
       
   185 		TInt iDurationLevel;
       
   186 
       
   187         CMusUiActiveTimer* iDisableLevelTimer;       
       
   188       
       
   189         TMusUiIndicatorType iIndicatorType;
       
   190 		
       
   191         CAknSlider* iSlider;
       
   192 
       
   193         CMusUiActiveTimer* iSliderEventTimer;
       
   194 
       
   195         /**
       
   196         * NOT OWN!!!
       
   197         */
       
   198 		MMusUiLevelIndicatorObserver* iObserver;
       
   199 
       
   200     };
       
   201 
       
   202 
       
   203 #endif
       
   204 
       
   205 // End of File