ganeswidgets/tsrc/fute/HgWidgetTest/inc/hgwidgettestalbumartmanager.h
changeset 0 89c329efa980
child 6 1cdcc61142d2
equal deleted inserted replaced
-1:000000000000 0:89c329efa980
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HGWIDGETTESTALBUMARTMANAGER_H
       
    20 #define HGWIDGETTESTALBUMARTMANAGER_H
       
    21 
       
    22 #include <QObject>
       
    23 #include <QHash>
       
    24 #include <QMap>
       
    25 #include <QQueue>
       
    26 #include <QPair>
       
    27 #include <QBitmap>
       
    28 #include <hbicon.h>
       
    29 #include <thumbnailmanager_qt.h>
       
    30 
       
    31 class HgWidgetTestAlbumArtManager : public QObject
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35 public:
       
    36 
       
    37     explicit HgWidgetTestAlbumArtManager(QObject *parent=0);
       
    38     virtual ~HgWidgetTestAlbumArtManager();
       
    39 
       
    40     void setThumbnailSize(ThumbnailManager::ThumbnailSize size);
       
    41 
       
    42     QImage albumArt( const QString &albumArtUri, int index );
       
    43     bool cacheAlbumArt( const QStringList albumArtList );
       
    44     void cancel();
       
    45 
       
    46 signals:
       
    47 
       
    48     void albumArtReady( int index );
       
    49     void albumCacheReady();
       
    50 
       
    51 public slots:
       
    52 
       
    53     void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
       
    54     void thumbnailReady( const QImage& image, void* data, int id, int error );
       
    55     void executeNext();
       
    56 
       
    57 private:
       
    58 
       
    59     void applyMask( QPixmap &pixmap );
       
    60 
       
    61 private:
       
    62 
       
    63     ThumbnailManager                *mThumbnailManager;
       
    64     QHash<QString, QImage>          mImageCache;
       
    65     QMap<int, QString>              mTnmReqMap;
       
    66     bool                            mCachingInProgress;
       
    67 
       
    68     QQueue< QPair<QString, int> >   mRequestQueue;
       
    69     int                             mRequestCount;
       
    70     QBitmap                         mMask;
       
    71 
       
    72 };
       
    73 
       
    74 #endif // HGWIDGETTESTALBUMARTMANAGER_H
       
    75