Qmmp
Loading...
Searching...
No Matches
metadatamodel.h
1/***************************************************************************
2 * Copyright (C) 2009-2022 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
37class QMMP_EXPORT MetaDataItem
38{
39public:
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
72private:
73 QString m_name, m_suffix;
74 QVariant m_value;
75};
76
80class QMMP_EXPORT MetaDataModel
81{
82public:
87 {
88 IsCoverEditable = 0x1,
89 CompletePropertyList = 0x2,
90 IsCueEditable = 0x4
91 };
92 Q_DECLARE_FLAGS(DialogHints, DialogHint)
98 MetaDataModel(bool readOnly, DialogHints hints = DialogHints());
102 virtual ~MetaDataModel();
107 virtual QList<MetaDataItem> extraProperties() const;
112 virtual QList<MetaDataItem> descriptions() const;
117 virtual QList<TagModel* > tags() const;
122 virtual QPixmap cover() const;
128 virtual void setCover(const QPixmap &pix);
133 virtual void removeCover();
137 virtual QString coverPath() const;
141 virtual QString cue() const;
145 virtual void setCue(const QString &content);
149 virtual void removeCue();
153 virtual QString lyrics() const;
157 bool isReadOnly() const;
161 const DialogHints &dialogHints() const;
162
163protected:
167 void setDialogHints(const DialogHints &hints);
172 void setReadOnly(bool readOnly);
173
174private:
175 bool m_readOnly;
176 DialogHints m_dialogHints;
177};
178
179Q_DECLARE_OPERATORS_FOR_FLAGS(MetaDataModel::DialogHints)
180
181#endif // METADATAMODEL_H
Container of extra file/track property.
Definition metadatamodel.h:38
const QString & name() const
void setSuffix(const QString &suffix)
const QString & suffix() const
MetaDataItem(const QString &name, const QVariant &value, const QString &suffix=QString())
const QVariant & value() const
void setName(const QString &name)
void setValue(const QString &value)
The MetaDataModel is the base interface class of metadata access.
Definition metadatamodel.h:81
DialogHint
Definition metadatamodel.h:87
The StateHandler class provides is the base interface class of tag editor.
Definition tagmodel.h:33