QXmpp: QXmppAttentionManager.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
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
15 class QXMPP_EXPORT QXmppAttentionManager : public QXmppClientExtension
16{
17 Q_OBJECT
18
19public:
20 QXmppAttentionManager(quint8 allowedAttempts = 3, QTime timeFrame = QTime(0, 15, 0));
21 ~QXmppAttentionManager();
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
31 Q_SLOT QString requestAttention(const QString &jid, const QString &message = {});
32
33 Q_SIGNAL void attentionRequested(const QXmppMessage &message, bool isTrusted);
34 Q_SIGNAL void attentionRequestRateLimited(const QXmppMessage &message);
35
36protected:
37 void onRegistered(QXmppClient *client) override;
38 void onUnregistered(QXmppClient *client) override;
39
40private:
41 Q_SLOT void handleMessageReceived(const QXmppMessage &message);
42
43 const std::unique_ptr<QXmppAttentionManagerPrivate> d;
44};
45
46#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