Sayonara Player
LibraryItem.h
1 /* LibraryItem.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 _LIBRARY_ITEM_H_
24 #define _LIBRARY_ITEM_H_
25 
26 #include "Helper/Logger/Logger.h"
27 #include <QMap>
28 #include <QObject>
29 
30 
38 class CustomField {
39 
40  QString _display_name;
41  QString _value;
42  QString _id;
43 
44 public:
45 
46  CustomField(const QString& id, const QString& display_name, const QString& value);
47  CustomField(const CustomField& copy);
48 
49  QString get_id() const;
50  QString get_display_name() const;
51  QString get_value() const;
52 };
53 
54 
59 class LibraryItem {
60 
61 private:
62  QList<CustomField> _additional_data;
63 
64 public:
65 
66  quint8 db_id;
67  QString cover_download_url;
68 
69 
70  LibraryItem();
71  LibraryItem(const LibraryItem& other);
72  LibraryItem(LibraryItem&& other);
73  LibraryItem& operator=(const LibraryItem& other);
74  ~LibraryItem();
75 
76  void add_custom_field(const CustomField& field);
77  void add_custom_field(const QString& id, const QString& display_name, const QString& value);
78 
79  const QList<CustomField>& get_custom_fields() const;
80  QString get_custom_field(const QString& id) const;
81  QString get_custom_field(int idx) const;
82 
83  int has_custom_field(const QString& id) const;
84 
85  virtual void print() const;
86 };
87 
88 #endif
89 
The LibraryItem class.
Definition: LibraryItem.h:59
The CustomField class a CustomField is some additional entry than can be set for MetaData, Albums and Artists and will be displayed on the Info Dialog These custom fields are intendend for Plugins.
Definition: LibraryItem.h:38