videoplayback/hbvideoplaybackview/tsrc/teststatuspanecontrol/stub/inc/mpxvideoplaybackcontrolscontroller.h
changeset 44 518105d52e45
parent 42 17f382c040b1
child 49 824471cb468a
equal deleted inserted replaced
42:17f382c040b1 44:518105d52e45
     1 /*
       
     2 * Copyright (c) 2010 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 MPXVideoPlaybackControlsController
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version:  2 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
       
    23 #define MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_
       
    24 
       
    25 // INCLUDES
       
    26 #include <qobject>
       
    27 
       
    28 #include <mpxplaybackframeworkdefs.h>
       
    29 
       
    30 #include "mpxvideo_debug.h"
       
    31 #include "mpxvideoplaybackcontrol.hrh"
       
    32 #include "mpxcommonvideoplaybackview.hrh"
       
    33 #include "mpxvideoplaybackviewfiledetails.h"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class HbVideoBasePlaybackView;
       
    37 class QMPXVideoPlaybackDocumentLoader;
       
    38 class QMPXVideoPlaybackFullScreenControl;
       
    39 class QMPXVideoPlaybackControlsController;
       
    40 
       
    41 
       
    42 // DATA TYPES
       
    43 
       
    44 enum TMPXTimerAction
       
    45 {
       
    46     EMPXTimerCancel,
       
    47     EMPXTimerReset
       
    48 };
       
    49 
       
    50 enum TPlaybackViewMode
       
    51 {
       
    52     EFullScreenView,
       
    53     EDetailsView,
       
    54     EAudioOnlyView
       
    55 };
       
    56 
       
    57 
       
    58 // CLASS DECLARATION
       
    59 
       
    60 class QMPXVideoPlaybackControlsController : public QObject
       
    61 {
       
    62     Q_OBJECT
       
    63 
       
    64     public:
       
    65 
       
    66         /**
       
    67         * constructor.
       
    68         */
       
    69         QMPXVideoPlaybackControlsController(
       
    70                 HbVideoBasePlaybackView *view,
       
    71                 QMPXVideoPlaybackViewFileDetails *details );
       
    72 
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         virtual ~QMPXVideoPlaybackControlsController();
       
    77 
       
    78     public:
       
    79         /**
       
    80         * Reset or cancel timers for the controls
       
    81         */
       
    82         void resetDisappearingTimers( TMPXTimerAction timerAction );
       
    83 
       
    84         /*
       
    85         * Return state
       
    86         */
       
    87         inline TMPXPlaybackState state();
       
    88 
       
    89         /**
       
    90         * Return file details
       
    91         */
       
    92         inline QMPXVideoPlaybackViewFileDetails* fileDetails();
       
    93 
       
    94         QMPXVideoPlaybackDocumentLoader* layoutLoader();
       
    95 
       
    96         inline HbVideoBasePlaybackView* view();
       
    97         
       
    98         void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
       
    99         
       
   100         TPlaybackViewMode viewMode();
       
   101 
       
   102     public:
       
   103         /**
       
   104         * Initialize controller
       
   105         */
       
   106         void initializeController();
       
   107 
       
   108         /**
       
   109         * Create controls
       
   110         */
       
   111         void createControls();
       
   112 
       
   113         /**
       
   114         * Update controls
       
   115         */
       
   116         void handleStateChange( TMPXPlaybackState newState );
       
   117 
       
   118         /**
       
   119         * Update Control's visibility
       
   120         */
       
   121         void updateControlsVisibility();
       
   122 
       
   123     public:
       
   124         HbVideoBasePlaybackView                   *mView;
       
   125         QMPXVideoPlaybackViewFileDetails          *mFileDetails;
       
   126 
       
   127         QList<QMPXVideoPlaybackFullScreenControl*> mControls;
       
   128 
       
   129         QMPXVideoPlaybackDocumentLoader           *mLoader;
       
   130 
       
   131         TMPXPlaybackState                          mState;
       
   132         TPlaybackViewMode                          mViewMode;
       
   133         TMPXTimerAction                            mTimerAction;
       
   134         
       
   135 };
       
   136 
       
   137 // INLINE METHODS
       
   138 // -------------------------------------------------------------------------------------------------
       
   139 //   QMPXVideoPlaybackControlsController::state
       
   140 // -------------------------------------------------------------------------------------------------
       
   141 //
       
   142 inline
       
   143 TMPXPlaybackState QMPXVideoPlaybackControlsController::state()
       
   144 {
       
   145     return mState;
       
   146 }
       
   147 
       
   148 // -------------------------------------------------------------------------------------------------
       
   149 //   QMPXVideoPlaybackControlsController::fileDetails
       
   150 // -------------------------------------------------------------------------------------------------
       
   151 //
       
   152 inline
       
   153 QMPXVideoPlaybackViewFileDetails* QMPXVideoPlaybackControlsController::fileDetails()
       
   154 {
       
   155     return mFileDetails;
       
   156 }
       
   157 
       
   158 // -------------------------------------------------------------------------------------------------
       
   159 //   QMPXVideoPlaybackControlsController::view
       
   160 // -------------------------------------------------------------------------------------------------
       
   161 //
       
   162 inline
       
   163 HbVideoBasePlaybackView* QMPXVideoPlaybackControlsController::view()
       
   164 {
       
   165     return mView;
       
   166 }
       
   167 
       
   168 #endif /*MPXVIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
       
   169 
       
   170 // End of File