File indexing completed on 2024-12-22 04:56:53

0001 /*
0002     SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "config-newmailnotifier.h"
0009 #include <Akonadi/AgentConfigurationBase>
0010 #include <Akonadi/Collection>
0011 
0012 class KNotifyConfigWidget;
0013 class QCheckBox;
0014 class QLineEdit;
0015 class QComboBox;
0016 class NewMailNotifierSelectCollectionWidget;
0017 class NewMailNotifierSettingsWidget : public Akonadi::AgentConfigurationBase
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit NewMailNotifierSettingsWidget(const KSharedConfigPtr &config, QWidget *parent, const QVariantList &args);
0022     ~NewMailNotifierSettingsWidget() override;
0023 
0024     void load() override;
0025     bool save() const override;
0026 
0027 private:
0028     void slotHelpLinkClicked(const QString &);
0029     void updateReplyMail(bool enabled);
0030     QCheckBox *mShowPhoto = nullptr;
0031     QCheckBox *mShowFrom = nullptr;
0032     QCheckBox *mShowSubject = nullptr;
0033     QCheckBox *mShowFolders = nullptr;
0034     QCheckBox *mExcludeMySelf = nullptr;
0035     QCheckBox *mAllowToShowMail = nullptr;
0036     QCheckBox *mKeepPersistentNotification = nullptr;
0037     KNotifyConfigWidget *mNotify = nullptr;
0038 #if HAVE_TEXT_TO_SPEECH_SUPPORT
0039     QCheckBox *mTextToSpeak = nullptr;
0040     QLineEdit *mTextToSpeakSetting = nullptr;
0041 #endif
0042     QCheckBox *mReplyMail = nullptr;
0043     QComboBox *mReplyMailTypeComboBox = nullptr;
0044     NewMailNotifierSelectCollectionWidget *const mSelectCollection;
0045 };
0046 
0047 AKONADI_AGENTCONFIG_FACTORY(NewMailNotifierSettingsFactory, "newmailnotifierconfig.json", NewMailNotifierSettingsWidget)