5#ifndef QXMPPUSERTUNEITEM_H
6#define QXMPPUSERTUNEITEM_H
8#include "QXmppPubSubBaseItem.h"
13#include <QSharedDataPointer>
16class QXmppTuneItemPrivate;
30 QString artist()
const;
31 void setArtist(QString artist);
33 std::optional<quint16> length()
const;
34 void setLength(std::optional<quint16> length);
37 if (
auto len = length()) {
38 return QTime::fromMSecsSinceStartOfDay(len.value() * 1000);
45 setLength(time.msecsSinceStartOfDay() / 1000);
47 setLength(std::optional<quint16>());
51 if (
auto len = length()) {
52 return std::chrono::seconds(*len);
56 inline void setLength(std::optional<std::chrono::seconds> time)
59 setLength(quint16(time->count()));
61 setLength(std::optional<quint16>());
64 std::optional<quint8> rating()
const;
65 void setRating(std::optional<quint8> rating);
67 QString source()
const;
68 void setSource(QString source);
70 QString title()
const;
71 void setTitle(QString title);
73 QString track()
const;
74 void setTrack(QString track);
77 void setUri(QUrl uri);
79 static bool isItem(
const QDomElement &itemElement);
83 void parsePayload(
const QDomElement &payloadElement)
override;
88 QSharedDataPointer<QXmppTuneItemPrivate> d;
Definition: QXmppPubSubBaseItem.h:19
virtual void serializePayload(QXmlStreamWriter *writer) const
Definition: QXmppPubSubBaseItem.cpp:154
virtual void parsePayload(const QDomElement &payloadElement)
Definition: QXmppPubSubBaseItem.cpp:144
static bool isItem(const QDomElement &element)
Definition: QXmppPubSubBaseItem.cpp:134
Definition: QXmppUserTuneItem.h:20
QXmppTuneItem(QXmppTuneItem &&)
Move-constructor.
void setLength(const QTime &time)
Definition: QXmppUserTuneItem.h:42
QXmppTuneItem & operator=(QXmppTuneItem &&)
Move-assignment operator.
QXmppTuneItem & operator=(const QXmppTuneItem &other)
Assignment operator.
std::optional< std::chrono::seconds > lengthAsDuration() const
Definition: QXmppUserTuneItem.h:49
QTime lengthAsTime() const
Definition: QXmppUserTuneItem.h:35
void setLength(std::optional< std::chrono::seconds > time)
Definition: QXmppUserTuneItem.h:56
QXmppTuneItem(const QXmppTuneItem &other)
Copy-constructor.