inc/mpalbumcoverwidget.h
changeset 43 0f32e550d9d8
equal deleted inserted replaced
38:b93f525c9244 43:0f32e550d9d8
       
     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:  Album Cover Widget for Music Player Media Wall.
       
    15 *
       
    16 */
       
    17 #ifndef MPALBUMCOVERWIDGET_H
       
    18 #define MPALBUMCOVERWIDGET_H
       
    19 
       
    20 #include <QPixmap>
       
    21 #include <QGesture>
       
    22 
       
    23 #include <hbwidget.h>
       
    24 #include <hbicon.h>
       
    25 
       
    26 #ifdef BUILD_MPALBUMCOVERWIDGET
       
    27 #define MPALBUMCOVERWIDGET_EXPORT Q_DECL_EXPORT
       
    28 #else
       
    29 #define MPALBUMCOVERWIDGET_EXPORT Q_DECL_IMPORT
       
    30 #endif
       
    31 
       
    32 class MPALBUMCOVERWIDGET_EXPORT MpAlbumCoverWidget : public HbWidget
       
    33 
       
    34 {
       
    35     Q_OBJECT
       
    36 
       
    37 public:
       
    38 
       
    39     MpAlbumCoverWidget( QGraphicsItem *parent = 0 );
       
    40     virtual ~MpAlbumCoverWidget();
       
    41     void setIcon(const HbIcon &icon );
       
    42     void setDefaultIcon( const HbIcon &icon );
       
    43     void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, 
       
    44                 QWidget *widget = 0 );
       
    45     void gestureEvent(QGestureEvent *event);
       
    46 
       
    47 signals:
       
    48 
       
    49     void clicked();
       
    50     
       
    51 private:
       
    52 
       
    53     void mousePressEvent( QGraphicsSceneMouseEvent *event );
       
    54     void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
       
    55     
       
    56 private:
       
    57     
       
    58     HbIcon    mIcon;
       
    59     HbIcon    mDefaultIcon;
       
    60     QPixmap   mPixmap;
       
    61 };
       
    62 
       
    63 
       
    64 #endif //MPALBUMCOVERWIDGET_H
       
    65 
       
    66 // EOF