2010-10-29 20:41:49 +02:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
|
|
|
|
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 SMARTPLAYLISTSEARCH_H
|
|
|
|
#define SMARTPLAYLISTSEARCH_H
|
|
|
|
|
|
|
|
#include "smartplaylistsearchterm.h"
|
|
|
|
|
|
|
|
class SmartPlaylistSearch {
|
|
|
|
public:
|
|
|
|
SmartPlaylistSearch();
|
|
|
|
|
2010-11-03 21:58:33 +01:00
|
|
|
// These values are persisted, so add to the end of the enum only
|
|
|
|
enum SearchType {
|
|
|
|
Type_And = 0,
|
|
|
|
Type_Or,
|
|
|
|
Type_All,
|
|
|
|
};
|
|
|
|
|
2010-10-29 20:41:49 +02:00
|
|
|
// These values are persisted, so add to the end of the enum only
|
|
|
|
enum SortType {
|
|
|
|
Sort_Random = 0,
|
|
|
|
Sort_FieldAsc,
|
|
|
|
Sort_FieldDesc,
|
|
|
|
};
|
|
|
|
|
2010-11-03 21:58:33 +01:00
|
|
|
bool is_valid() const;
|
2010-10-29 20:41:49 +02:00
|
|
|
|
2010-11-03 21:58:33 +01:00
|
|
|
SearchType search_type_;
|
2010-10-29 20:41:49 +02:00
|
|
|
QList<SmartPlaylistSearchTerm> terms_;
|
|
|
|
SortType sort_type_;
|
|
|
|
SmartPlaylistSearchTerm::Field sort_field_;
|
|
|
|
int limit_;
|
|
|
|
|
|
|
|
void Reset();
|
|
|
|
QString ToSql(const QString& songs_table) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
QDataStream& operator <<(QDataStream& s, const SmartPlaylistSearch& search);
|
|
|
|
QDataStream& operator >>(QDataStream& s, SmartPlaylistSearch& search);
|
|
|
|
|
|
|
|
#endif // SMARTPLAYLISTSEARCH_H
|