videoplayback/videoplaybackview/tsrc/testcontrolpolicy/stub/inc/videoplaybackcontrolscontroller.h
changeset 44 518105d52e45
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 VideoPlaybackControlsController
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version:  2 %
       
    19 
       
    20 
       
    21 
       
    22 #ifndef VIDEOPLAYBACKCONTROLSCONTROLLER_H_
       
    23 #define VIDEOPLAYBACKCONTROLSCONTROLLER_H_
       
    24 
       
    25 // INCLUDES
       
    26 #include <qobject>
       
    27 #include <mpxplaybackframeworkdefs.h>
       
    28 
       
    29 #include "mpxvideo_debug.h"
       
    30 #include "mpxcommonvideoplaybackview.hrh"
       
    31 
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 
       
    35 
       
    36 // DATA TYPES
       
    37 
       
    38 enum TTimerAction
       
    39 {
       
    40     ETimerCancel,
       
    41     ETimerReset
       
    42 };
       
    43 
       
    44 enum TPlaybackViewMode
       
    45 {
       
    46     EFullScreenView,
       
    47     EDetailsView,
       
    48     EAudioOnlyView
       
    49 };
       
    50 
       
    51 const int KControlsTimeOut = 4000;
       
    52 
       
    53 // CLASS DECLARATION
       
    54 
       
    55 class VideoPlaybackControlsController : public QObject
       
    56 {
       
    57     Q_OBJECT
       
    58 
       
    59     public:
       
    60 
       
    61         /**
       
    62         * constructor.
       
    63         */
       
    64         VideoPlaybackControlsController();
       
    65 
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         virtual ~VideoPlaybackControlsController();
       
    70 
       
    71     public:
       
    72 
       
    73         /**
       
    74         * Command handling function.
       
    75         * Call HandleCommandL() of container
       
    76         */
       
    77         void handleCommand( TMPXVideoPlaybackViewCommandIds command, int value = 0 );
       
    78 
       
    79         /**
       
    80         * Reset or cancel timers for the controls
       
    81         */
       
    82         void resetDisappearingTimers( TTimerAction timerAction );
       
    83 
       
    84         /**
       
    85         * Return state
       
    86         */
       
    87         inline TMPXPlaybackState state();
       
    88 
       
    89         TPlaybackViewMode viewMode();
       
    90 
       
    91         void changeViewMode( TPlaybackViewMode viewMode, bool transitionEffect = true );
       
    92 
       
    93     public:
       
    94         TMPXPlaybackState                          mState;
       
    95         TPlaybackViewMode                          mViewMode;
       
    96         TTimerAction                               mTimerAction;
       
    97         TMPXVideoPlaybackViewCommandIds            mCommand;
       
    98         int                                        mCommandValue;
       
    99 };
       
   100 
       
   101 // INLINE METHODS
       
   102 // -------------------------------------------------------------------------------------------------
       
   103 //   VideoPlaybackControlsController::state
       
   104 // -------------------------------------------------------------------------------------------------
       
   105 //
       
   106 inline
       
   107 TMPXPlaybackState VideoPlaybackControlsController::state()
       
   108 {
       
   109     return mState;
       
   110 } 
       
   111 
       
   112 // -------------------------------------------------------------------------------------------------
       
   113 //   VideoPlaybackControlsController::viewMode
       
   114 // -------------------------------------------------------------------------------------------------
       
   115 //
       
   116 inline
       
   117 TPlaybackViewMode VideoPlaybackControlsController::viewMode()
       
   118 {
       
   119     return mViewMode;
       
   120 }
       
   121 
       
   122 #endif /*VIDEOPLAYBACKCONTROLSCONTROLLER_P_H_*/
       
   123 
       
   124 // End of File