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

0001 /*
0002     identitydialog.h
0003 
0004     This file is part of KMail, the KDE mail client.
0005     SPDX-FileCopyrightText: 2002 Marc Mutz <mutz@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-only
0008 */
0009 
0010 #pragma once
0011 #include <QDialog>
0012 class QCheckBox;
0013 
0014 class KEditListWidget;
0015 class QComboBox;
0016 class QGroupBox;
0017 class KJob;
0018 class QLineEdit;
0019 class QPushButton;
0020 class QTabWidget;
0021 
0022 namespace GpgME
0023 {
0024 class Key;
0025 }
0026 namespace KIdentityManagementCore
0027 {
0028 class Identity;
0029 }
0030 namespace KIdentityManagementWidgets
0031 {
0032 class SignatureConfigurator;
0033 }
0034 namespace KMail
0035 {
0036 class XFaceConfigurator;
0037 }
0038 
0039 namespace MailCommon
0040 {
0041 class FolderRequester;
0042 }
0043 namespace Sonnet
0044 {
0045 class DictionaryComboBox;
0046 }
0047 
0048 namespace MailTransport
0049 {
0050 class TransportComboBox;
0051 }
0052 
0053 namespace TemplateParser
0054 {
0055 class TemplatesConfiguration;
0056 }
0057 namespace TextAutoCorrectionWidgets
0058 {
0059 class AutoCorrectionLanguage;
0060 }
0061 
0062 namespace KMail
0063 {
0064 class IdentityFolderRequester;
0065 class IdentityInvalidFolder;
0066 class KeySelectionCombo;
0067 
0068 class IdentityDialog : public QDialog
0069 {
0070     Q_OBJECT
0071 public:
0072     explicit IdentityDialog(QWidget *parent = nullptr);
0073     ~IdentityDialog() override;
0074 
0075     void setIdentity(/*_not_ const*/ KIdentityManagementCore::Identity &ident);
0076 
0077     void updateIdentity(KIdentityManagementCore::Identity &ident);
0078 
0079 private:
0080     void slotAboutToShow(int);
0081     // copy default templates to identity templates
0082     void slotCopyGlobal();
0083     void slotAccepted();
0084     void slotDelayedButtonClicked(KJob *);
0085     void slotEditVcard();
0086     void slotRefreshDefaultDomainName();
0087     void slotVCardRemoved();
0088     void slotHelp();
0089 
0090     [[nodiscard]] bool keyMatchesEmailAddress(const GpgME::Key &key, const QString &email);
0091     [[nodiscard]] bool checkFolderExists(const QString &folder);
0092     void updateVcardButton();
0093     void editVcard(const QString &filename);
0094     void unregisterSpecialCollection(qint64 id);
0095 
0096     QString mVcardFilename;
0097 
0098     // "general" tab:
0099     QLineEdit *mNameEdit = nullptr;
0100     QLineEdit *mOrganizationEdit = nullptr;
0101     QLineEdit *mEmailEdit = nullptr;
0102     KEditListWidget *mAliasEdit = nullptr;
0103     // "cryptography" tab:
0104     QWidget *mCryptographyTab = nullptr;
0105     KeySelectionCombo *mPGPSigningKeyRequester = nullptr;
0106     KeySelectionCombo *mPGPEncryptionKeyRequester = nullptr;
0107     KeySelectionCombo *mSMIMESigningKeyRequester = nullptr;
0108     KeySelectionCombo *mSMIMEEncryptionKeyRequester = nullptr;
0109     QComboBox *mPreferredCryptoMessageFormat = nullptr;
0110     QGroupBox *mAutocrypt = nullptr;
0111     QCheckBox *mAutocryptPrefer = nullptr;
0112     QGroupBox *mOverrideDefault = nullptr;
0113     QCheckBox *mPGPSameKey = nullptr;
0114     QCheckBox *mAutoSign = nullptr;
0115     QCheckBox *mAutoEncrypt = nullptr;
0116     QCheckBox *mWarnNotEncrypt = nullptr;
0117     QCheckBox *mWarnNotSign = nullptr;
0118     // "advanced" tab:
0119     QLineEdit *mReplyToEdit = nullptr;
0120     QLineEdit *mBccEdit = nullptr;
0121     QLineEdit *mCcEdit = nullptr;
0122     Sonnet::DictionaryComboBox *mDictionaryCombo = nullptr;
0123     IdentityFolderRequester *mFccFolderRequester = nullptr;
0124     QCheckBox *mSentMailFolderCheck = nullptr;
0125     IdentityFolderRequester *mDraftsFolderRequester = nullptr;
0126     IdentityFolderRequester *mTemplatesFolderRequester = nullptr;
0127     QCheckBox *mTransportCheck = nullptr;
0128     MailTransport::TransportComboBox *mTransportCombo = nullptr;
0129     QCheckBox *mAttachMyVCard = nullptr;
0130     QPushButton *mEditVCard = nullptr;
0131     TextAutoCorrectionWidgets::AutoCorrectionLanguage *mAutoCorrectionLanguage = nullptr;
0132     QLineEdit *mDefaultDomainEdit = nullptr;
0133 
0134     // "templates" tab:
0135     TemplateParser::TemplatesConfiguration *mWidget = nullptr;
0136     QCheckBox *mCustom = nullptr;
0137     QPushButton *mCopyGlobal = nullptr;
0138     // "signature" tab:
0139     KIdentityManagementWidgets::SignatureConfigurator *mSignatureConfigurator = nullptr;
0140     // "X-Face" tab:
0141     KMail::XFaceConfigurator *mXFaceConfigurator = nullptr;
0142     QTabWidget *mTabWidget = nullptr;
0143     IdentityInvalidFolder *mIdentityInvalidFolder = nullptr;
0144 };
0145 } // namespace KMail