File indexing completed on 2024-12-22 04:52:47

0001 /*
0002    SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstractbase.h"
0010 #include "libimportwizard_export.h"
0011 #include <Akonadi/Collection>
0012 
0013 namespace KContacts
0014 {
0015 class Addressee;
0016 class ContactGroup;
0017 }
0018 
0019 class KJob;
0020 namespace LibImportWizard
0021 {
0022 class LIBIMPORTWIZARD_EXPORT AbstractAddressBook : public LibImportWizard::AbstractBase
0023 {
0024     Q_OBJECT
0025 public:
0026     AbstractAddressBook();
0027     ~AbstractAddressBook() override;
0028 
0029 protected:
0030     void createGroup(const KContacts::ContactGroup &group);
0031     void createContact(const KContacts::Addressee &address);
0032 
0033     void addImportInfo(const QString &log) override;
0034     void addImportError(const QString &log) override;
0035 
0036     void addAddressBookImportInfo(const QString &log);
0037     void addAddressBookImportError(const QString &log);
0038     void cleanUp();
0039     void addImportContactNote(KContacts::Addressee &address, const QString &applicationName);
0040 
0041 private:
0042     LIBIMPORTWIZARD_NO_EXPORT void slotStoreDone(KJob *job);
0043     LIBIMPORTWIZARD_NO_EXPORT bool selectAddressBook();
0044     Akonadi::Collection mCollection;
0045 };
0046 }