![]() |
Mixxx
|
00001 /*************************************************************************** 00002 promotracksfeature.cpp 00003 ------------------- 00004 begin : Jan 2010 00005 copyright : (C) 2010 Albert Santoni 00006 email : alberts@mixxx.org 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef PROMOTRACKSFEATURE_H 00019 #define PROMOTRACKSFEATURE_H 00020 00021 #include <QStringListModel> 00022 00023 #include "treeitemmodel.h" 00024 #include "trackinfoobject.h" 00025 #include "library/libraryfeature.h" 00026 #include "library/dao/playlistdao.h" 00027 #include "library/cratetablemodel.h" 00028 #include "configobject.h" 00029 00030 00031 class PlaylistTableModel; 00032 class ProxyTrackModel; 00033 class TrackCollection; 00034 class TrackInfoObject; 00035 class BundledSongsWebView; 00036 class FeaturedArtistsWebView; 00037 class SongDownloader; 00038 00039 class PromoTracksFeature : public LibraryFeature { 00040 Q_OBJECT 00041 public: 00042 PromoTracksFeature(QObject* parent, 00043 ConfigObject<ConfigValue>* pConfig, 00044 TrackCollection* pTrackCollection, 00045 bool firstRun); 00046 virtual ~PromoTracksFeature(); 00047 static bool isSupported(ConfigObject<ConfigValue>* config); 00048 QList<TrackPointer> getTracksToAutoLoad(); 00049 00050 QVariant title(); 00051 QIcon getIcon(); 00052 00053 bool dropAccept(QUrl url); 00054 bool dropAcceptChild(const QModelIndex& index, QUrl url); 00055 bool dragMoveAccept(QUrl url); 00056 bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); 00057 00058 void bindWidget(WLibrarySidebar* sidebarWidget, 00059 WLibrary* libraryWidget, 00060 MixxxKeyboard* keyboard); 00061 00062 TreeItemModel* getChildModel(); 00063 00064 public slots: 00065 void activate(); 00066 void activateChild(const QModelIndex& index); 00067 void onRightClick(const QPoint& globalPos); 00068 void onRightClickChild(const QPoint& globalPos, QModelIndex index); 00069 void onLazyChildExpandation(const QModelIndex& index); 00070 00071 private: 00072 ConfigObject<ConfigValue>* m_pConfig; 00073 TrackCollection* m_pTrackCollection; 00074 FeaturedArtistsWebView* m_pFeaturedArtistsView; 00075 BundledSongsWebView* m_pBundledSongsView; 00076 static QString m_sPromoLocalHTMLLocation; 00077 static QString m_sPromoRemoteHTMLLocation; 00078 QString m_sPromoAutoloadLocation; 00079 const static QString m_sFeaturedArtistsViewName; 00080 const static QString m_sBundledSongsViewName; 00081 const static QString m_sMyDownloadsViewName; 00082 TreeItemModel m_childModel; 00083 CrateTableModel m_downloadsTableModel; 00084 SongDownloader* m_pSongDownloader; 00085 bool m_bFirstRun; 00086 QList<TrackPointer> m_tracksToAutoLoad; 00087 }; 00088 00089 00090 #endif /* PROMOTRACKSFEATURE_H */