videoplayback/videoplaybackcontrols/inc/mpxvideoplaybackprogressbar.h
changeset 0 96612d01cf9f
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: Progress bar control
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 6 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MPXVIDEOPLAYBACKPROGRESSBAR_H
       
    23 #define MPXVIDEOPLAYBACKPROGRESSBAR_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <coecntrl.h>
       
    27 
       
    28 #include "mpxhelixplaybackplugindefs.h"
       
    29 
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CEikLabel;
       
    33 class CMPXVideoPlaybackViewFileDetails;
       
    34 class CMPXVideoPlaybackControlsController;
       
    35 
       
    36 #ifdef RD_TACTILE_FEEDBACK
       
    37 class MTouchFeedback;
       
    38 #endif //RD_TACTILE_FEEDBACK
       
    39 
       
    40 
       
    41 class CMPXVideoPlaybackProgressBar : public CCoeControl
       
    42 {
       
    43     public:
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         */
       
    47         static CMPXVideoPlaybackProgressBar* NewL( CMPXVideoPlaybackControlsController* aController,
       
    48                                                    TRect aRect );
       
    49 
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         virtual ~CMPXVideoPlaybackProgressBar();
       
    54 
       
    55     private:
       
    56 
       
    57         /**
       
    58         * C++ default constructor.
       
    59         */
       
    60         CMPXVideoPlaybackProgressBar( CMPXVideoPlaybackControlsController* aController );
       
    61 
       
    62         /**
       
    63          * By default Symbian 2nd phase constructor is private.
       
    64          */
       
    65         void ConstructL( TRect aRect );
       
    66 
       
    67     private: // from CoeControl
       
    68 
       
    69         /**
       
    70         * From CoeControl,CountComponentControls.
       
    71         * @return Number of contained component controls.
       
    72         */
       
    73         TInt CountComponentControls() const;
       
    74 
       
    75         /**
       
    76         * From CCoeControl,ComponentControl.
       
    77         * @param aIndex index of a contained component control.
       
    78         */
       
    79         CCoeControl* ComponentControl( TInt aIndex ) 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 duration
       
   103         * @param aDur the duration text to be displayed
       
   104         */
       
   105         void DurationChangedL( TInt aDuration );
       
   106 
       
   107         /**
       
   108         * Set changed position
       
   109         * @param aPos the position text to be displayed
       
   110         * @since 5.0
       
   111         */
       
   112         void PositionChangedL( TInt aPosition, TBool aUserChanged = EFalse );
       
   113 
       
   114         /*
       
   115         *  Sets the size of download
       
   116         *  @param aSize   Download size
       
   117         *  @since 5.0
       
   118         */
       
   119         void SetDownloadSize( TInt aSize );
       
   120         
       
   121         /*
       
   122         *  Updates the download size and calculates the download progress ratio
       
   123         *  @param aSize   Updated Download Size
       
   124         *  @since 5.0
       
   125         */
       
   126         void UpdateDownloadPosition( TInt aSize );
       
   127         
       
   128         /*
       
   129          *  Creates the needed resource if the playback mode changes
       
   130          *  @since 5.0
       
   131          */
       
   132         void UpdateProgressBarStateL( CMPXVideoPlaybackViewFileDetails* aDetails );
       
   133         
       
   134         /*
       
   135          *  Abandons any ongoing pointer input 
       
   136          *  @since 5.0
       
   137          */        
       
   138         void Reset();
       
   139 
       
   140     private: //new fuctions
       
   141         /**
       
   142         * Set layout for each icon
       
   143         */
       
   144         void SetLayoutL();
       
   145 
       
   146         /**
       
   147         * Creates new skins for the control.
       
   148         * @since 5.0
       
   149         * @return void
       
   150         */
       
   151         void SkinChangeL();
       
   152 
       
   153         /*
       
   154         *  change times to readable format for MM:SS
       
   155         *  @param aTime need to change aTime to readable format
       
   156         *  @param aLabel label to assing readable time
       
   157         */
       
   158         void SetTextLWithReadableTimeL( TInt aTime, CEikLabel* aLabel );
       
   159         
       
   160         //
       
   161         //  Performs logic for the button down events
       
   162         //
       
   163         void HandleButtonDownEventL( TReal aRatio );
       
   164 
       
   165         //
       
   166         //  Performs logic for the dragging events
       
   167         //
       
   168         void HandleDraggingEventL( TReal aRatio );
       
   169         
       
   170         //
       
   171         //  Performs logic for the button up events
       
   172         //
       
   173         void HandleButtonUpEventL( TReal aRatio );
       
   174         
       
   175     private:    // Data
       
   176         CMPXVideoPlaybackControlsController* iController;
       
   177 
       
   178         CGulIcon*               iFrameIcon;
       
   179         CGulIcon*               iPlaybackIcon;
       
   180         CGulIcon*               iDownloadIcon;
       
   181         CGulIcon*               iSliderIcon;
       
   182         CGulIcon*               iSelectedSliderIcon;
       
   183 
       
   184         TRect                   iFrameIconRect;
       
   185         TRect                   iPlaybackRect;
       
   186         TRect                   iDownloadRect;
       
   187         TRect                   iSliderRect;
       
   188 
       
   189         TReal                   iDuration;
       
   190         TReal                   iPlaybackRatio;
       
   191         TReal                   iDownloadRatio;
       
   192 
       
   193         CEikLabel*              iPositionLabel;
       
   194         CEikLabel*              iDurationLabel;
       
   195 
       
   196         HBufC*                  iMinSecFormatString;
       
   197         HBufC*                  iHourMinSecFormatString;
       
   198         HBufC*                  iLiveStreamingString;
       
   199 
       
   200         TBool                   iDragging;
       
   201         TBool                   iPointerEventStarted;
       
   202         TBool                   iWasPlaying;
       
   203         
       
   204         TInt                    iDownloadSize;
       
   205         TInt                    iOldDLSize;
       
   206 
       
   207 #ifdef RD_TACTILE_FEEDBACK
       
   208         MTouchFeedback*         iFeedback;
       
   209 #endif //RD_TACTILE_FEEDBACK
       
   210 
       
   211 };
       
   212 
       
   213 #endif //MPXVIDEOPLAYBACKPROGRESSBAR_H
       
   214 
       
   215 // End of File