QXmppTuneItem Class

Header: #include <QXmppTuneItem>
Since: QXmpp 1.5
Inherits: QXmppPubSubBaseItem

Public Functions

QXmppTuneItem()
QXmppTuneItem(const QXmppTuneItem &other)
QXmppTuneItem(QXmppTuneItem &&)
QString artist() const
std::optional<quint16> length() const
std::optional<std::chrono::seconds> lengthAsDuration() const
QTime lengthAsTime() const
std::optional<quint8> rating() const
void setArtist(QString artist)
void setLength(std::optional<quint16> length)
void setLength(const QTime &time)
void setLength(std::optional<std::chrono::seconds> time)
void setRating(std::optional<quint8> rating)
void setSource(QString source)
void setTitle(QString title)
void setTrack(QString track)
void setUri(QUrl uri)
QString source() const
QString title() const
QString track() const
QUrl uri() const
QXmppTuneItem &operator=(QXmppTuneItem &&)
QXmppTuneItem &operator=(const QXmppTuneItem &other)

Static Public Members

bool isItem(const QDomElement &itemElement)

Detailed Description

This class represents a PubSub item for XEP-0118: User Tune.

Member Function Documentation

QXmppTuneItem::QXmppTuneItem()

Default constructor

QXmppTuneItem::QXmppTuneItem(const QXmppTuneItem &other)

Copy-constructor.

QXmppTuneItem::QXmppTuneItem(QXmppTuneItem &&)

Move-constructor.

QString QXmppTuneItem::artist() const

Returns the artist of the piece or song.

See also setArtist().

[static] bool QXmppTuneItem::isItem(const QDomElement &itemElement)

Returns true, if the element is a valid XEP-0118: User Tune PubSub item.

itemElement.

std::optional<quint16> QXmppTuneItem::length() const

Returns the length of the piece in seconds (0 means unknown).

See also setLength().

std::optional<std::chrono::seconds> QXmppTuneItem::lengthAsDuration() const

Returns the length as std::chrono::seconds.

This is an overloaded function.

QTime QXmppTuneItem::lengthAsTime() const

Returns the length as QTime.

std::optional<quint8> QXmppTuneItem::rating() const

Returns the user's rating of the song or piece (from 1 to 10), 0 means invalid or unknown.

See also setRating().

void QXmppTuneItem::setArtist(QString artist)

Sets the artist of the piece or song.

See also artist().

void QXmppTuneItem::setLength(std::optional<quint16> length)

Sets the length of the piece in seconds (0 means unknown).

See also length().

void QXmppTuneItem::setLength(const QTime &time)

Sets the length from QTime.

This is an overloaded function.

void QXmppTuneItem::setLength(std::optional<std::chrono::seconds> time)

Sets the length from std::chrono::seconds. Useful if you want to use the chrono literals.

This is an overloaded function.

void QXmppTuneItem::setRating(std::optional<quint8> rating)

Sets the user's rating of the song or piece (from 1 to 10), 0 means invalid or unknown.

rating.

See also rating().

void QXmppTuneItem::setSource(QString source)

Sets the album, other collection or other source (e.g. website) of the piece.

source.

See also source().

void QXmppTuneItem::setTitle(QString title)

Sets the title of the piece.

See also title().

void QXmppTuneItem::setTrack(QString track)

Sets the track number or other identifier in the collection or source.

See also track().

void QXmppTuneItem::setUri(QUrl uri)

Sets an URI or URL pointing to information about the song, collection or artist.

uri.

See also uri().

QString QXmppTuneItem::source() const

Returns the album, other collection or other source (e.g. website) of the piece.

See also setSource().

QString QXmppTuneItem::title() const

Returns the title of the piece.

See also setTitle().

QString QXmppTuneItem::track() const

Returns the track number or other identifier in the collection or source.

See also setTrack().

QUrl QXmppTuneItem::uri() const

Returns an URI or URL pointing to information about the song, collection or artist.

See also setUri().

QXmppTuneItem &QXmppTuneItem::operator=(QXmppTuneItem &&)

Move-assignment operator.

QXmppTuneItem &QXmppTuneItem::operator=(const QXmppTuneItem &other)

Assignment operator.