File indexing completed on 2024-05-19 05:17:41
0001 /* 0002 Copyright (c) 2009 Andras Mantia <amantia@kde.org> 0003 0004 This library is free software; you can redistribute it and/or modify it 0005 under the terms of the GNU Library General Public License as published by 0006 the Free Software Foundation; either version 2 of the License, or (at your 0007 option) any later version. 0008 0009 This library is distributed in the hope that it will be useful, but WITHOUT 0010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 0012 License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this library; see the file COPYING.LIB. If not, write to the 0016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 0017 02110-1301, USA. 0018 */ 0019 0020 #ifndef KIMAP2_DELETEJOB_H 0021 #define KIMAP2_DELETEJOB_H 0022 0023 #include "kimap2_export.h" 0024 0025 #include "job.h" 0026 0027 namespace KIMAP2 0028 { 0029 0030 class Session; 0031 class DeleteJobPrivate; 0032 0033 /** 0034 * Delete a mailbox 0035 * 0036 * Note that some servers will refuse to delete a 0037 * mailbox unless it is empty (ie: all mails have 0038 * had their \Deleted flag set, and then the 0039 * mailbox has been expunged). 0040 * 0041 * This job can only be run when the session is in the 0042 * authenticated (or selected) state. 0043 * 0044 * If the server supports ACLs, you will need the 0045 * Acl::DeleteMailbox right on the mailbox. 0046 */ 0047 class KIMAP2_EXPORT DeleteJob : public Job 0048 { 0049 Q_OBJECT 0050 Q_DECLARE_PRIVATE(DeleteJob) 0051 0052 friend class SessionPrivate; 0053 0054 public: 0055 explicit DeleteJob(Session *session); 0056 virtual ~DeleteJob(); 0057 0058 /** 0059 * Set the mailbox to delete. 0060 */ 0061 void setMailBox(const QString &mailBox); 0062 /** 0063 * The mailbox that will be deleted. 0064 */ 0065 QString mailBox() const; 0066 0067 protected: 0068 void doStart() override; 0069 void handleResponse(const Message &response) override; 0070 }; 0071 0072 } 0073 0074 #endif