Sayonara Player
Filter.h
1/* Filter.h
2
3 * Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara-player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * created by Michael Lugmair (Lucio Carreras),
21 * Jul 9, 2012
22 *
23 */
24
25#ifndef SAYONARA_LIBRARY_FILTER_H
26#define SAYONARA_LIBRARY_FILTER_H
27
28#include "Utils/Pimpl.h"
29#include "Utils/Library/SearchMode.h"
30
31namespace Library
32{
33 class Filter
34 {
35 PIMPL(Filter)
36
37 public:
38 enum Mode
39 {
40 Fulltext = 0,
41 Filename,
42 Genre,
43 InvalidGenre,
44 Invalid
45 };
46
47 Filter();
48 ~Filter();
49
50 Filter(const Filter& other);
51 Filter& operator=(const Filter& other);
52
53 void setFiltertext(const QString& filterText);
54 QStringList filtertext(bool withPercent) const;
55 QStringList searchModeFiltertext(bool withPercent, SearchModeMask searchModeMask) const;
56
57 void setMode(Filter::Mode mode);
58 Filter::Mode mode() const;
59
60 void clear();
61 bool cleared() const;
62 bool isEqual(const Filter& other, int minimumSearchStringLength) const;
63 int count() const;
64
65 static QString filterModeName(Mode mode);
66 };
67}
68
69Q_DECLARE_METATYPE(Library::Filter::Mode)
70
71#endif /* SAYONARA_LIBRARY_FILTER_H */
Definition: Genre.h:31
Definition: Filter.h:34
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31