|
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. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MPCOLLECTIONDATAMODEL_H |
|
19 #define MPCOLLECTIONDATAMODEL_H |
|
20 |
|
21 #include <QAbstractListModel> |
|
22 |
|
23 class MpMpxCollectionData; |
|
24 class MpCollectionAlbumArtManager; |
|
25 |
|
26 #if defined(BUILD_MPDATA_LIB) |
|
27 #define MPDATA_EXPORT Q_DECL_EXPORT |
|
28 #else |
|
29 #define MPDATA_EXPORT Q_DECL_IMPORT |
|
30 #endif |
|
31 |
|
32 class MPDATA_EXPORT MpCollectionDataModel : public QAbstractListModel |
|
33 { |
|
34 Q_OBJECT |
|
35 |
|
36 public: |
|
37 |
|
38 explicit MpCollectionDataModel( MpMpxCollectionData *data, QObject *parent=0 ); |
|
39 virtual ~MpCollectionDataModel(); |
|
40 |
|
41 int rowCount(const QModelIndex &parent=QModelIndex()) const; |
|
42 QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const; |
|
43 Qt::DropActions supportedDropActions() const; |
|
44 bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); |
|
45 QStringList mimeTypes() const; |
|
46 QMimeData *mimeData(const QModelIndexList &indexes) const; |
|
47 bool dropMimeData(const QMimeData *data, Qt::DropAction action, |
|
48 int row, int column, const QModelIndex &parent); |
|
49 |
|
50 MpMpxCollectionData *collectionData(); |
|
51 |
|
52 signals: |
|
53 void orderChanged( int containerId, int itemId, int itemOrdinal, int newOrdinal ); |
|
54 |
|
55 public slots: |
|
56 |
|
57 void updateAlbumArt( int index ); |
|
58 void refreshModel(); |
|
59 |
|
60 private: |
|
61 |
|
62 MpMpxCollectionData *mCollectionData; |
|
63 MpCollectionAlbumArtManager *mAlbumArtManager; // Own |
|
64 int mRowCount; |
|
65 |
|
66 }; |
|
67 |
|
68 #endif // MPCOLLECTIONDATAMODEL_H |
|
69 |