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 class DeleteJobPrivate; 0017 0018 /** 0019 * Delete a mailbox 0020 * 0021 * Note that some servers will refuse to delete a 0022 * mailbox unless it is empty (ie: all mails have 0023 * had their \Deleted flag set, and then the 0024 * mailbox has been expunged). 0025 * 0026 * This job can only be run when the session is in the 0027 * authenticated (or selected) state. 0028 * 0029 * If the server supports ACLs, you will need the 0030 * Acl::DeleteMailbox right on the mailbox. 0031 */ 0032 class KIMAP_EXPORT DeleteJob : public Job 0033 { 0034 Q_OBJECT 0035 Q_DECLARE_PRIVATE(DeleteJob) 0036 0037 friend class SessionPrivate; 0038 0039 public: 0040 explicit DeleteJob(Session *session); 0041 ~DeleteJob() override; 0042 0043 /** 0044 * Set the mailbox to delete. 0045 */ 0046 void setMailBox(const QString &mailBox); 0047 /** 0048 * The mailbox that will be deleted. 0049 */ 0050 [[nodiscard]] QString mailBox() const; 0051 0052 protected: 0053 void doStart() override; 0054 void handleResponse(const Response &response) override; 0055 }; 0056 0057 }