mpviewplugins/mpplaybackviewplugin/inc/mpplaybackwidget.h
changeset 19 4e84c994a771
child 22 ecf06a08d4d9
equal deleted inserted replaced
5:2a40e88564c8 19:4e84c994a771
       
     1 /*
       
     2 * Copyright (c) 2009 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: Playback widget for Music Player playback view.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPPLAYBACKWIDGET_H
       
    19 #define MPPLAYBACKWIDGET_H
       
    20 
       
    21 #include <hbwidget.h>
       
    22 
       
    23 class MpPlaybackData;
       
    24 
       
    25 class HbStackedLayout;
       
    26 class QString;
       
    27 class HbTextItem;
       
    28 class HbProgressSlider;
       
    29 class HbLabel;
       
    30 class HbIcon;
       
    31 class HbDocumentLoader;
       
    32 
       
    33 class MpPlaybackWidget : public HbWidget
       
    34 {
       
    35     Q_OBJECT
       
    36 
       
    37 public:
       
    38 
       
    39     MpPlaybackWidget( MpPlaybackData *data, QGraphicsItem *parent=0 );
       
    40     virtual ~MpPlaybackWidget();
       
    41 
       
    42 signals:
       
    43 
       
    44     void setPlaybackPosition( int value );
       
    45 
       
    46 public slots:
       
    47 
       
    48     void playbackInfoChanged();
       
    49     void durationChanged();
       
    50     void positionChanged();
       
    51     void albumArtChanged();
       
    52 
       
    53     bool loadLayout( Qt::Orientation orientation );
       
    54 
       
    55 private slots:
       
    56 
       
    57     void handleSliderPressed();
       
    58     void handleSliderReleased();
       
    59     void handleSliderMoved(int value);
       
    60 
       
    61 private:
       
    62 
       
    63     QString formatDuration( int seconds );
       
    64     void composeAlbumCover( QPixmap& albumart );
       
    65 
       
    66 private:
       
    67 
       
    68     MpPlaybackData          *mPlaybackData;     // Not own
       
    69     HbDocumentLoader        *mDocumentLoader;   // Own
       
    70 
       
    71     HbStackedLayout         *mLayout;           // Not own
       
    72     HbLabel                 *mSongTitle;        // Not own
       
    73     HbLabel                 *mArtistName;       // Not own
       
    74     HbLabel                 *mAlbumName;        // Not own
       
    75     HbLabel                 *mAlbumArt;         // Not own
       
    76     HbProgressSlider        *mProgressBar;      // Not own
       
    77 
       
    78     QPixmap                 mCompositePixmap;
       
    79 
       
    80     bool                    mProgreesBarDragging;
       
    81     int                     mDuration;
       
    82 
       
    83     Q_DISABLE_COPY(MpPlaybackWidget)
       
    84 };
       
    85 
       
    86 #endif  // MPPLAYBACKWIDGET_H