Qmmp
Loading...
Searching...
No Matches
tagmodel.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 TAGMODEL_H
22#define TAGMODEL_H
23
24#include <QString>
25#include <QList>
26#include <QFlags>
27#include "qmmp.h"
28
32class QMMP_EXPORT TagModel
33{
34public:
39 {
40 CreateRemove = 0x1,
41 Save = 0x2,
42 DefaultCaps = CreateRemove | Save,
43 };
44 Q_DECLARE_FLAGS(ModelCaps, ModelCap)
49 TagModel(ModelCaps f = DefaultCaps);
53 virtual ~TagModel();
58 virtual QString name() const = 0;
62 virtual QList<Qmmp::MetaData> keys() const;
67 virtual QString value(Qmmp::MetaData key) const = 0;
72 virtual void setValue(Qmmp::MetaData key, const QString &value) = 0;
77 virtual void setValue(Qmmp::MetaData key, int value);
81 virtual bool exists() const;
85 virtual void create();
89 virtual void remove();
93 virtual void save();
97 ModelCaps caps() const;
98
99private:
100 ModelCaps m_f = DefaultCaps;
101};
102
103Q_DECLARE_OPERATORS_FOR_FLAGS(TagModel::ModelCaps)
104
105#endif // TAGMODEL_H
The Qmmp class stores global settings and enums.
Definition qmmp.h:56
The StateHandler class provides is the base interface class of tag editor.
Definition tagmodel.h:33
ModelCap
Definition tagmodel.h:39