File indexing completed on 2025-01-05 04:58:20
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 0006 */ 0007 0008 #pragma once 0009 0010 #include "pimcommonakonadi_private_export.h" 0011 #include <QWidget> 0012 class QPushButton; 0013 class QLineEdit; 0014 class QLabel; 0015 class KListWidgetSearchLine; 0016 namespace PimCommon 0017 { 0018 class BlackListBalooEmailList; 0019 class BlackListBalooEmailWarning; 0020 class PIMCOMMONAKONADI_TESTS_EXPORT BlackListBalooEmailCompletionWidget : public QWidget 0021 { 0022 Q_OBJECT 0023 public: 0024 explicit BlackListBalooEmailCompletionWidget(QWidget *parent = nullptr); 0025 ~BlackListBalooEmailCompletionWidget() override; 0026 0027 void save(); 0028 void load(); 0029 void setEmailBlackList(const QStringList &list); 0030 0031 private: 0032 void slotSelectionChanged(); 0033 void slotUnselectEmails(); 0034 void slotSelectEmails(); 0035 void slotSearchLineEditChanged(const QString &text); 0036 void slotSearch(); 0037 void slotLinkClicked(const QString &link); 0038 void slotEmailFound(const QStringList &list); 0039 void slotCheckIfUpdateBlackListIsNeeded(); 0040 void slotSaveChanges(); 0041 void slotShowAllBlacklistedEmail(); 0042 void hideMoreResultAndChangeLimit(); 0043 void slotCustomContextMenuRequested(const QPoint &pos); 0044 QStringList mOriginalExcludeDomain; 0045 QStringList mOriginalExcludeEmailRegexp; 0046 QLabel *const mNumberOfEmailsFound; 0047 QLineEdit *const mSearchLineEdit; 0048 QLineEdit *const mExcludeDomainLineEdit; 0049 BlackListBalooEmailList *const mEmailList; 0050 QPushButton *const mSearchButton; 0051 QPushButton *const mSelectButton; 0052 QPushButton *const mUnselectButton; 0053 QPushButton *const mShowAllBlackListedEmails; 0054 QLabel *const mMoreResult; 0055 KListWidgetSearchLine *mSearchInResultLineEdit = nullptr; 0056 BlackListBalooEmailWarning *const mBlackListWarning; 0057 QLineEdit *const mExcludeEmailFromRegularExpressionLineEdit; 0058 int mLimit = 500; 0059 }; 0060 }