mpviewplugins/mpmediawallviewplugin/src/mpalbumcoverwidget.cpp
changeset 37 eb79a7c355bf
parent 35 fdb31ab341af
--- a/mpviewplugins/mpmediawallviewplugin/src/mpalbumcoverwidget.cpp	Fri May 28 19:46:01 2010 -0500
+++ b/mpviewplugins/mpmediawallviewplugin/src/mpalbumcoverwidget.cpp	Fri Jun 11 19:36:32 2010 -0500
@@ -17,19 +17,42 @@
 #include <QPainter>
 #include <QGraphicsSceneMouseEvent>
 
-#include <hbinstantfeedback.h>
 
 #include "mpalbumcoverwidget.h"
+#include "mpreflectioneffect.h"
 
+/*!
+    \class MpAlbumCoverWidget
+    \brief Album Cover Widget.
+
+    This widget provides upscaled rendering of images and SVG rendering.
+    Also there is a reflection effect.
+*/
+
+/*!
+    \fn void clicked( )
+
+    This signal is emitted when the item is clicked.
+ */
 
 /*!
     Constructs the album cover widget
  */
 MpAlbumCoverWidget::MpAlbumCoverWidget( QGraphicsItem *parent ) : 
-    QGraphicsWidget( parent )
+    HbWidget( parent )
 {
+    setFlag( QGraphicsItem::ItemHasNoContents, false );
     grabGesture(Qt::TapGesture);
-    grabGesture(Qt::SwipeGesture);
+        
+    MpReflectionEffect *effect = new MpReflectionEffect(this);
+    setGraphicsEffect(effect);
+}
+
+/*!
+ Destructs the album cover widget.
+ */
+MpAlbumCoverWidget::~MpAlbumCoverWidget()
+{
 }
 
 /*!
@@ -58,7 +81,6 @@
 {
     Q_UNUSED( widget )
     Q_UNUSED( option )
-    //TODO: add a function to set default album art ,and use default when qicon is NULL,
     if ( !mIcon.isNull() ) {
         if ( mPixmap.isNull() ) {
             mPixmap = mIcon.qicon().pixmap( size().toSize() );
@@ -79,7 +101,6 @@
 void MpAlbumCoverWidget::mousePressEvent( QGraphicsSceneMouseEvent *event )
 {
     if ( event->button() == Qt::LeftButton ) {
-        HbInstantFeedback::play( HbFeedback::Basic );
         event->accept();
     }
     else {
@@ -101,4 +122,15 @@
     }
 }
 
+/*!
+    \reimp
+ */
+void MpAlbumCoverWidget::gestureEvent(QGestureEvent *event)
+{
+    QGesture* gesture = event->gesture(Qt::TapGesture);
+    if (gesture) {
+         event->accept(Qt::TapGesture);
+    }    
+}
+
 //EOF