![]() |
Mixxx
|
00001 // browsefeature.h 00002 // Created 9/8/2009 by RJ Ryan (rryan@mit.edu) 00003 00004 #ifndef BROWSEFEATURE_H 00005 #define BROWSEFEATURE_H 00006 00007 #include <QStringListModel> 00008 #include <QSortFilterProxyModel> 00009 00010 #include "configobject.h" 00011 #include "library/browse/browsetablemodel.h" 00012 #include "library/browse/foldertreemodel.h" 00013 #include "library/libraryfeature.h" 00014 #include "library/proxytrackmodel.h" 00015 00016 #define QUICK_LINK_NODE "::mixxx_quick_lnk_node::" 00017 #define DEVICE_NODE "::mixxx_device_node::" 00018 00019 class TrackCollection; 00020 00021 class BrowseFeature : public LibraryFeature { 00022 Q_OBJECT 00023 public: 00024 BrowseFeature(QObject* parent, 00025 ConfigObject<ConfigValue>* pConfig, 00026 TrackCollection* pTrackCollection, 00027 RecordingManager* pRec); 00028 virtual ~BrowseFeature(); 00029 00030 QVariant title(); 00031 QIcon getIcon(); 00032 00033 bool dropAccept(QUrl url); 00034 bool dropAcceptChild(const QModelIndex& index, QUrl url); 00035 bool dragMoveAccept(QUrl url); 00036 bool dragMoveAcceptChild(const QModelIndex& index, QUrl url); 00037 00038 TreeItemModel* getChildModel(); 00039 00040 public slots: 00041 void activate(); 00042 void activateChild(const QModelIndex& index); 00043 void onRightClick(const QPoint& globalPos); 00044 void onRightClickChild(const QPoint& globalPos, QModelIndex index); 00045 00046 void onLazyChildExpandation(const QModelIndex& index); 00047 00048 signals: 00049 void setRootIndex(const QModelIndex&); 00050 00051 private: 00052 ConfigObject<ConfigValue>* m_pConfig; 00053 BrowseTableModel m_browseModel; 00054 ProxyTrackModel m_proxyModel; 00055 TrackCollection* m_pTrackCollection; 00056 FolderTreeModel m_childModel; 00057 QString m_currentSearch; 00058 }; 00059 00060 #endif /* BROWSEFEATURE_H */