File indexing completed on 2025-01-05 04:49:34

0001 /*
0002   SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-only
0005 */
0006 
0007 #pragma once
0008 
0009 #include "mailmergeplugin_private_export.h"
0010 #include <QWidget>
0011 class QComboBox;
0012 class QStackedWidget;
0013 
0014 namespace MailMerge
0015 {
0016 class CsvWidget;
0017 class AttachmentListWidget;
0018 class AddressBookWidget;
0019 class MAILMERGEPRIVATE_TESTS_EXPORT MailMergeWidget : public QWidget
0020 {
0021     Q_OBJECT
0022 public:
0023     enum SourceType {
0024         AddressBook = 0,
0025         CSV = 1,
0026     };
0027 
0028     explicit MailMergeWidget(QWidget *parent = nullptr);
0029     ~MailMergeWidget() override;
0030 
0031 Q_SIGNALS:
0032     void sourceModeChanged(MailMerge::MailMergeWidget::SourceType);
0033 
0034 private Q_SLOTS:
0035     void slotSourceChanged(int index);
0036 
0037 private:
0038     QComboBox *const mSource;
0039     QStackedWidget *const mStackedWidget;
0040     AttachmentListWidget *mAttachment = nullptr;
0041     MailMerge::CsvWidget *const mCsvWidget;
0042     MailMerge::AddressBookWidget *const mAddressbookWidget;
0043 };
0044 }