Sayonara Player
LibraryItem.h
1 /* LibraryItem.h */
2 
3 /* Copyright (C) 2011-2017 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 _LIBRARY_ITEM_H_
22 #define _LIBRARY_ITEM_H_
23 
24 #include <QList>
25 #include <QString>
26 
35 {
36  QString _display_name;
37  QString _value;
38  QString _id;
39 
40 public:
41 
42  CustomField(const QString& id, const QString& display_name, const QString& value);
43  CustomField(const CustomField& copy);
44  virtual ~CustomField();
45 
46  QString get_id() const;
47  QString get_display_name() const;
48  QString get_value() const;
49 };
50 
51 
57 {
58 private:
59  QList<CustomField> _additional_data;
60 
61 public:
62 
63  quint8 db_id;
64  QString cover_download_url;
65 
66 
67  LibraryItem();
68  LibraryItem(const LibraryItem& other);
69  LibraryItem(LibraryItem&& other);
70  LibraryItem& operator=(const LibraryItem& other);
71  virtual ~LibraryItem();
72 
73  void add_custom_field(const CustomField& field);
74  void add_custom_field(const QString& id, const QString& display_name, const QString& value);
75 
76  const QList<CustomField>& get_custom_fields() const;
77  QString get_custom_field(const QString& id) const;
78  QString get_custom_field(int idx) const;
79 
80  virtual void print() const;
81 };
82 
83 #endif
84 
The LibraryItem class.
Definition: LibraryItem.h:56
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:34