videoplayback/hbvideoplaybackview/controlinc/mpxvideoplaybacktoolbar.h
changeset 37 4eb2df7f7cbe
child 28 c48470be1ba7
equal deleted inserted replaced
36:8aed59de29f9 37:4eb2df7f7cbe
       
     1 /*
       
     2 * Copyright (c) 2009 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 QMPXVideoPlaybackToolBar
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 2 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MPXVIDEOPLAYBACKTOOLBAR_H_
       
    23 #define MPXVIDEOPLAYBACKTOOLBAR_H_
       
    24 
       
    25 #include <QObject>
       
    26 
       
    27 #include <MMFScalingCustomCommandConstants.h>
       
    28 #include <mpxplaybackframeworkdefs.h>
       
    29 
       
    30 
       
    31 class QTimer;
       
    32 class HbIcon;
       
    33 class HbAction;
       
    34 class HbToolBar;
       
    35 class HbToolButton;
       
    36 class QMPXVideoPlaybackViewFileDetails;
       
    37 class QMPXVideoPlaybackControlsController;
       
    38 
       
    39 // DATA TYPES
       
    40 
       
    41 enum TMPXButton
       
    42 {
       
    43     EMPX1stButton,
       
    44     EMPX2ndButton,
       
    45     EMPX3rdButton,
       
    46     EMPX4thButton,
       
    47     EMPX5thButton,
       
    48     EMPXButtonCount    // Should always be the last value
       
    49 };
       
    50 
       
    51 enum TMPXButtonIcon
       
    52 {
       
    53     EMPXRWIcon,
       
    54     EMPXPlayIcon,
       
    55     EMPXPauseIcon,
       
    56     EMPXFFIcon,
       
    57     EMPXNaturalIcon,
       
    58     EMPXStretchIcon,
       
    59     EMPXZoomIcon,
       
    60     EMPXDetailsIcon,
       
    61     EMPXAttachIcon,
       
    62     EMPXShareIcon,
       
    63     EMPXIconCount    // Should always be the last value
       
    64 };
       
    65 
       
    66 enum TMPXSeekingState
       
    67 {
       
    68     EMPXNotSeeking,
       
    69     EMPXFastForwarding,
       
    70     EMPXRewinding
       
    71 };
       
    72 
       
    73 const int KMPXFastForward = 30;
       
    74 const int KMPXRewind = -10;
       
    75 
       
    76 class QMPXVideoPlaybackToolBar : public QObject
       
    77 {
       
    78     Q_OBJECT
       
    79 
       
    80     public:
       
    81         QMPXVideoPlaybackToolBar( QMPXVideoPlaybackControlsController* controller );
       
    82         virtual ~QMPXVideoPlaybackToolBar();
       
    83         void updateState( TMPXPlaybackState state );
       
    84         void aspectRatioChanged( int aspectRatio );
       
    85         void initialize();
       
    86         void updateWithFileDetails( QMPXVideoPlaybackViewFileDetails* details );
       
    87         void positionChanged( int position );
       
    88         void durationChanged( int duration );
       
    89         void setVisible( bool visible );
       
    90 
       
    91     private slots:
       
    92         void playPause();
       
    93         void changeAspectRatio();
       
    94         void handleButtonPressed();
       
    95         void handleRWButtonPressed();
       
    96         void handleFFButtonPressed();
       
    97         void ffPressing();
       
    98         void rwPressing();
       
    99         void ffReleased();
       
   100         void rwReleased();
       
   101         void openDetailsView();
       
   102         void retrieveButtons();
       
   103 
       
   104     private:
       
   105         QMPXVideoPlaybackControlsController *mController;
       
   106         HbToolBar                           *mToolBar;
       
   107         QTimer                              *mSeekStartTimer;
       
   108         QTimer                              *mRetrieveButtonTimer;
       
   109 
       
   110         QList<HbIcon*>                       mButtonIcons;
       
   111         QList<HbAction*>                     mButtonActions;
       
   112         QList<HbToolButton*>                 mButtons;
       
   113 
       
   114         TMPXSeekingState                     mSeekingState;
       
   115 
       
   116         bool    mInitialized;
       
   117         bool    mNeverVisibled;
       
   118         int     mPosition;
       
   119         int     mDuration;
       
   120         int     mAspectRatio;
       
   121         TReal32 mDisplayAspectRatio;
       
   122 };
       
   123 
       
   124 #endif /*MPXVIDEOPLAYBACKTOOLBAR_H_*/