qtinternetradio/ui/inc/irhistorymodel.h
changeset 0 09774dfdd46b
child 17 38bbf2dcd608
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     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 #ifndef IRHISTORYMODEL_H_
       
    18 #define IRHISTORYMODEL_H_
       
    19 
       
    20 #include <QAbstractItemModel>
       
    21 
       
    22 class IRQSongHistoryEngine;
       
    23 class IRQSongHistoryInfo;
       
    24 class HbIcon;
       
    25 
       
    26 class IRHistoryModel : public QAbstractListModel
       
    27 {
       
    28 Q_OBJECT
       
    29 public:
       
    30     explicit IRHistoryModel(QObject *aParent = NULL);
       
    31     ~IRHistoryModel();
       
    32     
       
    33     int rowCount(const QModelIndex &aParent = QModelIndex()) const;
       
    34     QVariant data(const QModelIndex &aIndex, int aRole = Qt::DisplayRole) const;
       
    35     
       
    36     IRQSongHistoryInfo* getHistoryInfo(int aIndex);
       
    37     void clearAllList();
       
    38     bool checkHistoryUpdate();
       
    39     void clearAndDestroyLogos();
       
    40     QString getImageUrl(int aRow) const;
       
    41     void setLogo(HbIcon *aIcon, int aIndex);
       
    42     bool deleteOneItem(int aIndex);
       
    43     
       
    44 signals:
       
    45     void modelChanged();   
       
    46 
       
    47 private:
       
    48     void getAllList();
       
    49 
       
    50 private:
       
    51     QList<IRQSongHistoryInfo *> iHistoryList;
       
    52     IRQSongHistoryEngine *iHistoryEngine;
       
    53     QMap<int, HbIcon*>     iLogos;
       
    54     HbIcon *iStationLogo;
       
    55 };
       
    56 
       
    57 #endif /* IRHISTORYMODEL_H_ */