1
1
#ifndef PLAYLISTTABLEMODEL_H
2
2
#define PLAYLISTTABLEMODEL_H
5
#include <QItemDelegate>
8
4
#include "library/basesqltablemodel.h"
9
5
#include "library/dao/playlistdao.h"
10
#include "library/dao/trackdao.h"
11
#include "library/librarytablemodel.h"
13
class TrackCollection;
15
7
class PlaylistTableModel : public BaseSqlTableModel {
18
10
PlaylistTableModel(QObject* parent, TrackCollection* pTrackCollection,
19
QString settingsNamespace,bool showAll=false);
11
QString settingsNamespace, bool showAll=false);
20
12
virtual ~PlaylistTableModel();
21
void setPlaylist(int playlistId);
13
void setTableModel(int playlistId = -1);
22
15
int getPlaylist() const {
23
16
return m_iPlaylistId;
25
virtual TrackPointer getTrack(const QModelIndex& index) const;
27
virtual void search(const QString& searchText);
28
virtual bool isColumnInternal(int column);
29
virtual bool isColumnHiddenByDefault(int column);
30
virtual void removeTrack(const QModelIndex& index);
31
virtual void removeTracks(const QModelIndexList& indices);
32
virtual bool addTrack(const QModelIndex& index, QString location);
33
virtual bool appendTrack(int trackId);
19
bool isColumnInternal(int column);
20
bool isColumnHiddenByDefault(int column);
21
// This function should only be used by AUTODJ
22
void removeTrack(const QModelIndex& index);
23
void removeTracks(const QModelIndexList& indices);
34
24
// Adding multiple tracks at one to a playlist. Returns the number of
35
25
// successful additions.
36
virtual int addTracks(const QModelIndex& index, QList<QString> locations);
37
virtual void moveTrack(const QModelIndex& sourceIndex, const QModelIndex& destIndex);
38
virtual void shuffleTracks(const QModelIndex& shuffleStartIndex);
26
int addTracks(const QModelIndex& index, QList<QString> locations);
27
bool appendTrack(int trackId);
28
void moveTrack(const QModelIndex& sourceIndex,
29
const QModelIndex& destIndex);
30
void shuffleTracks(const QModelIndex& shuffleStartIndex);
40
31
TrackModel::CapabilitiesFlags getCapabilities() const;
43
void slotSearch(const QString& searchText);
46
void doSearch(const QString& searchText);
49
TrackCollection* m_pTrackCollection;
50
34
PlaylistDAO& m_playlistDao;