videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackvolumebar.h
changeset 0 96612d01cf9f
child 10 112a725ff2c2
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Implementation of CMPXVideoPlaybackVolumeBar
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 7 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MPXVIDEOPLAYBACKVOLUMEBAR_H
       
    23 #define MPXVIDEOPLAYBACKVOLUMEBAR_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <coecntrl.h>
       
    27 
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CMPXVideoPlaybackControlsController;
       
    31 
       
    32 #ifdef RD_TACTILE_FEEDBACK
       
    33 class MTouchFeedback;
       
    34 #endif //RD_TACTILE_FEEDBACK
       
    35 
       
    36 // DATA TYPES
       
    37 enum TMPXVolumeDragging
       
    38 {
       
    39    EVolumeNotDragging,
       
    40    EVolumeIncreaseDragging,
       
    41    EVolumeDecreaseDragging,
       
    42    EVolumeSpeakerDragging,
       
    43    EVolumeBarDragging
       
    44 };
       
    45 
       
    46 
       
    47 class CMPXVideoPlaybackVolumeBar : public CCoeControl
       
    48 {
       
    49     public:
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         */
       
    53         static CMPXVideoPlaybackVolumeBar* NewL( CMPXVideoPlaybackControlsController* aController,
       
    54                                                  TRect aRect );
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CMPXVideoPlaybackVolumeBar();
       
    60 
       
    61     private:
       
    62 
       
    63         /**
       
    64         * C++ default constructor.
       
    65         */
       
    66         CMPXVideoPlaybackVolumeBar( CMPXVideoPlaybackControlsController* aController, TRect aRect );
       
    67 
       
    68         /**
       
    69          * By default Symbian 2nd phase constructor is private.
       
    70          */
       
    71         void ConstructL();
       
    72 
       
    73     private: // from CoeControl
       
    74 
       
    75         /**
       
    76         * From CoeControl,CountComponentControls.
       
    77         * @return Number of contained component controls.
       
    78         */
       
    79         TInt CountComponentControls() const;
       
    80 
       
    81         /**
       
    82         * From CCoeControl,Draw.
       
    83         * @param aRect drawable area.
       
    84         */
       
    85         void Draw( const TRect& aRect ) const;
       
    86 
       
    87     public: // from CoeControl
       
    88 
       
    89         /**
       
    90         * From CoeControl,OfferKeyEventL
       
    91         */
       
    92         void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
    93 
       
    94         /**
       
    95         * From CCoeControl.
       
    96         */
       
    97         void HandleResourceChange( TInt aType );
       
    98 
       
    99     public:
       
   100 
       
   101         /**
       
   102         * Set changed volume
       
   103         * @since 5.0
       
   104         * @return void
       
   105         */
       
   106         void VolumeChanged( TInt aVolume );
       
   107         
       
   108         /*
       
   109          *  Abandons any ongoing pointer input 
       
   110          *  @since 5.0
       
   111          */        
       
   112         void Reset();
       
   113 
       
   114     private: //new fuctions
       
   115         /**
       
   116         * Set layout for each icon
       
   117         */
       
   118         void SetLayout();
       
   119 
       
   120         /**
       
   121         * Creates new skins for the control.
       
   122         * @since 5.0
       
   123         * @return void
       
   124         */
       
   125         void SkinChangeL();
       
   126         
       
   127         void HandleVolumeIncreaseL( const TPointerEvent& aPointerEvent );
       
   128         void HandleVolumeDecreaseL( const TPointerEvent& aPointerEvent );
       
   129         void HandleSpeakerControlEventL( const TPointerEvent& aPointerEvent );
       
   130         void HandleVolumeBarEventL( const TPointerEvent& aPointerEvent );
       
   131 
       
   132         static TInt HandleVolumeDragEventTimeOut( TAny* aPtr );
       
   133         void DoHandleVolumeDragEventTimeOut();
       
   134         void SetVolumeL( TInt aVolume ); 
       
   135 
       
   136     private:    // Data
       
   137         CGulIcon*               iSpeakerIcon;
       
   138         CGulIcon*               iSpeakerMuteIcon;
       
   139         CGulIcon*               iSliderIcon;
       
   140         CGulIcon*               iSliderSelectedIcon;
       
   141         CGulIcon*               iVolumeUpIcon;
       
   142         CGulIcon*               iVolumeDownIcon;
       
   143         CGulIcon*               iVolumeFrameIconTop;
       
   144         CGulIcon*               iVolumeFrameIconMiddle;
       
   145         CGulIcon*               iVolumeFrameIconBottom;
       
   146         CGulIcon*               iNoAudioIcon; 
       
   147 
       
   148         TReal                   iOneVolumeIncrementHeight;
       
   149 
       
   150         TBool                   iMuted;
       
   151         TInt                    iVolumeWhileDraggingEvent;
       
   152 
       
   153         TRect                   iRect;
       
   154         TRect                   iSliderRect;        
       
   155         TRect                   iSpeakerRect;
       
   156         TRect                   iSpeakerControlRect;
       
   157         TRect                   iVolumeUpRect;
       
   158         TRect                   iVolumeDownRect;
       
   159         TRect                   iVolumeUpControlRect;
       
   160         TRect                   iVolumeDownControlRect;
       
   161         TRect                   iVolumeBarRect;
       
   162         TRect                   iVolumeBarRectTop;
       
   163         TRect                   iVolumeBarRectMiddle;
       
   164         TRect                   iVolumeBarRectBottom;
       
   165         TRect                   iVolumeControlRect;
       
   166 
       
   167         TMPXVolumeDragging      iDragging;
       
   168         
       
   169         CPeriodic*              iDraggingHandlerTimer;
       
   170 
       
   171         CMPXVideoPlaybackControlsController* iController;
       
   172 
       
   173 #ifdef RD_TACTILE_FEEDBACK
       
   174         MTouchFeedback*         iFeedback;
       
   175 #endif //RD_TACTILE_FEEDBACK
       
   176 };
       
   177 
       
   178 #endif //MPXVIDEOPLAYBACKVOLUMEBAR_H
       
   179 
       
   180 // End of File