File indexing completed on 2025-01-19 04:46:42

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <Akonadi/Collection>
0010 #include <MessageComposer/PluginEditorCheckBeforeSendInterface>
0011 
0012 class AutomaticAddContactsInterface : public MessageComposer::PluginEditorCheckBeforeSendInterface
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit AutomaticAddContactsInterface(QObject *parent = nullptr);
0017     ~AutomaticAddContactsInterface() override;
0018 
0019     [[nodiscard]] bool exec(const MessageComposer::PluginEditorCheckBeforeSendParams &params) override;
0020 
0021 public Q_SLOTS:
0022     void reloadConfig() override;
0023 
0024 private:
0025     struct AutomaticAddContactsSettings {
0026         AutomaticAddContactsSettings()
0027             : mContactCollection(Akonadi::Collection(-1))
0028         {
0029         }
0030 
0031         bool mEnabled = false;
0032         Akonadi::Collection mContactCollection;
0033     };
0034     QHash<uint, AutomaticAddContactsSettings> mHashSettings;
0035 };