/* SPDX-FileCopyrightText: 2016-2020 Laurent Montel SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef KADDRESSBOOKIMPORTEXPORTPLUGININTERFACE_H #define KADDRESSBOOKIMPORTEXPORTPLUGININTERFACE_H #include "kaddressbook_importexport_export.h" #include #include #include class QItemSelectionModel; namespace KAddressBookImportExport { /** Import/export plugin interface. */ class KADDRESSBOOK_IMPORTEXPORT_EXPORT KAddressBookImportExportPluginInterface : public PimCommon::AbstractGenericPluginInterface { Q_OBJECT public: explicit KAddressBookImportExportPluginInterface(QObject *parent = nullptr); ~KAddressBookImportExportPluginInterface(); enum ImportExportAction { Import = 0, Export = 1 }; Q_REQUIRED_RESULT QList importActions() const; void setImportActions(const QList &importAction); Q_REQUIRED_RESULT QList exportActions() const; void setExportActions(const QList &exportAction); Q_REQUIRED_RESULT ImportExportAction importExportAction() const; void setImportExportAction(ImportExportAction importExportAction); Q_REQUIRED_RESULT Akonadi::Collection defaultCollection() const; void setDefaultCollection(const Akonadi::Collection &defaultCollection); void setSelectionModel(QItemSelectionModel *model); Q_REQUIRED_RESULT QItemSelectionModel *itemSelectionModel() const; void setItemSelectionModel(QItemSelectionModel *itemSelectionModel); Q_REQUIRED_RESULT virtual bool canImportFileType(const QUrl &url); virtual void importFile(const QUrl &url); Q_REQUIRED_RESULT virtual bool canImportData() const; virtual void importData(const QByteArray &data); protected: QList mImportActions; QList mExportActions; ImportExportAction mImportExportAction = Import; Akonadi::Collection mDefaultCollection; QItemSelectionModel *mItemSelectionModel = nullptr; }; } #endif // KADDRESSBOOKIMPORTEXPORTPLUGININTERFACE_H