mpxplugins/viewplugins/views/inc/mpxplaybackviewinfolabel.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Text label for Common Playback view.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMPXPLAYBACKVIEWINFOLABEL_H
       
    21 #define CMPXPLAYBACKVIEWINFOLABEL_H
       
    22 
       
    23 
       
    24 //  INCLUDES
       
    25 #include <eiklabel.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MAknsControlContext;
       
    30 class CAknMarqueeControl;
       
    31 
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  *  Text label for Playback View. Otherwise similar to CEikLabel, but also 
       
    37  *  handles background bitmap drawing and marquee scrolling.
       
    38  *
       
    39  *  @lib mpxplaybackview.lib
       
    40  *  @since S60 v3.0
       
    41  */
       
    42 NONSHARABLE_CLASS( CMPXPlaybackViewInfoLabel ) : public CEikLabel
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * C++ constructor.
       
    48      */
       
    49     CMPXPlaybackViewInfoLabel();
       
    50     
       
    51     /**
       
    52      * Symbian 2nd phase constructor
       
    53      *
       
    54      * @param aEnableMarqueeSupport If true, CAknMarqueeControl is also
       
    55      *                              created to support marquee.
       
    56      */
       
    57     void ConstructL( TBool aEnableMarqueeSupport );
       
    58     
       
    59     /**
       
    60      * Destructor
       
    61      */
       
    62     virtual ~CMPXPlaybackViewInfoLabel();
       
    63     
       
    64     /**
       
    65      * Set background bitmap
       
    66      *
       
    67      * @since S60 3.0
       
    68      * @param aBackground       Pointer to the skin background control
       
    69      *                          context. Ownership not transferred.
       
    70      */
       
    71     void SetBackground( MAknsControlContext* aBackground );
       
    72 
       
    73     /**
       
    74      * Redraw rectangle
       
    75      *
       
    76      * @since S60 3.0
       
    77      * @param aRect Dirty rectangle. Drawing can be clipped to this
       
    78      *              rectangle
       
    79      */
       
    80     void RedrawRect( const TRect& aRect ) const;
       
    81 
       
    82     /**
       
    83      * Start marquee scrolling if supported and needed.
       
    84      *
       
    85      * @since S60 3.0
       
    86      */
       
    87     void StartMarquee();
       
    88 
       
    89     /**
       
    90      * Stop marquee scrolling.
       
    91      *
       
    92      * @since S60 3.0
       
    93      */
       
    94     void StopMarquee();
       
    95 
       
    96     /**
       
    97      * Get the full unclipped text for the label
       
    98      *
       
    99      * @since S60 3.0
       
   100      * @return Reference to label text. Must not be stored. 
       
   101      */
       
   102     const TDesC& FullText() const;
       
   103 
       
   104     /**
       
   105      * Set label text and clip if necessary.
       
   106      *
       
   107      * @since S60 3.0
       
   108      * @param aText Text for the label
       
   109      */
       
   110     void SetLabelTextL( const TDesC& aText );
       
   111 
       
   112 private:
       
   113 
       
   114     /**
       
   115      * Check if scrolling is needed.
       
   116      *
       
   117      * @return ETrue if marquee is necessary (ie. text length is larger
       
   118      *               that what can be visible at one time.
       
   119      */
       
   120     TBool NeedToScroll() const;
       
   121 
       
   122     /**
       
   123      *  Redraw callback for marquee control
       
   124      */
       
   125     static TInt RedrawCallback( TAny* aPtr );
       
   126 
       
   127 // from base class CCoeControl
       
   128 
       
   129     /**
       
   130      * From CCoeControl.
       
   131      * Draws the control.
       
   132      *
       
   133      * @param aRect The rectangular region of the control to be drawn.
       
   134      */
       
   135     void Draw( const TRect& aRect ) const;
       
   136 
       
   137     /**
       
   138      * From CCoeControl.
       
   139      * Gets the number of controls contained in a compound control.
       
   140      *
       
   141      * @return The number of component controls contained by this control.
       
   142      */
       
   143     TInt CountComponentControls() const;
       
   144 
       
   145     /**
       
   146      * From CCoeControl.
       
   147      * Gets an indexed component of a compound control.
       
   148      *
       
   149      * @param aIndex The index of the control.
       
   150      * @return The component control with an index of aIndex.
       
   151      */
       
   152     CCoeControl* ComponentControl( TInt aIndex ) const;
       
   153 
       
   154 private:    // Data
       
   155 
       
   156     MAknsControlContext* iBackground; // not owned
       
   157     CAknMarqueeControl* iMarquee; // owned
       
   158     HBufC* iFullText; // owned
       
   159     };
       
   160 
       
   161 #endif  // CMPXPLAYBACKVIEWINFOLABEL_H
       
   162 
       
   163 // End of File