File indexing completed on 2024-12-22 04:45:43

0001 /*
0002    SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "administratorsettingsdialog/settingswidgetbase.h"
0010 #include "libruqolawidgets_private_export.h"
0011 class QCheckBox;
0012 class QSpinBox;
0013 class LIBRUQOLAWIDGETS_TESTS_EXPORT RateLimiterWidget : public SettingsWidgetBase
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit RateLimiterWidget(RocketChatAccount *account, QWidget *parent = nullptr);
0018     ~RateLimiterWidget() override;
0019     void initialize(const QMap<QString, QVariant> &mapSettings) override;
0020 
0021 private:
0022     QCheckBox *const mEnableRateLimiter;
0023 
0024     QCheckBox *const mLimitByIP;
0025     QSpinBox *const mLimiteByIpRequestsAllowed;
0026     QSpinBox *const mLimiteByIpIntervalTime;
0027 
0028     QCheckBox *const mLimitByUser;
0029     QSpinBox *const mLimiteByUserRequestsAllowed;
0030     QSpinBox *const mLimiteByUserIntervalTime;
0031 
0032     QCheckBox *const mLimitByConnection;
0033     QSpinBox *const mLimiteByConnectionRequestsAllowed;
0034     QSpinBox *const mLimiteByConnectionIntervalTime;
0035 
0036     QCheckBox *const mLimitByUserPerMethod;
0037     QSpinBox *const mLimiteByUserRequestsAllowedPerMethod;
0038     QSpinBox *const mLimiteByUserIntervalTimePerMethod;
0039 
0040     QCheckBox *const mLimitByConnectionPerMethod;
0041     QSpinBox *const mLimiteByConnectionRequestsAllowedPerMethod;
0042     QSpinBox *const mLimiteByConnectionIntervalTimePerMethod;
0043 };