File indexing completed on 2025-01-05 04:49:50

0001 /*
0002    SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KSieveCore/SieveImapAccountSettings>
0010 #include <QObject>
0011 class KJob;
0012 namespace KIMAP
0013 {
0014 class Session;
0015 }
0016 class SelectImapCreateFolderJob : public QObject
0017 {
0018     Q_OBJECT
0019 public:
0020     explicit SelectImapCreateFolderJob(QObject *parent = nullptr);
0021     ~SelectImapCreateFolderJob() override;
0022     void start();
0023     void setSieveImapAccountSettings(const KSieveCore::SieveImapAccountSettings &account);
0024 
0025     void setNewFolderName(const QString &newFolderName);
0026 
0027 Q_SIGNALS:
0028     void finished(const KSieveCore::SieveImapAccountSettings &account, bool success);
0029 
0030 private:
0031     void createFolderRequested();
0032     void slotCreateFolderDone(KJob *job);
0033     void slotLoginDone(KJob *job);
0034     void failed();
0035     KSieveCore::SieveImapAccountSettings mSieveImapAccount;
0036     QString mNewFolderName;
0037     KIMAP::Session *mSession = nullptr;
0038 };