Sayonara Player
Artists.h
1 /* DatabaseArtists.h */
2 
3 /* Copyright (C) 2011-2019 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 #ifndef DATABASEARTISTS_H
22 #define DATABASEARTISTS_H
23 
24 #include "Database/SearchableModule.h"
25 
26 namespace Library {class Filter;}
27 
28 class Artist;
29 class ArtistList;
30 
31 namespace DB
32 {
33  class Artists :
34  private SearchableModule
35  {
36  PIMPL(Artists)
37 
38  public:
39 
40  Artists(const QString& connection_name, DbId db_id, LibraryId library_id);
41  ~Artists() override;
42 
43  virtual bool db_fetch_artists(Query& q, ArtistList& result) const;
44 
45  virtual ArtistId getArtistID (const QString& artist) const;
46  virtual bool getArtistByID(ArtistId id, Artist& artist) const;
47  virtual bool getArtistByID(ArtistId id, Artist& artist, bool also_empty) const;
48 
49  virtual bool getAllArtists(ArtistList& result, bool also_empty) const;
50  virtual bool getAllArtistsBySearchString(const ::Library::Filter& filter, ArtistList& result) const;
51 
52  virtual bool deleteArtist(ArtistId id);
53 
54  virtual ArtistId insertArtistIntoDatabase(const QString& artist);
55  virtual ArtistId insertArtistIntoDatabase(const Artist& artist);
56 
57  virtual void updateArtistCissearch();
58 
59  protected:
60  virtual QString artistid_field() const=0;
61  virtual QString artistname_field() const=0;
62 
63  private:
64  virtual QString fetch_query_artists(bool also_empty) const;
65  };
66 }
67 
68 #endif // DATABASEARTISTS_H
ArtistList
ArtistList.
Definition: Artist.h:70
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:32
Artist
The Artist class.
Definition: Artist.h:36
DB::Query
Definition: Query.h:35
DB::SearchableModule
Definition: SearchableModule.h:32
DB::Artists
Definition: Artists.h:33