inc/mpcollectiontbonelistdatamodel.h
branchGCC_SURGE
changeset 44 eff9df3d9c98
parent 32 c163ef0b758d
child 51 560ce2306a17
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/mpcollectiontbonelistdatamodel.h	Thu Jul 22 16:32:33 2010 +0100
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Music Player collection abstract data model. This is
+*              primarily used to support TBone Mediawall in Collection View.
+*              This model represents the list containing album songs.
+*
+*/
+
+#ifndef MPCOLLECTIONTBONELISTDATAMODEL_H
+#define MPCOLLECTIONTBONELISTDATAMODEL_H
+
+#include <QAbstractListModel>
+
+class MpMpxCollectionData;
+class MpPlaybackData;
+
+#if defined(BUILD_MPDATA_LIB)
+#define MPDATA_EXPORT Q_DECL_EXPORT
+#else
+#define MPDATA_EXPORT Q_DECL_IMPORT
+#endif
+
+class MPDATA_EXPORT MpCollectionTBoneListDataModel : public QAbstractListModel
+{
+    Q_OBJECT
+
+public:
+
+    explicit MpCollectionTBoneListDataModel( MpMpxCollectionData *collectionData, 
+            MpPlaybackData *playbackData = 0, QObject *parent = 0 );
+    virtual ~MpCollectionTBoneListDataModel();
+
+    int rowCount(const QModelIndex &parent=QModelIndex()) const;
+    QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
+
+signals:
+
+    void albumDataChanged();
+    void albumDataAvailable();
+
+public slots:
+
+    void refreshModel();
+    void updateSong();
+    void updatePlaybackState();
+
+private:
+
+    MpMpxCollectionData             *mCollectionData; // Not own
+    MpPlaybackData                  *mPlaybackData;   // Not own
+    int                             mRowCount;
+    int                             mCurrentSongId;
+    bool                            mPlaybackActive;
+
+};
+
+#endif // MPCOLLECTIONTBONELISTDATAMODEL_H
+