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

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_CLOSEJOB_H
0021 #define KIMAP2_CLOSEJOB_H
0022 
0023 #include "kimap2_export.h"
0024 
0025 #include "job.h"
0026 
0027 namespace KIMAP2
0028 {
0029 
0030 class Session;
0031 struct Message;
0032 class CloseJobPrivate;
0033 
0034 /**
0035  * Closes the current mailbox.
0036  *
0037  * This job can only be run when the session is in the selected state.
0038  *
0039  * Permanently removes all messages that have the \\Deleted
0040  * flag set from the currently selected mailbox, and returns
0041  * to the authenticated state from the selected state.
0042  *
0043  * The server will not provide any notifications of which
0044  * messages were expunged, so this is quicker than doing
0045  * an expunge and then implicitly closing the mailbox
0046  * (by selecting or examining another mailbox or logging
0047  * out).
0048  *
0049  * No messages are removed if the mailbox is open in a read-only
0050  * state, or if the server supports ACLs and the user does not
0051  * have the Acl::Expunge right on the mailbox.
0052  */
0053 class KIMAP2_EXPORT CloseJob : public Job
0054 {
0055     Q_OBJECT
0056     Q_DECLARE_PRIVATE(CloseJob)
0057 
0058     friend class SessionPrivate;
0059 
0060 public:
0061     explicit CloseJob(Session *session);
0062     virtual ~CloseJob();
0063 
0064 protected:
0065     void doStart() Q_DECL_OVERRIDE;
0066 };
0067 
0068 }
0069 
0070 #endif