| 1 | /* |
| 2 | Copyright (C) 2005-2014 Mario Stephan <[email protected]> |
| 3 | |
| 4 | This library is free software; you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as published |
| 6 | by the Free Software Foundation; either version 2.1 of the License, or |
| 7 | (at your option) any later version. |
| 8 | |
| 9 | This program is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | GNU General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Lesser General Public License |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #ifndef COLLECTIONWIDGET_H |
| 19 | #define COLLECTIONWIDGET_H |
| 20 | |
| 21 | #include "collectiondb.h" |
| 22 | #include "collectiontree.h" |
| 23 | #include "modeselector.h" |
| 24 | #include "playlist.h" |
| 25 | #include "progressbar.h" |
| 26 | |
| 27 | |
| 28 | #include <QtGui> |
| 29 | #include <QPixmap> |
| 30 | #include <QDropEvent> |
| 31 | #include <QTimerEvent> |
| 32 | #include <QLineEdit> |
| 33 | |
| 34 | //class CollectionUpdater; |
| 35 | class QCustomEvent; |
| 36 | class QPixmap; |
| 37 | class QPoint; |
| 38 | class QPushButton; |
| 39 | |
| 40 | |
| 41 | class SearchEdit: public QLineEdit{ |
| 42 | Q_OBJECT |
| 43 | public: |
| 44 | SearchEdit( QWidget* parent=0); |
| 45 | ~SearchEdit(); |
| 46 | void dropEvent(QDropEvent* event); |
| 47 | void dragEnterEvent(QDragEnterEvent*); |
| 48 | signals: |
| 49 | void trackDropped(QString); |
| 50 | |
| 51 | protected: |
| 52 | void resizeEvent(QResizeEvent *); |
| 53 | void keyPressEvent (QKeyEvent* e); |
| 54 | |
| 55 | private slots: |
| 56 | void updateCloseButton(const QString &text); |
| 57 | |
| 58 | private: |
| 59 | QToolButton *clearButton; |
| 60 | }; |
| 61 | |
| 62 | class CollectionWidget: public QWidget |
| 63 | { |
| 64 | Q_OBJECT |
| 65 | |
| 66 | public: |
| 67 | CollectionWidget( QWidget* parent ); |
| 68 | ~CollectionWidget(); |
| 69 | Track* getRandomSong(QString genre); |
| 70 | QString filterText(); |
| 71 | bool hasItems(); |
| 72 | void setTracklist(Playlist* pl); |
| 73 | |
| 74 | public slots: |
| 75 | void setFilterText( QString strFilter ); |
| 76 | void loadSettings(); |
| 77 | void scan(); |
| 78 | |
| 79 | signals: |
| 80 | void trackDropped(QString); |
| 81 | void randomClicked(); |
| 82 | void selectionChanged(QList<Track*>); |
| 83 | void wantLoad (QList<Track*>,QString); |
| 84 | void filterChanged(QString); |
| 85 | void setupDirs(); |
| 86 | |
| 87 | |
| 88 | private slots: |
| 89 | void onSetFilterTimeout(); |
| 90 | void onSetClicked(); |
| 91 | void onSetFilter(); |
| 92 | void onModeSelected(ModeSelector::modeType value); |
| 93 | |
| 94 | private: |
| 95 | |
| 96 | void resizeEvent(QResizeEvent *); |
| 97 | class CollectionWidgetPrivate *p; |
| 98 | |
| 99 | }; |
| 100 | |
| 101 | |
| 102 | #endif /* COLLECTIONWIDGET_H */ |