mmsharing/mmshui/inc/musuilevelindicator.h
changeset 0 f0cf47e981f9
child 6 c47a75a8cd72
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     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 	private: // From CCoeControl
       
   102 
       
   103 	    /**
       
   104 	     * Handles the size change events.
       
   105 	     *
       
   106 	     */
       
   107 	    virtual void SizeChanged();
       
   108 	    
       
   109 		virtual void Draw(const TRect& aRect) const;
       
   110 
       
   111         virtual TInt CountComponentControls() const;
       
   112         
       
   113         virtual CCoeControl* ComponentControl( TInt aIndex ) const;
       
   114 
       
   115         virtual void HandleResourceChange( TInt aType );
       
   116 
       
   117 
       
   118     private: // From CCoeControlObserver
       
   119     
       
   120         virtual void HandleControlEventL( CCoeControl* aControl,
       
   121                                           TCoeEvent aEventType );
       
   122         
       
   123         
       
   124     private: // From MMusUiActiveTimerObserver    
       
   125     
       
   126         virtual void TimerComplete( CMusUiActiveTimer* aTimer );
       
   127 
       
   128 
       
   129     private: // Constructors and destructor
       
   130 
       
   131         /**
       
   132         * C++ constructor
       
   133         */
       
   134         CMusUiLevelIndicator( TInt aMinLevel, 
       
   135         					  TInt aMaxLevel, 
       
   136         					  MMusUiLevelIndicatorObserver* aObserver );
       
   137 
       
   138         /**
       
   139         * Symbian 2nd phase constructor.
       
   140         */
       
   141         void ConstructL( TAknOrientation aLayout, 
       
   142                          CCoeControl* aParent,
       
   143                          const TRect& aRect );
       
   144 
       
   145 
       
   146     private: // HELPERS
       
   147 
       
   148         void  ConstructImageL( CEikImage* aImage,
       
   149                                MAknsSkinInstance* aSkin,
       
   150                                const TAknsItemID& aId,
       
   151                                TInt aBitmapId,
       
   152                                TInt aMaskId,
       
   153                                TParse aParse );
       
   154 
       
   155         /**
       
   156         * Callback for disable level indicator.
       
   157         * @since 2.8
       
   158         * @return KErrNone
       
   159         */
       
   160         //static TInt DisableLevelIndicator( TAny* aThis );
       
   161 		//void DisableTimer();        
       
   162 		//void EnableTimer();
       
   163 
       
   164 
       
   165     private: //data
       
   166 
       
   167       
       
   168         TRect iParentRect;
       
   169 
       
   170         TRect iViewfinderRect;
       
   171 
       
   172 		TInt iMinLevel;
       
   173 
       
   174 		TInt iMaxLevel;
       
   175 		
       
   176 		TInt iZoomLevel;
       
   177 		
       
   178 		TInt iBrightnessLevel;
       
   179 		
       
   180 		TInt iDurationLevel;
       
   181 
       
   182         CMusUiActiveTimer* iDisableLevelTimer;       
       
   183       
       
   184 		TInt iIndicatorType;
       
   185 		
       
   186         CAknSlider* iSlider;
       
   187 
       
   188         CMusUiActiveTimer* iSliderEventTimer;
       
   189 
       
   190         /**
       
   191         * NOT OWN!!!
       
   192         */
       
   193 		MMusUiLevelIndicatorObserver* iObserver;
       
   194 
       
   195     };
       
   196 
       
   197 
       
   198 #endif
       
   199 
       
   200 // End of File