inc/mpcollectiontbonelistdatamodel.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:36:36 +0300
changeset 32 c163ef0b758d
parent 29 8192e5b5c935
child 51 560ce2306a17
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* 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