Qmmp
metadatamodel.h
1 /***************************************************************************
2  * Copyright (C) 2009-2020 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef METADATAMODEL_H
22 #define METADATAMODEL_H
23 
24 #include <QHash>
25 #include <QList>
26 #include <QString>
27 #include <QCoreApplication>
28 #include <QPixmap>
29 #include <QVariant>
30 #include <QFlags>
31 #include "tagmodel.h"
32 
33 
37 class QMMP_EXPORT MetaDataItem
38 {
39 public:
46  MetaDataItem(const QString &name, const QVariant &value, const QString &suffix = QString());
50  const QString &name() const;
54  void setName(const QString &name);
58  const QVariant &value() const;
62  void setValue(const QString &value);
66  const QString &suffix() const;
70  void setSuffix(const QString &suffix);
71 
72 private:
73  QString m_name, m_suffix;
74  QVariant m_value;
75 };
76 
80 class QMMP_EXPORT MetaDataModel
81 {
82 public:
87  {
88  IsCoverEditable = 0x1,
89  CompletePropertyList = 0x2
90  };
91  Q_DECLARE_FLAGS(DialogHints, DialogHint)
97  MetaDataModel(bool readOnly, DialogHints hints = DialogHints());
101  virtual ~MetaDataModel();
106  virtual QList<MetaDataItem> extraProperties() const;
111  virtual QList<MetaDataItem> descriptions() const;
116  virtual QList<TagModel* > tags() const;
121  virtual QPixmap cover() const;
127  virtual void setCover(const QPixmap &pix);
132  virtual void removeCover();
136  virtual QString coverPath() const;
140  bool isReadOnly() const;
144  const DialogHints &dialogHints() const;
145 
146 protected:
150  void setDialogHints(const DialogHints &hints);
155  void setReadOnly(bool readOnly);
156 
157 private:
158  bool m_readOnly;
159  DialogHints m_dialogHints;
160 };
161 
162 Q_DECLARE_OPERATORS_FOR_FLAGS(MetaDataModel::DialogHints)
163 
164 #endif // METADATAMODEL_H
Container of extra file/track property.
Definition: metadatamodel.h:37
The MetaDataModel is the base interface class of metadata access.
Definition: metadatamodel.h:80
DialogHint
Definition: metadatamodel.h:86