aknvolumecontrol.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name         : CAknVolumeControl from Aknvolumecontrol.h
00004 *  Part of      : Avkon
00005 *  Description  : Volume editor class
00006 *  Version      : %version: e003sa02#26 %
00007 *
00008 *  Copyright © 2002-2006 Nokia Corporation.
00009 *  This material, including documentation and any related 
00010 *  computer programs, is protected by copyright controlled by 
00011 *  Nokia Corporation. All rights are reserved. Copying, 
00012 *  including reproducing, storing,  adapting or translating, any 
00013 *  or all of this material requires the prior written consent of 
00014 *  Nokia Corporation. This material also contains confidential 
00015 *  information which may not be disclosed to others without the 
00016 *  prior written consent of Nokia Corporation.
00017 * ============================================================================
00018 */
00019 
00020 #ifndef AKNVOLUMECONTROL_H
00021 #define AKNVOLUMECONTROL_H
00022 
00023 #include <aknnavidecoratorobserver.h>
00024 
00025 #include <AknControl.h>
00026 
00027 class CGulIcon;
00028 class MAknsSkinInstance;
00029 class CVolumeExtension;
00030 
00034 class CAknVolumeControl : public CAknControl, public MAknNaviDecoratorObserver
00035     {
00036 
00037     public:
00038 
00042         IMPORT_C CAknVolumeControl();
00043 
00047         IMPORT_C ~CAknVolumeControl();
00048 
00054         IMPORT_C void SetValue(TInt aValue);
00055 
00061         IMPORT_C TInt Value() const;
00062 
00075         IMPORT_C void SetRange( TInt aMinimumValue, TInt aMaximumValue );
00076         
00083         IMPORT_C void GetRange( TInt& aMinimumValue, TInt& aMaximumValue );
00084         
00085     public: // from CCoeControl
00086 
00094         TSize MinimumSize();
00095    
00105         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
00106         
00114         IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
00115         
00123         IMPORT_C void HandleResourceChange(TInt aType);
00124         
00134         IMPORT_C static CFbsBitmap* CreateBitmapL(TInt aValue);
00135     
00145         IMPORT_C static CGulIcon* CreateSetStyleListBoxIconL( TInt aValue );
00146         
00159         IMPORT_C static CGulIcon* CreateSetDynRangeStyleListBoxIconL( TInt aValue,
00160                                                                   TInt aMinimum,
00161                                                                   TInt aMaximum );
00162         
00163     protected: // from CCoeControl
00164 
00170         void SizeChanged();
00171         
00179         void Draw(const TRect& aRect) const;
00180         
00181     public:
00182 
00190         IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00191 
00199         IMPORT_C void HandleNaviDecoratorEventL( TInt aEventID ); 
00200 
00201     private:
00202     
00206         IMPORT_C void* ExtensionInterface( TUid aInterface );        
00207         
00208     private:
00209         
00213         void SetVolumeLayout(TInt aStyle);
00214         
00218         void StartTimerL();
00219         
00225         static TInt IndicationDrawCallbackL( TAny* aThis );
00226                 
00231                 void SmallDirectionIndicationL();
00232 
00236         void CreateNaviIconL();
00237         
00238         // Refactored: Used for drawing different styles.
00239         void DrawSettingsStyleVolumeControl( const TRect& aRect ) const;
00240         void DrawDefaultStyleVolumeControl( const TRect& aRect ) const;
00241         void DrawSkinnedDefaultStyleVolumeControl( const TRect& aRect ) const;
00242         void DrawDynRangeSettingsStyleVolumeControl( const TRect& aVolumeArea ) const;
00243     
00252         void CalcVolumeIconAreas( const TInt aVolume, 
00253                                   const TRect& aDrawArea,
00254                                   TRect& aActiveRect, 
00255                                   TRect& aInactiveRect ) const;
00256 
00264         TInt CAknVolumeControl::ScaledValue() const;
00265         
00266 
00267     private:        
00268     
00269         CFbsBitmap*         iBitmap;
00270         CFbsBitmap*         iMaskBitmap;
00271         TPoint              iStartPos;
00272         CVolumeExtension*   iExtension;
00273         TInt                iSpare1;
00274         TPoint              iBmpPos;
00275         TInt                iValue;
00276         TInt                iStyle;
00277     };
00278 
00279 // AKNVOLUMECONTROL_H
00280 #endif

Copyright © Nokia Corporation 2001-2008
Back to top