File indexing completed on 2024-11-24 04:43:04
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 0009 #include "job/mergecontacts.h" 0010 #include "kaddressbookmergelib_export.h" 0011 #include <Akonadi/Item> 0012 #include <QWidget> 0013 0014 class QPushButton; 0015 namespace Akonadi 0016 { 0017 class CollectionComboBox; 0018 } 0019 namespace KABMergeContacts 0020 { 0021 class MergeContactWidgetList; 0022 class MergeContactLoseInformationWarning; 0023 class MergeContactInfoWidget; 0024 class KADDRESSBOOKMERGELIB_EXPORT MergeContactWidget : public QWidget 0025 { 0026 Q_OBJECT 0027 public: 0028 explicit MergeContactWidget(QWidget *parent = nullptr); 0029 ~MergeContactWidget() override; 0030 0031 void setContacts(const Akonadi::Item::List &items); 0032 0033 Q_SIGNALS: 0034 void customizeMergeContact(const Akonadi::Item::List &lst, MergeContacts::ConflictInformations conflictType, const Akonadi::Collection &col); 0035 void contactMerged(const Akonadi::Item &item); 0036 0037 private: 0038 void slotUpdateMergeButton(); 0039 void slotMergeContacts(); 0040 void slotAutomaticMerging(); 0041 void slotCustomizeMergingContacts(); 0042 void slotMergeDone(const Akonadi::Item &item); 0043 Akonadi::Item::List listSelectedContacts() const; 0044 Akonadi::Item currentItem() const; 0045 MergeContacts::ConflictInformations mConflictTypes; 0046 Akonadi::Item::List mSelectedItems; 0047 Akonadi::Item::List mItems; 0048 MergeContactWidgetList *const mListWidget; 0049 QPushButton *const mMergeButton; 0050 Akonadi::CollectionComboBox *mCollectionCombobox = nullptr; 0051 MergeContactLoseInformationWarning *const mMergeContactWarning; 0052 MergeContactInfoWidget *const mMergeContactInfoWidget; 0053 }; 0054 }