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