mpviewplugins/mpcollectionviewplugin/inc/mpcollectionalbumartmanager.h
changeset 19 4e84c994a771
child 20 82baf59ce8dd
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: Music Player collection album art manager.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPCOLLECTIONALBUMARTMANAGER_H
       
    20 #define MPCOLLECTIONALBUMARTMANAGER_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 
       
    30 class ThumbnailManager;
       
    31 
       
    32 class MpCollectionAlbumArtManager : public QObject
       
    33 {
       
    34     Q_OBJECT
       
    35 
       
    36 public:
       
    37 
       
    38     explicit MpCollectionAlbumArtManager( QObject *parent=0 );
       
    39     virtual ~MpCollectionAlbumArtManager();
       
    40 
       
    41     HbIcon albumArt( const QString &albumArtUri, int index );
       
    42     bool cacheAlbumArt( const QStringList albumArtList );
       
    43     void cancel();
       
    44 
       
    45 signals:
       
    46 
       
    47     void albumArtReady( int index );
       
    48     void albumCacheReady();
       
    49 
       
    50 public slots:
       
    51 
       
    52     void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error );
       
    53 
       
    54 private:
       
    55 
       
    56     ThumbnailManager                *mThumbnailManager;
       
    57     QHash<QString, HbIcon>          mImageCache;
       
    58     QMap<int, QString>              mTnmReqMap;
       
    59     bool                            mCachingInProgress;
       
    60 
       
    61     QQueue< QPair<QString, int> >   mRequestQueue;
       
    62     int                             mRequestCount;
       
    63 };
       
    64 
       
    65 #endif // MPCOLLECTIONALBUMARTMANAGER_H
       
    66