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

0001 /*
0002     SPDX-FileCopyrightText: 2009 Andras Mantia <amantia@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 namespace KIMAP
0014 {
0015 class Session;
0016 struct Response;
0017 class ImapSet;
0018 class ExpungeJobPrivate;
0019 
0020 /**
0021  * Expunges the deleted messages in the selected mailbox.
0022  *
0023  * This permanently removes any messages that have the
0024  * \Deleted flag set in the selected mailbox.
0025  *
0026  * This job can only be run when the session is in the
0027  * selected state.
0028  *
0029  * If the server supports ACLs, the user will need the
0030  * Acl::Expunge right on the mailbox.
0031  */
0032 class KIMAP_EXPORT ExpungeJob : public Job
0033 {
0034     Q_OBJECT
0035     Q_DECLARE_PRIVATE(ExpungeJob)
0036 
0037     friend class SessionPrivate;
0038 
0039 public:
0040     explicit ExpungeJob(Session *session);
0041     ~ExpungeJob() override = default;
0042 
0043     /**
0044      * Returns UIDs of messages that have been expunged.
0045      *
0046      * This feature is only available when QRESYNC capability (RFC5162) is
0047      * supported by the server and have been enabled on the current session.
0048      *
0049      * @see KIMAP::EnableJob
0050      * @since 5.16
0051      */
0052     [[nodiscard]] KIMAP::ImapSet vanishedMessages() const;
0053 
0054     /**
0055      * Returns new highest modification sequence number.
0056      *
0057      * This feature is only available when QRESYNC capability (RFC5162) is
0058      * supported by the server and have been enabled on the current session.
0059      *
0060      * @see KIMAP::EnableJob
0061      * @since 5.16
0062      */
0063     [[nodiscard]] quint64 newHighestModSeq() const;
0064 
0065 protected:
0066     void doStart() override;
0067     void handleResponse(const Response &response) override;
0068 };
0069 
0070 }