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

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 "acl.h"
0012 #include "job.h"
0013 
0014 namespace KIMAP
0015 {
0016 class Session;
0017 struct Response;
0018 class AclJobBasePrivate;
0019 
0020 /**
0021  * Base class for jobs that operate on mailbox ACLs
0022  *
0023  * Provides support for the IMAP ACL extension, as defined by
0024  * <a href="https://tools.ietf.org/html/rfc4314" title="IMAP ACL extension">RFC 4314</a>.
0025  *
0026  * This class cannot be used directly, you must subclass it and reimplement
0027  * at least the doStart() method.
0028  */
0029 class KIMAP_EXPORT AclJobBase : public Job
0030 {
0031     Q_OBJECT
0032     Q_DECLARE_PRIVATE(AclJobBase)
0033 
0034     friend class SessionPrivate;
0035 
0036 public:
0037     AclJobBase(Session *session);
0038     ~AclJobBase() override;
0039 
0040     /**
0041      * Used when subclassing to specify how the ACL will be modified.
0042      */
0043     enum AclModifier { Add = 0, Remove, Change };
0044 
0045     /**
0046      * Set the mailbox to act on
0047      *
0048      * @param mailBox  the name of an existing mailbox
0049      */
0050     void setMailBox(const QString &mailBox);
0051     /**
0052      * The mailbox that will be acted upon.
0053      */
0054     [[nodiscard]] QString mailBox() const;
0055 
0056 protected:
0057     explicit AclJobBase(JobPrivate &dd);
0058 };
0059 
0060 }