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 "quotajobbase.h"
0010 
0011 namespace KIMAP
0012 {
0013 class Session;
0014 struct Message;
0015 class GetQuotaJobPrivate;
0016 
0017 /**
0018  * Gets resource limits for a quota root.
0019  *
0020  * Quotas are defined with respect to "resources" and "quota roots".
0021  * A resource is a numerical property that can be limited, such
0022  * as the octet size of all the messages in a mailbox, or the
0023  * number of messages in a mailbox.  Each mailbox has one or more
0024  * quota roots, which are where the resource limits are defined.
0025  * A quota root may or may not be a mailbox name, and an empty
0026  * string is a valid quota root.  All mailboxes with the same quota
0027  * root share the resource limits of the quota root.
0028  *
0029  * This job can only be run when the session is in the
0030  * authenticated (or selected) state.
0031  *
0032  * This job requires that the server supports the QUOTA
0033  * capability, defined in
0034  * <a href="https://tools.ietf.org/html/rfc2087">RFC 2087</a>.
0035  */
0036 class KIMAP_EXPORT GetQuotaJob : public QuotaJobBase
0037 {
0038     Q_OBJECT
0039     Q_DECLARE_PRIVATE(GetQuotaJob)
0040 
0041     friend class SessionPrivate;
0042 
0043 public:
0044     explicit GetQuotaJob(Session *session);
0045     ~GetQuotaJob() override;
0046 
0047     /**
0048      * Set the quota root to get the resource limits for.
0049      * @param root the quota root to set
0050      * @see GetQuotaRootJob
0051      */
0052     void setRoot(const QByteArray &root);
0053     /**
0054      * The quota root that resource limit information will be fetched for.
0055      */
0056     [[nodiscard]] QByteArray root() const;
0057 
0058 protected:
0059     void doStart() override;
0060     void handleResponse(const Response &response) override;
0061 };
0062 
0063 }