Loading...
Searching...
No Matches
QXmppAttentionManager.h
// SPDX-FileCopyrightText: 2020 Linus Jahn <lnj@kaidan.im>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPATTENTIONMANAGER_H
#define QXMPPATTENTIONMANAGER_H
#include "QXmppClientExtension.h"
#include <QTime>
class QXmppAttentionManagerPrivate;
class QXmppMessage;
class QXMPP_EXPORT QXmppAttentionManager : public QXmppClientExtension
{
Q_OBJECT
public:
QXmppAttentionManager(quint8 allowedAttempts = 3, QTime timeFrame = QTime(0, 15, 0));
~QXmppAttentionManager();
QStringList discoveryFeatures() const override;
quint8 allowedAttempts() const;
void setAllowedAttempts(quint8 allowedAttempts);
QTime allowedAttemptsTimeInterval() const;
void setAllowedAttemptsTimeInterval(QTime interval);
Q_SLOT QString requestAttention(const QString &jid, const QString &message = {});
Q_SIGNAL void attentionRequested(const QXmppMessage &message, bool isTrusted);
Q_SIGNAL void attentionRequestRateLimited(const QXmppMessage &message);
protected:
void onRegistered(QXmppClient *client) override;
void onUnregistered(QXmppClient *client) override;
private:
Q_SLOT void handleMessageReceived(const QXmppMessage &message);
const std::unique_ptr<QXmppAttentionManagerPrivate> d;
};
#endif // QXMPPATTENTIONMANAGER_H
QXmppAttentionManager::setAllowedAttemptsTimeInterval
void setAllowedAttemptsTimeInterval(QTime interval)
Definition QXmppAttentionManager.cpp:150
QXmppAttentionManager::setAllowedAttempts
void setAllowedAttempts(quint8 allowedAttempts)
Definition QXmppAttentionManager.cpp:126
QXmppAttentionManager::allowedAttemptsTimeInterval
QTime allowedAttemptsTimeInterval() const
Definition QXmppAttentionManager.cpp:138
QXmppAttentionManager::attentionRequested
Q_SIGNAL void attentionRequested(const QXmppMessage &message, bool isTrusted)
QXmppAttentionManager::QXmppAttentionManager
QXmppAttentionManager(quint8 allowedAttempts=3, QTime timeFrame=QTime(0, 15, 0))
QXmppAttentionManager::QXmppAttentionManager.
Definition QXmppAttentionManager.cpp:88
QXmppAttentionManager::allowedAttempts
quint8 allowedAttempts() const
Definition QXmppAttentionManager.cpp:113
QXmppAttentionManager::attentionRequestRateLimited
Q_SIGNAL void attentionRequestRateLimited(const QXmppMessage &message)
QXmppAttentionManager::requestAttention
Q_SLOT QString requestAttention(const QString &jid, const QString &message={})
Definition QXmppAttentionManager.cpp:169
QXmppClientExtension::discoveryFeatures
virtual QStringList discoveryFeatures() const
Definition QXmppClientExtension.cpp:22
QXmppClientExtension::onUnregistered
virtual void onUnregistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:95
QXmppClientExtension::onRegistered
virtual void onRegistered(QXmppClient *client)
Definition QXmppClientExtension.cpp:85
QXmppClientExtension::client
QXmppClient * client() const
Definition QXmppClientExtension.cpp:57
QXmppClientExtension::QXmppClientExtension
QXmppClientExtension()
Definition QXmppClientExtension.cpp:12
QXmppMessage
The QXmppMessage class represents an XMPP message.
Definition QXmppMessage.h:64