2010-10-29 20:41:49 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-10-29 20:41:49 +02:00
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SMARTPLAYLISTSEARCHPREVIEW_H
|
|
|
|
#define SMARTPLAYLISTSEARCHPREVIEW_H
|
|
|
|
|
2010-11-18 21:19:33 +01:00
|
|
|
#include "search.h"
|
2010-12-19 15:37:25 +01:00
|
|
|
#include "smartplaylists/generator_fwd.h"
|
2010-10-29 20:41:49 +02:00
|
|
|
|
2015-11-27 15:22:59 +01:00
|
|
|
#include <QFuture>
|
2010-10-29 20:41:49 +02:00
|
|
|
#include <QWidget>
|
|
|
|
|
2012-05-30 12:06:25 +02:00
|
|
|
class Application;
|
2010-10-29 20:41:49 +02:00
|
|
|
class LibraryBackend;
|
2010-10-29 20:58:43 +02:00
|
|
|
class Playlist;
|
2010-10-29 20:41:49 +02:00
|
|
|
class Ui_SmartPlaylistSearchPreview;
|
|
|
|
|
2010-11-18 21:19:33 +01:00
|
|
|
namespace smart_playlists {
|
|
|
|
|
|
|
|
class SearchPreview : public QWidget {
|
2010-10-29 20:41:49 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2014-02-10 16:03:54 +01:00
|
|
|
SearchPreview(QWidget* parent = nullptr);
|
2010-11-18 21:19:33 +01:00
|
|
|
~SearchPreview();
|
2010-10-29 20:41:49 +02:00
|
|
|
|
2012-05-30 12:06:25 +02:00
|
|
|
void set_application(Application* app);
|
2010-10-29 20:41:49 +02:00
|
|
|
void set_library(LibraryBackend* backend);
|
|
|
|
|
2010-11-18 21:19:33 +01:00
|
|
|
void Update(const Search& search);
|
2010-10-29 20:41:49 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
protected:
|
2010-11-20 13:33:21 +01:00
|
|
|
void showEvent(QShowEvent*);
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2010-11-18 21:19:33 +01:00
|
|
|
void RunSearch(const Search& search);
|
2010-10-29 20:41:49 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private slots:
|
2015-11-27 15:22:59 +01:00
|
|
|
void SearchFinished(QFuture<PlaylistItemList> future);
|
2010-10-29 20:41:49 +02:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2010-10-29 20:41:49 +02:00
|
|
|
Ui_SmartPlaylistSearchPreview* ui_;
|
2010-11-18 21:19:33 +01:00
|
|
|
QList<SearchTerm::Field> fields_;
|
2010-10-29 20:41:49 +02:00
|
|
|
|
|
|
|
LibraryBackend* backend_;
|
2010-10-29 20:58:43 +02:00
|
|
|
Playlist* model_;
|
2010-10-29 20:41:49 +02:00
|
|
|
|
2010-11-18 21:19:33 +01:00
|
|
|
Search pending_search_;
|
2010-11-20 13:20:26 +01:00
|
|
|
Search last_search_;
|
2010-12-19 15:37:25 +01:00
|
|
|
GeneratorPtr generator_;
|
2010-10-29 20:41:49 +02:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
} // namespace
|
2010-11-18 21:19:33 +01:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // SMARTPLAYLISTSEARCHPREVIEW_H
|