videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h
branchRCL_3
changeset 23 befca0ec475f
equal deleted inserted replaced
22:839377eedc2b 23:befca0ec475f
       
     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:  Media Details Viewer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // Version : %version:  7 %
       
    20 
       
    21 
       
    22 #ifndef MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_
       
    23 #define MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_
       
    24 
       
    25 //  INCLUDES
       
    26 #include <coecntrl.h>
       
    27 
       
    28 #include "mpxvideo_debug.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CEikLabel;
       
    32 class CMPXVideoPlaybackViewFileDetails;
       
    33 class CMPXVideoPlaybackControlsController;
       
    34 
       
    35 #ifdef RD_TACTILE_FEEDBACK
       
    36 class MTouchFeedback;
       
    37 #endif //RD_TACTILE_FEEDBACK
       
    38 
       
    39 class CMPXVideoPlaybackMediaDetailsViewer : public CCoeControl
       
    40 {
       
    41     public:
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         */
       
    45         static CMPXVideoPlaybackMediaDetailsViewer* NewL( CMPXVideoPlaybackControlsController* aController);
       
    46 
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         virtual ~CMPXVideoPlaybackMediaDetailsViewer();
       
    51 
       
    52     private:
       
    53 
       
    54         /**
       
    55         * C++ default constructor.
       
    56         */
       
    57         CMPXVideoPlaybackMediaDetailsViewer( CMPXVideoPlaybackControlsController* aController );
       
    58 
       
    59         /**
       
    60          * By default Symbian 2nd phase constructor is private.
       
    61          */
       
    62         void ConstructL();
       
    63 
       
    64     private:
       
    65 
       
    66         /**
       
    67         * From CoeControl,CountComponentControls.
       
    68         * @return Number of contained component controls.
       
    69         */
       
    70         TInt CountComponentControls() const;
       
    71 
       
    72         /**
       
    73         * From CCoeControl,ComponentControl.
       
    74         * @param aIndex index of a contained component control.
       
    75         */
       
    76         CCoeControl* ComponentControl( TInt aIndex ) const;
       
    77 
       
    78         /**
       
    79         * From CCoeControl,Draw.
       
    80         * @param aRect drawable area.
       
    81         */
       
    82         void Draw( const TRect& aRect ) const;
       
    83 
       
    84         /**
       
    85         * Creates new skins for the control
       
    86         * @return void
       
    87         */
       
    88         void SkinChangeL();
       
    89 
       
    90 
       
    91     public: // from CoeControl
       
    92 
       
    93         /**
       
    94         * From CoeControl,OfferKeyEventL
       
    95         */
       
    96         void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
    97 
       
    98     public:
       
    99 
       
   100         /*
       
   101          *  Bring the button bar to its original state
       
   102          *  @since 5.0
       
   103          */
       
   104         void Reset();
       
   105 
       
   106         /**
       
   107         * Accessor for the dynamically calculated viewer rect
       
   108         * @since 9.2
       
   109         * @return the viewer rect
       
   110         */
       
   111         TRect ViewerRect();
       
   112 
       
   113 
       
   114     private:
       
   115 
       
   116         void CreateLabelsL();
       
   117 
       
   118         void LaunchDRMDetailsL();
       
   119 
       
   120         /**
       
   121         * Sets label rects and text
       
   122         */
       
   123         void FormatLabelsL() const;
       
   124 
       
   125         void UpdateBackgroundBitmapL() const;
       
   126 
       
   127         /**
       
   128         * Timer callback for scroll timer
       
   129         * @since 9.2
       
   130         * @param aPtr Pointer to timers callback
       
   131         * @return KErrNone
       
   132         */
       
   133         static TInt ScrollTimer( TAny* aPtr );
       
   134 
       
   135         /**
       
   136         * Handle Scroll Timer
       
   137         * @since 9.2
       
   138         * @return void
       
   139         */
       
   140         void HandleScrollTimerL();
       
   141 
       
   142         /**
       
   143         * Determine the number of items to be shown in the viewer
       
   144         * @since 9.2
       
   145         * @return the number of rows to be created
       
   146         */
       
   147         TInt NumOfItemsShownInViewerL();
       
   148 
       
   149         /**
       
   150         * Dynamically calculate determine the viewer rectangle dyanmically
       
   151         * @since 9.2
       
   152         * @return the viewer rect
       
   153         */
       
   154         TRect CalculateViewerRectL();
       
   155 
       
   156         /**
       
   157          * Update the text of filename label
       
   158          */
       
   159         void UpdateFilenameL();
       
   160 
       
   161         /**
       
   162          * Update the text of title label
       
   163          */
       
   164         void UpdateTitleL();
       
   165 
       
   166     private:
       
   167 
       
   168         /**
       
   169          * Scroll the too long text for some label
       
   170          */
       
   171         class TTextScroller
       
   172         {
       
   173             public:
       
   174 
       
   175                 /**
       
   176                  * Constructor
       
   177                  */
       
   178                 TTextScroller();
       
   179 
       
   180                 /**
       
   181                  * Check if the source text needs scrolling.
       
   182                  */
       
   183                 TBool IsScrollNeeded();
       
   184 
       
   185                 /**
       
   186                  * Check if the text of a label needs to be updated
       
   187                  */
       
   188                 TBool IsUpdateNeeded();
       
   189 
       
   190                 /**
       
   191                  * Scroll the source text, and append it to the destination text
       
   192                  *
       
   193                  * @param aSrcText the source text to be scrolled.
       
   194                  * @param aDesText to which the scrolled text to be appended
       
   195                  */
       
   196                 void ScrollText( const TDesC& aSrcText, TDes& aDesText );
       
   197 
       
   198             private:
       
   199 
       
   200                 TUint32        iDelayBeginningTick;
       
   201                 TInt           iTextScrollPos;
       
   202                 TBool          iDelay;
       
   203                 TBool          iScroll;
       
   204                 TInt           iSrcTextLen;
       
   205         };
       
   206 
       
   207     private:    // Data
       
   208 
       
   209         CMPXVideoPlaybackControlsController* iController;
       
   210 
       
   211         CEikLabel*                           iClipnameLabel;
       
   212         CEikLabel*                           iTitleLabel;
       
   213         CEikLabel*                           iArtistLabel;
       
   214         CEikLabel*                           iFormatLabel;
       
   215         CEikLabel*                           iResolutionLabel;
       
   216         CEikLabel*                           iDurationLabel;
       
   217         CEikLabel*                           iBitrateLabel;
       
   218         CEikLabel*                           iLicenseLabel;
       
   219         CEikLabel*                           iAdditionalLabel;
       
   220 
       
   221 
       
   222         CFbsBitmap*                          iBackgroundBitmap;
       
   223         CPeriodic*                           iScrollingTextTimer;
       
   224         TRect                                iViewerRect;
       
   225         HBufC*                               iAdditionalString;
       
   226         TTextScroller                        iFilenameScroller;
       
   227         TTextScroller                        iTitleScroller;
       
   228         // after every scrolling label has updated, draw them
       
   229         TBool                                iScrolledTextUpdated;
       
   230         TBool                                iDrmDetailsLaunched;
       
   231 };
       
   232 
       
   233 
       
   234 
       
   235 #endif /* MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_ */