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 
31 namespace 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  bool operator==(const Filter& other);
54 
55  int count() const;
56 
57  void setFiltertext(const QString& str, SearchModeMask search_mode);
58  QStringList filtertext(bool with_percent) const;
59  QStringList searchModeFiltertext(bool with_percent) const;
60 
61  void setMode(Filter::Mode mode);
62  Filter::Mode mode() const;
63 
64  void clear();
65  bool cleared() const;
66  bool isUseable() const;
67 
68  static QString filterModeName(Mode mode);
69  };
70 }
71 
72 Q_DECLARE_METATYPE(Library::Filter::Mode)
73 
74 #endif /* SAYONARA_LIBRARY_FILTER_H */
Genre
Definition: Genre.h:31
Library::Filter
Definition: Filter.h:34
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31