QXmpp Version: 1.10.0
QXmppAttentionManager.h
1// SPDX-FileCopyrightText: 2020 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPATTENTIONMANAGER_H
6#define QXMPPATTENTIONMANAGER_H
7
8#include "QXmppClientExtension.h"
9
10#include <QTime>
11
12class QXmppAttentionManagerPrivate;
13class QXmppMessage;
14
16{
17 Q_OBJECT
18
19public:
20 QXmppAttentionManager(quint8 allowedAttempts = 3, QTime timeFrame = QTime(0, 15, 0));
22
23 QStringList discoveryFeatures() const override;
24
25 quint8 allowedAttempts() const;
26 void setAllowedAttempts(quint8 allowedAttempts);
27
28 QTime allowedAttemptsTimeInterval() const;
29 void setAllowedAttemptsTimeInterval(QTime interval);
30
31public Q_SLOTS:
32 QString requestAttention(const QString &jid, const QString &message = {});
33
34Q_SIGNALS:
35 void attentionRequested(const QXmppMessage &message, bool isTrusted);
37
38protected:
39 void onRegistered(QXmppClient *client) override;
40 void onUnregistered(QXmppClient *client) override;
41
42private Q_SLOTS:
43 void handleMessageReceived(const QXmppMessage &message);
44
45private:
46 const std::unique_ptr<QXmppAttentionManagerPrivate> d;
47};
48
49#endif // QXMPPATTENTIONMANAGER_H
The QXmppAttentionManager class manages attention requests as defined by XEP-0224: Attention.
Definition: QXmppAttentionManager.h:16
void attentionRequested(const QXmppMessage &message, bool isTrusted)
void attentionRequestRateLimited(const QXmppMessage &message)
The QXmppClientExtension class is the base class for QXmppClient extensions.
Definition: QXmppClientExtension.h:32
virtual QStringList discoveryFeatures() const
Definition: QXmppClientExtension.cpp:22
virtual void onUnregistered(QXmppClient *client)
Definition: QXmppClientExtension.cpp:95
virtual void onRegistered(QXmppClient *client)
Definition: QXmppClientExtension.cpp:85
Main class for starting and managing connections to XMPP servers.
Definition: QXmppClient.h:62
The QXmppMessage class represents an XMPP message.
Definition: QXmppMessage.h:64