35
|
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 abstract data model. This is
|
|
15 |
* primarily used to support TBone Mediawall in Collection View.
|
|
16 |
* This model represents the list containing album songs.
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
#ifndef MPCOLLECTIONTBONELISTDATAMODEL_H
|
|
21 |
#define MPCOLLECTIONTBONELISTDATAMODEL_H
|
|
22 |
|
|
23 |
#include <QAbstractListModel>
|
|
24 |
|
|
25 |
class MpMpxCollectionData;
|
36
|
26 |
class MpPlaybackData;
|
35
|
27 |
|
|
28 |
#if defined(BUILD_MPDATA_LIB)
|
|
29 |
#define MPDATA_EXPORT Q_DECL_EXPORT
|
|
30 |
#else
|
|
31 |
#define MPDATA_EXPORT Q_DECL_IMPORT
|
|
32 |
#endif
|
|
33 |
|
|
34 |
class MPDATA_EXPORT MpCollectionTBoneListDataModel : public QAbstractListModel
|
|
35 |
{
|
|
36 |
Q_OBJECT
|
|
37 |
|
|
38 |
public:
|
|
39 |
|
36
|
40 |
explicit MpCollectionTBoneListDataModel( MpMpxCollectionData *collectionData,
|
|
41 |
MpPlaybackData *playbackData = 0, QObject *parent = 0 );
|
35
|
42 |
virtual ~MpCollectionTBoneListDataModel();
|
|
43 |
|
|
44 |
int rowCount(const QModelIndex &parent=QModelIndex()) const;
|
|
45 |
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
|
|
46 |
|
|
47 |
signals:
|
|
48 |
|
|
49 |
void albumDataChanged();
|
36
|
50 |
void albumDataAvailable();
|
35
|
51 |
|
|
52 |
public slots:
|
|
53 |
|
|
54 |
void refreshModel();
|
36
|
55 |
void updateSong();
|
|
56 |
void updatePlaybackState();
|
35
|
57 |
|
|
58 |
private:
|
|
59 |
|
36
|
60 |
MpMpxCollectionData *mCollectionData; // Not own
|
|
61 |
MpPlaybackData *mPlaybackData; // Not own
|
35
|
62 |
int mRowCount;
|
36
|
63 |
int mCurrentSongId;
|
|
64 |
bool mPlaybackActive;
|
35
|
65 |
|
|
66 |
};
|
|
67 |
|
|
68 |
#endif // MPCOLLECTIONTBONELISTDATAMODEL_H
|
|
69 |
|