File indexing completed on 2025-01-05 04:58:19

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 #include "pimcommonakonadi_private_export.h"
0010 #include <QRegularExpression>
0011 #include <QStringList>
0012 namespace PimCommon
0013 {
0014 class PIMCOMMONAKONADI_TESTS_EXPORT BalooCompletionEmail
0015 {
0016 public:
0017     BalooCompletionEmail();
0018     struct BalooCompletionEmailInfo {
0019         QStringList mListEmail;
0020         QStringList mExcludeDomains;
0021         QStringList mBlackList;
0022         QStringList mExcludeEmailsRegularExpressions;
0023     };
0024 
0025     [[nodiscard]] QStringList cleanupEmailList();
0026 
0027     [[nodiscard]] BalooCompletionEmailInfo balooCompletionEmailInfo() const;
0028     void setBalooCompletionEmailInfo(const BalooCompletionEmailInfo &newBalooCompletionEmailInfo);
0029 
0030 private:
0031     [[nodiscard]] QString stripEmail(const QString &email, QString &address);
0032     BalooCompletionEmailInfo mBalooCompletionEmailInfo;
0033     static QList<QRegularExpression> mExcludeEmailsRegularExpressions;
0034 };
0035 }