Loading...
Searching...
No Matches
QXmppPresence.h
// SPDX-FileCopyrightText: 2009 Manjeet Dahiya <manjeetdahiya@gmail.com>
// SPDX-FileCopyrightText: 2022 Melvin Keskin <melvo@olomono.de>
// SPDX-FileCopyrightText: 2024 Filipe Azevedo <pasnox@gmail.com>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPPRESENCE_H
#define QXMPPPRESENCE_H
#include "QXmppJingleIq.h"
#include "QXmppMucIq.h"
#include "QXmppStanza.h"
class QXmppPresencePrivate;
class QXMPP_EXPORT QXmppPresence : public QXmppStanza
{
public:
enum Type {
Error = 0,
Available,
Unavailable,
Subscribe,
Subscribed,
Unsubscribe,
Unsubscribed,
Probe
};
enum AvailableStatusType {
Online = 0,
Away,
XA,
DND,
Chat,
Invisible
};
enum VCardUpdateType {
VCardUpdateNone = 0,
VCardUpdateNoPhoto,
VCardUpdateValidPhoto,
VCardUpdateNotReady
};
QXmppPresence(QXmppPresence::Type type = QXmppPresence::Available);
QXmppPresence(const QXmppPresence &other);
QXmppPresence(QXmppPresence &&);
~QXmppPresence() override;
QXmppPresence &operator=(const QXmppPresence &other);
QXmppPresence &operator=(QXmppPresence &&);
bool isXmppStanza() const override;
AvailableStatusType availableStatusType() const;
void setAvailableStatusType(AvailableStatusType type);
int priority() const;
void setPriority(int priority);
QXmppPresence::Type type() const;
void setType(QXmppPresence::Type);
QString statusText() const;
void setStatusText(const QString &statusText);
// XEP-0045: Multi-User Chat
QXmppMucItem mucItem() const;
void setMucItem(const QXmppMucItem &item);
QString mucPassword() const;
void setMucPassword(const QString &password);
QList<int> mucStatusCodes() const;
void setMucStatusCodes(const QList<int> &codes);
bool isMucSupported() const;
void setMucSupported(bool supported);
// XEP-0153: vCard-Based Avatars
QByteArray photoHash() const;
void setPhotoHash(const QByteArray &);
VCardUpdateType vCardUpdateType() const;
void setVCardUpdateType(VCardUpdateType type);
// XEP-0115: Entity Capabilities
QString capabilityHash() const;
void setCapabilityHash(const QString &);
QString capabilityNode() const;
void setCapabilityNode(const QString &);
QByteArray capabilityVer() const;
void setCapabilityVer(const QByteArray &);
// XEP-0272: Multiparty Jingle (Muji)
bool isPreparingMujiSession() const;
void setIsPreparingMujiSession(bool isPreparingMujiSession);
QVector<QXmppJingleIq::Content> mujiContents() const;
void setMujiContents(const QVector<QXmppJingleIq::Content> &mujiContents);
// XEP-0283: Moved
QString oldJid() const;
void setOldJid(const QString &oldJid);
// XEP-0319: Last User Interaction in Presence
QDateTime lastUserInteraction() const;
void setLastUserInteraction(const QDateTime &);
// XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements
QString mixUserJid() const;
void setMixUserJid(const QString &);
QString mixUserNick() const;
void setMixUserNick(const QString &);
// XEP-0421: Occupant identifiers for semi-anonymous MUCs
QString mucOccupantId() const;
void setMucOccupantId(const QString &);
void parse(const QDomElement &element) override;
void toXml(QXmlStreamWriter *writer) const override;
#if QXMPP_DEPRECATED_SINCE(1, 12)
[[deprecated("Legacy entity capabilities (used 2003-2007)")]]
QStringList capabilityExt() const;
#endif
private:
void parseExtension(const QDomElement &element, QXmppElementList &unknownElements);
QSharedDataPointer<QXmppPresencePrivate> d;
};
#endif // QXMPPPRESENCE_H
QXmppMucItem
The QXmppMucItem class represents a chat room "item".
Definition QXmppMucIq.h:19
QXmppNonza::parse
virtual void parse(const QDomElement &)=0
QXmppNonza::toXml
virtual void toXml(QXmlStreamWriter *writer) const =0
QXmppNonza::isXmppStanza
virtual bool isXmppStanza() const
Definition QXmppNonza.h:19
QXmppPresence
The QXmppPresence class represents an XMPP presence stanza.
Definition QXmppPresence.h:22
QXmppPresence::setType
void setType(QXmppPresence::Type)
Sets the presence type.
Definition QXmppPresence.cpp:199
QXmppPresence::setMixUserNick
void setMixUserNick(const QString &)
Definition QXmppPresence.cpp:441
QXmppPresence::setCapabilityNode
void setCapabilityNode(const QString &)
XEP-0115: Entity Capabilities
Definition QXmppPresence.cpp:251
QXmppPresence::setVCardUpdateType
void setVCardUpdateType(VCardUpdateType type)
Sets the type of VCardUpdate.
Definition QXmppPresence.cpp:227
QXmppPresence::mucItem
QXmppMucItem mucItem() const
Returns the MUC item.
Definition QXmppPresence.cpp:317
QXmppPresence::priority
int priority() const
Returns the priority level of the resource.
Definition QXmppPresence.cpp:158
QXmppPresence::operator=
QXmppPresence & operator=(const QXmppPresence &other)
Assignemnt operator.
QXmppPresence::isPreparingMujiSession
bool isPreparingMujiSession() const
Definition QXmppPresence.cpp:275
QXmppPresence::setMucStatusCodes
void setMucStatusCodes(const QList< int > &codes)
Sets the MUC status codes.
Definition QXmppPresence.cpp:347
QXmppPresence::setMucSupported
void setMucSupported(bool supported)
Sets whether MUC is supported.
Definition QXmppPresence.cpp:359
QXmppPresence::setMucItem
void setMucItem(const QXmppMucItem &item)
Sets the MUC item.
Definition QXmppPresence.cpp:323
QXmppPresence::availableStatusType
AvailableStatusType availableStatusType() const
Definition QXmppPresence.cpp:146
QXmppPresence::setStatusText
void setStatusText(const QString &statusText)
Definition QXmppPresence.cpp:180
QXmppPresence::type
QXmppPresence::Type type() const
Definition QXmppPresence.cpp:193
QXmppPresence::Type
Type
This enum is used to describe a presence type.
Definition QXmppPresence.h:25
QXmppPresence::Unsubscribe
@ Unsubscribe
The sender is unsubscribing from another entity's presence.
Definition QXmppPresence.h:31
QXmppPresence::Subscribe
@ Subscribe
The sender wishes to subscribe to the recipient's presence.
Definition QXmppPresence.h:29
QXmppPresence::Subscribed
@ Subscribed
The sender has allowed the recipient to receive their presence.
Definition QXmppPresence.h:30
QXmppPresence::Unavailable
@ Unavailable
Signals that the sender is no longer available for communication.
Definition QXmppPresence.h:28
QXmppPresence::Unsubscribed
@ Unsubscribed
The subscription request has been denied or a previously-granted subscription has been cancelled.
Definition QXmppPresence.h:32
QXmppPresence::Probe
@ Probe
A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user.
Definition QXmppPresence.h:33
QXmppPresence::Available
@ Available
Signals that the sender is online and available for communication.
Definition QXmppPresence.h:27
QXmppPresence::Error
@ Error
An error has occurred regarding processing or delivery of a previously-sent presence stanza.
Definition QXmppPresence.h:26
QXmppPresence::capabilityVer
QByteArray capabilityVer() const
XEP-0115: Entity Capabilities
Definition QXmppPresence.cpp:257
QXmppPresence::setCapabilityHash
void setCapabilityHash(const QString &)
XEP-0115: Entity Capabilities
Definition QXmppPresence.cpp:239
QXmppPresence::photoHash
QByteArray photoHash() const
Returns the photo-hash of the VCardUpdate.
Definition QXmppPresence.cpp:205
QXmppPresence::setMixUserJid
void setMixUserJid(const QString &)
Definition QXmppPresence.cpp:421
QXmppPresence::VCardUpdateType
VCardUpdateType
Definition QXmppPresence.h:48
QXmppPresence::VCardUpdateNoPhoto
@ VCardUpdateNoPhoto
User is not using any image.
Definition QXmppPresence.h:50
QXmppPresence::VCardUpdateNotReady
@ VCardUpdateNotReady
User is not ready to advertise an image.
Definition QXmppPresence.h:52
QXmppPresence::VCardUpdateValidPhoto
@ VCardUpdateValidPhoto
User is advertising an image.
Definition QXmppPresence.h:51
QXmppPresence::VCardUpdateNone
@ VCardUpdateNone
Protocol is not supported.
Definition QXmppPresence.h:49
QXmppPresence::setOldJid
void setOldJid(const QString &oldJid)
Definition QXmppPresence.cpp:379
QXmppPresence::setLastUserInteraction
void setLastUserInteraction(const QDateTime &)
Definition QXmppPresence.cpp:401
QXmppPresence::mucStatusCodes
QList< int > mucStatusCodes() const
Returns the MUC status codes.
Definition QXmppPresence.cpp:341
QXmppPresence::QXmppPresence
QXmppPresence(const QXmppPresence &other)
Copy-constructor.
QXmppPresence::setMucPassword
void setMucPassword(const QString &password)
Sets the password used to join a MUC room.
Definition QXmppPresence.cpp:335
QXmppPresence::setMujiContents
void setMujiContents(const QVector< QXmppJingleIq::Content > &mujiContents)
Definition QXmppPresence.cpp:311
QXmppPresence::QXmppPresence
QXmppPresence(QXmppPresence &&)
Move-constructor.
QXmppPresence::setIsPreparingMujiSession
void setIsPreparingMujiSession(bool isPreparingMujiSession)
Definition QXmppPresence.cpp:287
QXmppPresence::operator=
QXmppPresence & operator=(QXmppPresence &&)
Move-assignemnt operator.
QXmppPresence::setAvailableStatusType
void setAvailableStatusType(AvailableStatusType type)
Sets the availability status type, for instance busy or away.
Definition QXmppPresence.cpp:152
QXmppPresence::lastUserInteraction
QDateTime lastUserInteraction() const
Definition QXmppPresence.cpp:390
QXmppPresence::capabilityHash
QString capabilityHash() const
XEP-0115: Entity Capabilities
Definition QXmppPresence.cpp:233
QXmppPresence::QXmppPresence
QXmppPresence(QXmppPresence::Type type=QXmppPresence::Available)
Definition QXmppPresence.cpp:112
QXmppPresence::setCapabilityVer
void setCapabilityVer(const QByteArray &)
XEP-0115: Entity Capabilities
Definition QXmppPresence.cpp:263
QXmppPresence::~QXmppPresence
~QXmppPresence() override
Destroys a QXmppPresence.
QXmppPresence::setMucOccupantId
void setMucOccupantId(const QString &)
Definition QXmppPresence.cpp:463
QXmppPresence::mixUserJid
QString mixUserJid() const
Definition QXmppPresence.cpp:411
QXmppPresence::setPhotoHash
void setPhotoHash(const QByteArray &)
Definition QXmppPresence.cpp:215
QXmppPresence::capabilityNode
QString capabilityNode() const
XEP-0115: Entity Capabilities
Definition QXmppPresence.cpp:245
QXmppPresence::AvailableStatusType
AvailableStatusType
This enum is used to describe an availability status.
Definition QXmppPresence.h:37
QXmppPresence::Invisible
@ Invisible
obsolete XEP-0018: Invisible Presence
Definition QXmppPresence.h:43
QXmppPresence::Online
@ Online
The entity or resource is online.
Definition QXmppPresence.h:38
QXmppPresence::Chat
@ Chat
The entity or resource is actively interested in chatting.
Definition QXmppPresence.h:42
QXmppPresence::DND
@ DND
The entity or resource is busy ("Do Not Disturb").
Definition QXmppPresence.h:41
QXmppPresence::Away
@ Away
The entity or resource is temporarily away.
Definition QXmppPresence.h:39
QXmppPresence::XA
@ XA
The entity or resource is away for an extended period.
Definition QXmppPresence.h:40
QXmppPresence::mucOccupantId
QString mucOccupantId() const
Definition QXmppPresence.cpp:452
QXmppPresence::mujiContents
QVector< QXmppJingleIq::Content > mujiContents() const
Definition QXmppPresence.cpp:299
QXmppPresence::setPriority
void setPriority(int priority)
Sets the priority level of the resource.
Definition QXmppPresence.cpp:164
QXmppPresence::vCardUpdateType
VCardUpdateType vCardUpdateType() const
Returns the type of VCardUpdate.
Definition QXmppPresence.cpp:221
QXmppPresence::mixUserNick
QString mixUserNick() const
Definition QXmppPresence.cpp:431
QXmppPresence::mucPassword
QString mucPassword() const
Returns the password used to join a MUC room.
Definition QXmppPresence.cpp:329
QXmppPresence::oldJid
QString oldJid() const
Definition QXmppPresence.cpp:369
QXmppPresence::statusText
QString statusText() const
Returns the status text, a textual description of the user's status.
Definition QXmppPresence.cpp:170
QXmppPresence::isMucSupported
bool isMucSupported() const
Returns true if the sender has indicated MUC support.
Definition QXmppPresence.cpp:353
QXmppStanza::QXmppStanza
QXmppStanza(const QString &from=QString(), const QString &to=QString())
Definition QXmppStanza.cpp:693