Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/library/playlistfeature.h

Go to the documentation of this file.
00001 // playlistfeature.h
00002 // Created 8/17/09 by RJ Ryan (rryan@mit.edu)
00003 
00004 #ifndef PLAYLISTFEATURE_H
00005 #define PLAYLISTFEATURE_H
00006 
00007 #include <QSqlTableModel>
00008 #include <QAction>
00009 #include <QList>
00010 
00011 #include "library/libraryfeature.h"
00012 #include "library/dao/playlistdao.h"
00013 #include "library/dao/trackdao.h"
00014 #include "treeitemmodel.h"
00015 #include "configobject.h"
00016 
00017 
00018 class PlaylistTableModel;
00019 class TrackCollection;
00020 
00021 class PlaylistFeature : public LibraryFeature {
00022     Q_OBJECT
00023 public:
00024     PlaylistFeature(QObject* parent, TrackCollection* pTrackCollection, ConfigObject<ConfigValue>* pConfig);
00025     virtual ~PlaylistFeature();
00026 
00027     QVariant title();
00028     QIcon getIcon();
00029 
00030     bool dropAccept(QUrl url);
00031     bool dropAcceptChild(const QModelIndex& index, QUrl url);
00032     bool dragMoveAccept(QUrl url);
00033     bool dragMoveAcceptChild(const QModelIndex& index, QUrl url);
00034 
00035     TreeItemModel* getChildModel();
00036 
00037     void bindWidget(WLibrarySidebar* sidebarWidget,
00038                     WLibrary* libraryWidget,
00039                     MixxxKeyboard* keyboard);
00040   signals:
00041     void showPage(const QUrl& page);
00042 
00043 public slots:
00044     void activate();
00045     void activateChild(const QModelIndex& index);
00046     void onRightClick(const QPoint& globalPos);
00047     void onRightClickChild(const QPoint& globalPos, QModelIndex index);
00048     void onLazyChildExpandation(const QModelIndex& index);
00049 
00050     void slotCreatePlaylist();
00051     void slotDeletePlaylist();
00052     void slotAddToAutoDJ();
00053     void slotRenamePlaylist();
00054     void slotTogglePlaylistLock();
00055     void slotImportPlaylist();
00056     void slotExportPlaylist();
00057 
00058 
00059  private:
00060     void constructChildModel();
00061     void clearChildModel();
00062 
00063     TrackCollection* m_pTrackCollection;
00064     PlaylistTableModel* m_pPlaylistTableModel;
00065     PlaylistDAO &m_playlistDao;
00066     TrackDAO &m_trackDao;
00067     QAction *m_pCreatePlaylistAction;
00068     QAction *m_pDeletePlaylistAction;
00069     QAction *m_pAddToAutoDJAction;
00070     QAction *m_pRenamePlaylistAction;
00071     QAction *m_pLockPlaylistAction;
00072     QAction *m_pImportPlaylistAction;
00073     QAction *m_pExportPlaylistAction;
00074     QSqlTableModel m_playlistTableModel;
00075     QModelIndex m_lastRightClickedIndex;
00076     TreeItemModel m_childModel;
00077     ConfigObject<ConfigValue>* m_pConfig;
00078 };
00079 
00080 #endif /* PLAYLISTFEATURE_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines