inc/mpcollectiontbonelistdatamodel.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 00:14:19 +0300
changeset 61 3cd404d31176
parent 54 c5b304f4d89b
permissions -rw-r--r--
Revision: 201037 Kit: 201039

/*
* 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;
    void enablePlaybackIndicatorEnable(bool enable);

signals:

    void albumDataChanged();
    void albumDataAvailable();

public slots:

    void refreshModel();
    void updateSong();
    void updatePlaybackState();
    void fileCorrupted(int songId);
    

private:

    MpMpxCollectionData             *mCollectionData; // Not own
    MpPlaybackData                  *mPlaybackData;   // Not own
    int                             mRowCount;
    int                             mCurrentSongId;
    bool                            mPlaybackActive;
    bool                            mPlaybackIndicatorEnabled;

};

#endif // MPCOLLECTIONTBONELISTDATAMODEL_H