KIMAP

closejob.h
1 /*
2  SPDX-FileCopyrightText: 2009 Andras Mantia <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "kimap_export.h"
10 
11 #include "job.h"
12 
13 namespace KIMAP
14 {
15 class Session;
16 struct Response;
17 class CloseJobPrivate;
18 
19 /**
20  * Closes the current mailbox.
21  *
22  * This job can only be run when the session is in the selected state.
23  *
24  * Permanently removes all messages that have the \\Deleted
25  * flag set from the currently selected mailbox, and returns
26  * to the authenticated state from the selected state.
27  *
28  * The server will not provide any notifications of which
29  * messages were expunged, so this is quicker than doing
30  * an expunge and then implicitly closing the mailbox
31  * (by selecting or examining another mailbox or logging
32  * out). If the QRESYNC extension (RFC5162) is available on the
33  * server and has been enabled, the job will provide a new
34  * modification sequence after expunging the deleted messages.
35  *
36  * No messages are removed if the mailbox is open in a read-only
37  * state, or if the server supports ACLs and the user does not
38  * have the Acl::Expunge right on the mailbox.
39  */
40 class KIMAP_EXPORT CloseJob : public Job
41 {
42  Q_OBJECT
43  Q_DECLARE_PRIVATE(CloseJob)
44 
45  friend class SessionPrivate;
46 
47 public:
48  explicit CloseJob(Session *session);
49  ~CloseJob() override = default;
50 
51  /**
52  * Returns new modification sequence number after expunging messages.
53  *
54  * This value is only valid when server supports the QRESYNC extension
55  * (RFC5162) and it has been explicitly enabled on this session.
56  *
57  * @see KIMAP::EnableJob
58  * @since 5.16
59  */
60  [[nodiscard]] quint64 newHighestModSeq() const;
61 
62 protected:
63  void doStart() override;
64  void handleResponse(const Response &response) override;
65 };
66 
67 }
Closes the current mailbox.
Definition: closejob.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 03:51:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.