File indexing completed on 2025-01-19 04:47:00

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "adblockplugin_private_export.h"
0010 #include <QWidget>
0011 class QLineEdit;
0012 class LIBADBLOCKPLUGIN_TESTS_EXPORT AdblockPluginUrlInterceptorAddAdblockListWidget : public QWidget
0013 {
0014     Q_OBJECT
0015 public:
0016     struct LIBADBLOCKPLUGIN_TESTS_EXPORT AdBlockListInfo {
0017         QString name;
0018         QString url;
0019         [[nodiscard]] bool isValid() const;
0020         [[nodiscard]] bool operator==(const AdBlockListInfo &other) const;
0021         [[nodiscard]] bool operator!=(const AdBlockListInfo &other) const;
0022     };
0023 
0024     explicit AdblockPluginUrlInterceptorAddAdblockListWidget(QWidget *parent = nullptr);
0025     ~AdblockPluginUrlInterceptorAddAdblockListWidget() override;
0026 
0027     [[nodiscard]] AdblockPluginUrlInterceptorAddAdblockListWidget::AdBlockListInfo info() const;
0028     void setInfo(const AdblockPluginUrlInterceptorAddAdblockListWidget::AdBlockListInfo &adblockInfo);
0029 
0030 private:
0031     QLineEdit *const mName;
0032     QLineEdit *const mUrl;
0033 };
0034 LIBADBLOCKPLUGIN_TESTS_EXPORT QDebug operator<<(QDebug d, const AdblockPluginUrlInterceptorAddAdblockListWidget::AdBlockListInfo &t);