File indexing completed on 2024-05-12 16:27:34

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolawidgets_private_export.h"
0010 #include <KMessageWidget>
0011 class QTimer;
0012 class LIBRUQOLAWIDGETS_TESTS_EXPORT ReconnectInfoWidget : public KMessageWidget
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit ReconnectInfoWidget(QWidget *parent = nullptr);
0017     ~ReconnectInfoWidget() override;
0018 
0019     [[nodiscard]] int reconnectSecondDelay() const;
0020     void setReconnectSecondDelay(int newReconnectDelay);
0021 
0022 Q_SIGNALS:
0023     void tryReconnect();
0024 
0025 private:
0026     LIBRUQOLAWIDGETS_NO_EXPORT void updateText();
0027     LIBRUQOLAWIDGETS_NO_EXPORT void slotUpdateTimer();
0028     LIBRUQOLAWIDGETS_NO_EXPORT void slotLinkActivated(const QString &contents);
0029     QTimer *const mDelayTimer;
0030     int mCurrentDelay = -1;
0031     int mReconnectSecondDelay = -1;
0032 };