File indexing completed on 2024-11-24 04:39:32

0001 /*
0002     This file is part of Contact Editor.
0003 
0004     SPDX-FileCopyrightText: 2010 Tobias Koenig <tokoe@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #pragma once
0010 
0011 #include "displaynameeditwidget.h"
0012 #include <QDialog>
0013 
0014 #include <KContacts/Addressee>
0015 
0016 class KLineEdit;
0017 class KComboBox;
0018 namespace Akonadi
0019 {
0020 class DisplayNameEditWidget;
0021 class NameEditDialog : public QDialog
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit NameEditDialog(QWidget *parent = nullptr);
0026 
0027     void setFamilyName(const QString &name);
0028     [[nodiscard]] QString familyName() const;
0029 
0030     void setGivenName(const QString &name);
0031     [[nodiscard]] QString givenName() const;
0032 
0033     void setPrefix(const QString &prefix);
0034     [[nodiscard]] QString prefix() const;
0035 
0036     void setSuffix(const QString &suffix);
0037     [[nodiscard]] QString suffix() const;
0038 
0039     void setAdditionalName(const QString &name);
0040     [[nodiscard]] QString additionalName() const;
0041 
0042     void loadContact(const KContacts::Addressee &contact);
0043     void storeContact(KContacts::Addressee &contact) const;
0044 
0045     void setDisplayType(DisplayNameEditWidget::DisplayType type);
0046     [[nodiscard]] DisplayNameEditWidget::DisplayType displayType() const;
0047 
0048 private:
0049     KComboBox *mSuffixCombo = nullptr;
0050     KComboBox *mPrefixCombo = nullptr;
0051     KLineEdit *mFamilyNameEdit = nullptr;
0052     KLineEdit *mGivenNameEdit = nullptr;
0053     KLineEdit *mAdditionalNameEdit = nullptr;
0054     DisplayNameEditWidget *mDisplayNameEdit = nullptr;
0055 };
0056 }