Qmmp
src
qmmpui
playlistheadermodel.h
1
/***************************************************************************
2
* Copyright (C) 2015-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 PLAYLISTHEADERMODEL_H
22
#define PLAYLISTHEADERMODEL_H
23
24
#include <QObject>
25
#include <QWidget>
26
#include <QSettings>
27
#include <QHash>
28
#include <QVariant>
29
#include "metadataformatter.h"
30
#include "qmmpui_export.h"
31
32
class
MetaDataHelper;
33
38
class
QMMPUI_EXPORT
PlayListHeaderModel
:
public
QObject
39
{
40
Q_OBJECT
41
public
:
46
explicit
PlayListHeaderModel
(QObject *parent =
nullptr
);
50
~PlayListHeaderModel
();
55
void
restoreSettings
(
const
QString &groupName);
60
void
restoreSettings
(QSettings *settings);
65
void
saveSettings
(
const
QString &groupName);
70
void
saveSettings
(QSettings *settings);
74
bool
isSettingsLoaded
()
const
;
81
void
insert
(
int
index,
const
QString &name,
const
QString &pattern);
86
void
remove
(
int
index);
90
void
move
(
int
from,
int
to);
96
void
execEdit
(
int
index, QWidget *parent =
nullptr
);
102
void
execInsert
(
int
index, QWidget *parent =
nullptr
);
106
int
count
();
110
const
QString
name
(
int
index)
const
;
114
const
QString
pattern
(
int
index)
const
;
121
void
setData
(
int
index,
int
key,
const
QVariant &data);
127
const
QVariant
data
(
int
index,
int
key)
const
;
128
129
signals:
134
void
columnAdded
(
int
index);
139
void
columnRemoved
(
int
index);
144
void
columnChanged
(
int
index);
148
void
columnMoved
(
int
from,
int
to);
152
void
headerChanged
();
153
154
private
:
155
void
updatePlayLists();
156
157
struct
ColumnHeader
158
{
159
QString name;
160
QString pattern;
161
QHash<int, QVariant> data;
162
};
163
QList<ColumnHeader> m_columns;
164
bool
m_settings_loaded =
false
;
165
MetaDataHelper *m_helper;
166
};
167
168
#endif
// COLUMNMANAGER_H
PlayListHeaderModel
Helper class that provides access to playlist column configuration.
Definition:
playlistheadermodel.h:39
PlayListHeaderModel::PlayListHeaderModel
PlayListHeaderModel(QObject *parent=nullptr)
PlayListHeaderModel::setData
void setData(int index, int key, const QVariant &data)
PlayListHeaderModel::~PlayListHeaderModel
~PlayListHeaderModel()
PlayListHeaderModel::remove
void remove(int index)
PlayListHeaderModel::restoreSettings
void restoreSettings(const QString &groupName)
PlayListHeaderModel::restoreSettings
void restoreSettings(QSettings *settings)
PlayListHeaderModel::pattern
const QString pattern(int index) const
PlayListHeaderModel::saveSettings
void saveSettings(QSettings *settings)
PlayListHeaderModel::execEdit
void execEdit(int index, QWidget *parent=nullptr)
PlayListHeaderModel::move
void move(int from, int to)
PlayListHeaderModel::data
const QVariant data(int index, int key) const
PlayListHeaderModel::columnAdded
void columnAdded(int index)
PlayListHeaderModel::insert
void insert(int index, const QString &name, const QString &pattern)
PlayListHeaderModel::count
int count()
PlayListHeaderModel::isSettingsLoaded
bool isSettingsLoaded() const
PlayListHeaderModel::execInsert
void execInsert(int index, QWidget *parent=nullptr)
PlayListHeaderModel::columnMoved
void columnMoved(int from, int to)
PlayListHeaderModel::columnChanged
void columnChanged(int index)
PlayListHeaderModel::columnRemoved
void columnRemoved(int index)
PlayListHeaderModel::name
const QString name(int index) const
PlayListHeaderModel::saveSettings
void saveSettings(const QString &groupName)
PlayListHeaderModel::headerChanged
void headerChanged()
Generated on Tue Oct 31 2023 10:48:38 for Qmmp by
1.9.1