Sayonara Player
DatabaseArtists.h
1 /* DatabaseArtists.h */
2 
3 /* Copyright (C) 2011-2016 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 
21 
22 
23 #ifndef DATABASEARTISTS_H
24 #define DATABASEARTISTS_H
25 
26 #include "Database/DatabaseModule.h"
27 #include "Components/Library/Sorting.h"
28 #include "Helper/LibrarySearchMode.h"
29 
30 
31 class Artist;
32 class ArtistList;
34 {
35 
36 private:
37  QString _fetch_query;
38  QString _create_order_string(SortOrder sort);
39 
40 protected:
41  void set_artist_fetch_query(const QString& query);
42 
43 
44 public:
45  DatabaseArtists(QSqlDatabase db, quint8 db_id);
46 
47  virtual bool db_fetch_artists(SayonaraQuery& q, ArtistList& result);
48 
49  virtual int getArtistID (const QString& artist);
50  virtual bool getArtistByID(int id, Artist& artist);
51  virtual int getMaxArtistID();
52 
53  virtual bool getAllArtists(ArtistList& result, SortOrder sortorder = SortOrder::ArtistNameAsc, bool also_empty=false);
54 
55  virtual bool getAllArtistsByAlbum(int album, ArtistList& result, SortOrder sortorder = SortOrder::ArtistNameAsc);
56 
57  virtual bool getAllArtistsBySearchString(Filter filter, ArtistList& result, SortOrder sortorder = SortOrder::ArtistNameAsc);
58 
59  virtual int insertArtistIntoDatabase (const QString& artist);
60  virtual int insertArtistIntoDatabase (const Artist& artist);
61  virtual int updateArtist(const Artist& artist);
62 
63  virtual void updateArtistCissearch(LibraryHelper::SearchModeMask mode);
64 
65 };
66 
67 #endif // DATABASEARTISTS_H
Definition: Filter.h:31
Definition: DatabaseArtists.h:33
Definition: SayonaraQuery.h:32
Definition: DatabaseModule.h:54
ArtistList.
Definition: Artist.h:64
The Artist class.
Definition: Artist.h:36