-
Notifications
You must be signed in to change notification settings - Fork 1
/
qhtsptag.h
99 lines (80 loc) · 2.55 KB
/
qhtsptag.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Copyright (C) 2012 Robert Meijers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QHTSPTAG_H
#define QHTSPTAG_H
#include <QExplicitlySharedDataPointer>
#include <QObject>
#include <QSharedData>
#include <QString>
#include "qhtspchannellist.h"
#include "qhtspchannelmodel.h"
#include "qhtspmessage.h"
class QHtsp;
class QHtspTagData : public QObject, public QSharedData
{
Q_OBJECT
public:
QHtspTagData(QHtsp *htsp);
QHtspTagData(const QHtspTagData &other);
~QHtspTagData() { }
QHtspChannelList *channels;
QHtsp *htsp;
QString iconUrl;
qint64 id;
QString name;
void setIconUrl(QString url);
void setId(qint64 id);
void setName(QString name);
void parseMessage(QHtspMessage &message);
signals:
void iconUrlChanged();
void idChanged();
void nameChanged();
private:
void _updateChannels(QList<qint64> *ids);
};
class QHtspTag : public QObject
{
Q_OBJECT
Q_PROPERTY(QHtspChannelList *channels READ channels)
Q_PROPERTY(QHtspChannelModel *channelsModel READ channelsModel)
Q_PROPERTY(QString iconUrl READ iconUrl WRITE setIconUrl NOTIFY iconUrlChanged)
Q_PROPERTY(qint64 id READ id WRITE setId NOTIFY idChanged)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
public:
explicit QHtspTag(QHtsp *htsp, QObject *parent = 0);
QHtspTag(QHtspMessage &message, QHtsp *htsp, QObject *parent = 0);
QHtspTag(const QHtspTag &tag, QObject *parent = 0);
QHtspChannelList *channels();
QHtspChannelModel *channelsModel();
QString iconUrl();
qint64 id();
QString name();
void setIconUrl(QString url);
void setId(qint64 id);
void setName(QString name);
void update(QHtspMessage &message);
signals:
void iconUrlChanged();
void idChanged();
void nameChanged();
private:
QExplicitlySharedDataPointer<QHtspTagData> d;
QHtspChannelModel *m_channelsModel;
void _connectSignals();
};
#endif // QHTSPTAG_H