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#28 %
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         void SuppressDrawing( TBool aSuppress );
00086     public: // from CCoeControl
00087 
00095         TSize MinimumSize();
00096    
00106         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
00107         
00115         IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
00116         
00124         IMPORT_C void HandleResourceChange(TInt aType);
00125         
00135         IMPORT_C static CFbsBitmap* CreateBitmapL(TInt aValue);
00136     
00146         IMPORT_C static CGulIcon* CreateSetStyleListBoxIconL( TInt aValue );
00147         
00160         IMPORT_C static CGulIcon* CreateSetDynRangeStyleListBoxIconL( TInt aValue,
00161                                                                   TInt aMinimum,
00162                                                                   TInt aMaximum );
00163 
00171         void HandleNaviStackChange( TBool aIsOnNaviStack );
00172         
00173     protected: // from CCoeControl
00174 
00180         void SizeChanged();
00181         
00189         void Draw(const TRect& aRect) const;
00190         
00191     public:
00192 
00200         IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00201 
00209         IMPORT_C void HandleNaviDecoratorEventL( TInt aEventID ); 
00210 
00211     private:
00212     
00216         IMPORT_C void* ExtensionInterface( TUid aInterface );        
00217         
00218     private:
00219         
00223         void SetVolumeLayout(TInt aStyle);
00224         
00228         void StartTimerL();
00229         
00235         static TInt IndicationDrawCallbackL( TAny* aThis );
00236                 
00241                 void SmallDirectionIndicationL();
00242 
00246         void CreateNaviIconL();
00247         
00248         // Refactored: Used for drawing different styles.
00249         void DrawSettingsStyleVolumeControl( const TRect& aRect ) const;
00250         void DrawDefaultStyleVolumeControl( const TRect& aRect ) const;
00251         void DrawSkinnedDefaultStyleVolumeControl( const TRect& aRect ) const;
00252         void DrawDynRangeSettingsStyleVolumeControl( const TRect& aVolumeArea ) const;
00253     
00262         void CalcVolumeIconAreas( const TInt aVolume, 
00263                                   const TRect& aDrawArea,
00264                                   TRect& aActiveRect, 
00265                                   TRect& aInactiveRect ) const;
00266 
00274         TInt CAknVolumeControl::ScaledValue() const;
00275         
00276 
00277     private:        
00278     
00279         CFbsBitmap*         iBitmap;
00280         CFbsBitmap*         iMaskBitmap;
00281         TPoint              iStartPos;
00282         CVolumeExtension*   iExtension;
00283         TInt                iSpare1;
00284         TPoint              iBmpPos;
00285         TInt                iValue;
00286         TInt                iStyle;
00287     };
00288 
00289 #endif        // AKNVOLUMECONTROL_H

Copyright © Nokia Corporation 2001-2007
Back to top