00001 /* 00002 * ============================================================================ 00003 * Name : CAknVolumeControl from Aknvolumecontrol.h 00004 * Part of : Avkon 00005 * Description : Volume editor class 00006 * Version : %version: e003sa01#25 % 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 00063 00064 00065 public: // from CCoeControl 00066 00074 TSize MinimumSize(); 00075 00085 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); 00086 00094 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader); 00095 00103 IMPORT_C void HandleResourceChange(TInt aType); 00104 00114 IMPORT_C static CFbsBitmap* CreateBitmapL(TInt aValue); 00115 00125 IMPORT_C static CGulIcon* CreateSetStyleListBoxIconL( TInt aValue ); 00126 00127 protected: // from CCoeControl 00128 00134 void SizeChanged(); 00135 00143 void Draw(const TRect& aRect) const; 00144 00145 public: 00146 00154 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 00155 00163 IMPORT_C void HandleNaviDecoratorEventL( TInt aEventID ); 00164 00165 private: 00166 00170 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00171 00172 private: 00173 00177 void SetVolumeLayout(TInt aStyle); 00178 00182 void StartTimerL(); 00183 00189 static TInt IndicationDrawCallbackL( TAny* aThis ); 00190 00195 void SmallDirectionIndicationL(); 00196 00200 void CreateNaviIconL(); 00201 00202 // Refactored: Used for drawing different styles. 00203 void DrawSettingsStyleVolumeControl( const TRect& aRect ) const; 00204 void DrawDefaultStyleVolumeControl( const TRect& aRect ) const; 00205 void DrawSkinnedDefaultStyleVolumeControl( const TRect& aRect ) const; 00206 void DrawDynRangeSettingsStyleVolumeControl( const TRect& aVolumeArea ) const; 00207 00216 void CalcVolumeIconAreas( const TInt aVolume, 00217 const TRect& aDrawArea, 00218 TRect& aActiveRect, 00219 TRect& aInactiveRect ) const; 00220 00228 TInt CAknVolumeControl::ScaledValue() const; 00229 00230 00231 private: 00232 00233 CFbsBitmap* iBitmap; 00234 CFbsBitmap* iMaskBitmap; 00235 TPoint iStartPos; 00236 CVolumeExtension* iExtension; 00237 TInt iSpare1; 00238 TPoint iBmpPos; 00239 TInt iValue; 00240 TInt iStyle; 00241 }; 00242 00243 // AKNVOLUMECONTROL_H 00244 #endif