2010-11-18 22:13:43 +01:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-11-18 22:13:43 +01: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 QUERYWIZARDPLUGIN_H
|
|
|
|
#define QUERYWIZARDPLUGIN_H
|
|
|
|
|
|
|
|
#include <QWizard>
|
2020-09-18 16:15:19 +02:00
|
|
|
#include <memory>
|
2010-11-18 22:13:43 +01:00
|
|
|
|
2014-02-06 14:48:00 +01:00
|
|
|
#include "search.h"
|
2020-09-18 16:15:19 +02:00
|
|
|
#include "wizardplugin.h"
|
2010-11-18 22:13:43 +01:00
|
|
|
|
|
|
|
class Ui_SmartPlaylistQuerySearchPage;
|
|
|
|
class Ui_SmartPlaylistQuerySortPage;
|
|
|
|
|
|
|
|
class QVBoxLayout;
|
|
|
|
|
|
|
|
namespace smart_playlists {
|
|
|
|
|
|
|
|
class SearchPreview;
|
|
|
|
class SearchTermWidget;
|
|
|
|
|
|
|
|
class QueryWizardPlugin : public WizardPlugin {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
public:
|
2012-05-30 12:06:25 +02:00
|
|
|
QueryWizardPlugin(Application* app, LibraryBackend* library, QObject* parent);
|
2010-11-18 22:13:43 +01:00
|
|
|
~QueryWizardPlugin();
|
|
|
|
|
2010-11-19 00:08:37 +01:00
|
|
|
QString type() const { return "Query"; }
|
2010-11-18 22:13:43 +01:00
|
|
|
QString name() const;
|
|
|
|
QString description() const;
|
2010-11-20 19:49:54 +01:00
|
|
|
bool is_dynamic() const { return true; }
|
2010-11-18 22:13:43 +01:00
|
|
|
|
2010-11-19 00:08:37 +01:00
|
|
|
int CreatePages(QWizard* wizard, int finish_page_id);
|
|
|
|
void SetGenerator(GeneratorPtr);
|
2010-11-18 22:13:43 +01:00
|
|
|
GeneratorPtr CreateGenerator() const;
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private slots:
|
2010-11-18 22:13:43 +01:00
|
|
|
void AddSearchTerm();
|
|
|
|
void RemoveSearchTerm();
|
|
|
|
|
|
|
|
void SearchTypeChanged();
|
|
|
|
|
|
|
|
void UpdateTermPreview();
|
|
|
|
void UpdateSortPreview();
|
|
|
|
void UpdateSortOrder();
|
|
|
|
|
2012-01-15 16:42:12 +01:00
|
|
|
void MoveTermListToBottom(int min, int max);
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
private:
|
2010-11-19 00:08:37 +01:00
|
|
|
class SearchPage;
|
|
|
|
class SortPage;
|
2010-11-18 22:13:43 +01:00
|
|
|
|
|
|
|
Search MakeSearch() const;
|
|
|
|
|
|
|
|
SearchPage* search_page_;
|
2014-02-06 14:48:00 +01:00
|
|
|
std::unique_ptr<Ui_SmartPlaylistQuerySortPage> sort_ui_;
|
2012-01-15 16:42:12 +01:00
|
|
|
|
|
|
|
int previous_scrollarea_max_;
|
2010-11-18 22:13:43 +01:00
|
|
|
};
|
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
} // namespace smart_playlists
|
2010-11-18 22:13:43 +01:00
|
|
|
|
2014-02-07 16:34:20 +01:00
|
|
|
#endif // QUERYWIZARDPLUGIN_H
|