File indexing completed on 2024-12-22 05:05:24
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "exportimportutil.h" 0010 0011 #include "mail/importmailjobinterface.h" 0012 0013 class ImportMailJobInterfaceTestImpl : public ImportMailJobInterface, public ExportImportUtil 0014 { 0015 Q_OBJECT 0016 public: 0017 explicit ImportMailJobInterfaceTestImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep); 0018 ~ImportMailJobInterfaceTestImpl() override; 0019 void start() override; 0020 void setExistingPathConfig(const QString &path); 0021 0022 protected: 0023 [[nodiscard]] Akonadi::Collection::Id convertFolderPathToCollectionId(const QString &path) override; 0024 void synchronizeResource(const QStringList &lst) override; 0025 0026 [[nodiscard]] QString 0027 createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree = false) override; 0028 void registerSpecialCollection(Akonadi::SpecialMailCollections::Type type, qint64 colId) override; 0029 void importFilters(const QString &filename) override; 0030 0031 [[nodiscard]] QString adaptResourcePath(const KSharedConfigPtr &resourceConfig, const QString &storedData) override; 0032 [[nodiscard]] QString adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath) override; 0033 void addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid) override; 0034 void importCustomMailTransport(const QString &identifierValue, const KConfigGroup &group, int defaultTransport, int transportId) override; 0035 void importSmtpMailTransport(const SmtpMailTransport &smtpMailTransport, int defaultTransport, int transportId) override; 0036 [[nodiscard]] QString configLocation() const override; 0037 void importFolderAttributes() override final; 0038 0039 private: 0040 [[nodiscard]] QString uniqueIdentityName(const QString &name); 0041 uint mIdentityUoid = 1; 0042 uint mMailTransportId = 1; 0043 QString mExistingPathConfig; 0044 };