File indexing completed on 2024-12-22 05:01:10

0001 /*
0002  *   kmail: KDE mail client
0003  *   SPDX-FileCopyrightText: 2000 Espen Sand <espen@kde.org>
0004  *   SPDX-FileCopyrightText: 2001-2003 Marc Mutz <mutz@kde.org>
0005  *   Contains code segments and ideas from earlier kmail dialog code.
0006  *   SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
0007  *
0008  *   SPDX-License-Identifier: GPL-2.0-or-later
0009  *
0010  */
0011 
0012 #pragma once
0013 
0014 #include <QDialog>
0015 
0016 class QComboBox;
0017 class QLineEdit;
0018 class QButtonGroup;
0019 
0020 namespace KIdentityManagementCore
0021 {
0022 class IdentityManager;
0023 }
0024 
0025 namespace KMail
0026 {
0027 class NewIdentityDialog : public QDialog
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     enum DuplicateMode {
0033         Empty = 0,
0034         ControlCenter,
0035         ExistingEntry,
0036     };
0037     explicit NewIdentityDialog(KIdentityManagementCore::IdentityManager *manager, QWidget *parent = nullptr);
0038 
0039     [[nodiscard]] QString identityName() const;
0040     [[nodiscard]] QString duplicateIdentity() const;
0041     [[nodiscard]] DuplicateMode duplicateMode() const;
0042 
0043 private:
0044     void slotHelp();
0045     void slotEnableOK(const QString &);
0046     QLineEdit *mLineEdit = nullptr;
0047     QComboBox *mComboBox = nullptr;
0048     QButtonGroup *mButtonGroup = nullptr;
0049     KIdentityManagementCore::IdentityManager *const mIdentityManager;
0050     QPushButton *mOkButton = nullptr;
0051 };
0052 }