File indexing completed on 2024-05-12 05:17:13

0001 /*
0002     SPDX-FileCopyrightText: 2020 Daniel Vrátil <dvratil@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "kimap_export.h"
0010 
0011 #include "job.h"
0012 
0013 #include <QStringList>
0014 
0015 namespace KIMAP
0016 {
0017 class Session;
0018 struct Response;
0019 class EnableJobPrivate;
0020 
0021 /**
0022  * Job to enable additional IMAP capabilities.
0023  *
0024  * Requires server to implement the IMAP ENABLE Extension (RFC5161). The
0025  * new capabilities to enable will be specified by the user. The user is
0026  * responsible for making sure the capabilities are supported by the server.
0027  *
0028  * The example usecase for this job is to enable support for the QRESYNC
0029  * extension (RFC5162) on the server.
0030  *
0031  * @since 5.16
0032  */
0033 class KIMAP_EXPORT EnableJob : public Job
0034 {
0035     Q_OBJECT
0036     Q_DECLARE_PRIVATE(EnableJob)
0037 
0038     friend class SessionPrivate;
0039 
0040 public:
0041     explicit EnableJob(Session *session);
0042     ~EnableJob() override;
0043 
0044     /**
0045      * List of server capabilities to enable.
0046      */
0047     void setCapabilities(const QStringList &capabilities);
0048 
0049     /**
0050      * List of capabilities that were successfully enabled on the server.
0051      */
0052     [[nodiscard]] QStringList enabledCapabilities() const;
0053 
0054 protected:
0055     void doStart() override;
0056     void handleResponse(const Response &response) override;
0057 };
0058 
0059 }