00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
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: 
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: 
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         
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 
00280 #endif