videoplayback/inc/mpxvideoplaybackcontainer.h
changeset 0 96612d01cf9f
child 9 5294c000a26d
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:  MPX Video playback view's container implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 6 %
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __CMPXVIDEOPLAYBACKCONTAINER_H__
       
    24 #define __CMPXVIDEOPLAYBACKCONTAINER_H__
       
    25 
       
    26 
       
    27 // INCLUDES
       
    28 #include <coecntrl.h>
       
    29 #include <eikimage.h> // CEikImage
       
    30 #include <remconcoreapitargetobserver.h> // Side volume key
       
    31 
       
    32 #include <mpxplaybackframeworkdefs.h>
       
    33 #include "mpxvideoplaybackcontrol.hrh"
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 class CMPXVideoBasePlaybackView;
       
    37 class CMPXVideoPlaybackControlsController;
       
    38 class CMPXVideoPlaybackViewFileDetails;
       
    39 class CMPXVideoPlaybackUserInputHandler;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  *  Container class for video view.
       
    45  *
       
    46  */
       
    47 class CMPXVideoPlaybackContainer : public CCoeControl
       
    48 {
       
    49     public:
       
    50 
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         static CMPXVideoPlaybackContainer* NewL( CMPXVideoBasePlaybackView* aView );
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         ~CMPXVideoPlaybackContainer();
       
    60 
       
    61     private:
       
    62 
       
    63         /**
       
    64         * C++ default constructor.
       
    65         */
       
    66         CMPXVideoPlaybackContainer( CMPXVideoBasePlaybackView* aView );
       
    67 
       
    68         /**
       
    69         * Symbian 2nd phase constructor.
       
    70         *
       
    71         * @param aRect Frame rectangle for container.
       
    72         */
       
    73         void ConstructL();
       
    74 
       
    75     protected:
       
    76         // from base class CoeControl
       
    77         /**
       
    78         * From CoeControl.
       
    79         * Handles key events.
       
    80         *
       
    81         * @param aKeyEvent The key event.
       
    82         * @param aType The type of key event.
       
    83         */
       
    84         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    85 
       
    86         /**
       
    87         * From CoeControl.
       
    88         * Handles a change to the control's resources.
       
    89         *
       
    90         * @param aType A message UID value.
       
    91         */
       
    92         void HandleResourceChange( TInt aType );
       
    93 
       
    94         /**
       
    95         * From CoeControl.
       
    96         * Gets the control's help context.
       
    97         *
       
    98         * @param aContext The control's help context.
       
    99         */
       
   100         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   101 
       
   102         /**
       
   103         * From CCoeControl.
       
   104         * Gets the number of controls contained in a compound control.
       
   105         *
       
   106         * @return The number of component controls contained by this control.
       
   107         */
       
   108         TInt CountComponentControls() const;
       
   109 
       
   110         /**
       
   111         * From CCoeControl.
       
   112         * Gets an indexed component of a compound control.
       
   113         *
       
   114         * @param aIndex The index of the control.
       
   115         * @return The component control with an index of aIndex.
       
   116         */
       
   117         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   118 
       
   119         /**
       
   120         * From CCoeControl.
       
   121         * Draws the control.
       
   122         *
       
   123         * @param aRect The rectangular region of the control to be drawn.
       
   124         */
       
   125         void Draw( const TRect& aRect ) const;
       
   126 
       
   127         /**
       
   128         * From CCoeControl.
       
   129         * Handle events from the touch screen
       
   130         */
       
   131         void HandlePointerEventL( const TPointerEvent& aPointerEvent);
       
   132 
       
   133     public:
       
   134         /**
       
   135         * Return a handle to the window
       
   136         */
       
   137         RWindow& GetWindow() const;
       
   138 
       
   139         /**
       
   140         * Handle commands from control controller
       
   141         * @return void
       
   142         */
       
   143         IMPORT_C void HandleCommandL( TInt aCommand, TInt aValue = 0 );
       
   144 
       
   145         IMPORT_C void DoHandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   146         IMPORT_C void DoHandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   147 
       
   148         /**
       
   149         * Getter method for User INput Handler
       
   150         *
       
   151         */
       
   152         IMPORT_C CMPXVideoPlaybackUserInputHandler* UserInputHandler();
       
   153 
       
   154         /**
       
   155         * Handle event from container
       
   156         */
       
   157         void HandleEventL( TMPXVideoPlaybackControlCommandIds aEvent, TInt aValue = 0 );
       
   158 
       
   159         void AddFileDetailsL( CMPXVideoPlaybackViewFileDetails* aDetails );
       
   160 
       
   161     private:
       
   162 
       
   163         /**
       
   164         * Creates new skins for the view.
       
   165         * @return void
       
   166         */
       
   167         void SkinChangeL();
       
   168 
       
   169         /**
       
   170         * Create CEikImage
       
   171         * @param aIconsPath icon path
       
   172         * @param aBitmapIndex bitmap index
       
   173         * @param aBitmapMaskIndex bitmap index
       
   174         * @return CEikImage
       
   175         */
       
   176         CEikImage* CreateImageL( TFileName& aIconsPath,
       
   177                                  TInt aBitmapIndex,
       
   178                                  TInt aBitmapMaskIndex );
       
   179 
       
   180         /**
       
   181         * Handles volume repeat timer timout
       
   182         * @return TInt
       
   183         */
       
   184         static TInt HandleVolumeRepeatTimeoutL( TAny* aPtr );
       
   185 
       
   186         /**
       
   187         * Adjust volume(+1/-1) for media key
       
   188         * @return void
       
   189         */
       
   190         void HandleVolumeRepeatL();
       
   191 
       
   192         void CreateControlsL();
       
   193 
       
   194         /**
       
   195         * Handles rocker's middle key
       
   196         *
       
   197         * @param aKeyEvent The key event.
       
   198         * @param aType The type of key event.
       
   199         */
       
   200         void HandleRockerMiddleKeyL(const TKeyEvent& aKeyEvent,
       
   201                                    TEventCode aType);
       
   202 
       
   203         /**
       
   204         * Handles rocker's up key
       
   205         *
       
   206         * @param aType The type of key event.
       
   207         */
       
   208         void HandleSeekFwdL(TEventCode aType);
       
   209 
       
   210         /**
       
   211         * Handles rocker's down key
       
   212         *
       
   213         * @param aType The type of key event.
       
   214         */
       
   215         void HandleSeekBackL(TEventCode aType);
       
   216 
       
   217 
       
   218     protected:   // data
       
   219         CMPXVideoBasePlaybackView*              iView;
       
   220         CMPXVideoPlaybackControlsController*    iControlsController;
       
   221 
       
   222         //
       
   223         //  Bitmaps are owned by the Controls Controller
       
   224         //
       
   225         CEikImage*                              iRealOneBitmap;
       
   226 
       
   227         TBool                                   iVolumeRepeatUp;
       
   228         TBool                                   iSurfaceCreated;
       
   229         TBool                                   iTvOutConnected;
       
   230 
       
   231         CMPXVideoPlaybackViewFileDetails*       iFileDetails;
       
   232         TKeyResponse                            iKeyResponse;
       
   233 
       
   234         CMPXVideoPlaybackUserInputHandler*      iUserInputHandler;  // owned
       
   235 };
       
   236 
       
   237 #endif  // __CMPXVIDEOPLAYBACKCONTAINER_H__
       
   238 
       
   239 // End of File