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

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_GETQUOTAJOB_H
0021 #define KIMAP2_GETQUOTAJOB_H
0022 
0023 #include "quotajobbase.h"
0024 
0025 namespace KIMAP2
0026 {
0027 
0028 class Session;
0029 struct Message;
0030 class GetQuotaJobPrivate;
0031 
0032 /**
0033  * Gets resource limits for a quota root.
0034  *
0035  * Quotas are defined with respect to "resources" and "quota roots".
0036  * A resource is a numerical property that can be limited, such
0037  * as the octet size of all the messages in a mailbox, or the
0038  * number of messages in a mailbox.  Each mailbox has one or more
0039  * quota roots, which are where the resource limits are defined.
0040  * A quota root may or may not be a mailbox name, and an empty
0041  * string is a valid quota root.  All mailboxes with the same quota
0042  * root share the resource limits of the quota root.
0043  *
0044  * This job can only be run when the session is in the
0045  * authenticated (or selected) state.
0046  *
0047  * This job requires that the server supports the QUOTA
0048  * capability, defined in
0049  * <a href="http://www.apps.ietf.org/rfc/rfc2087.html">RFC 2087</a>.
0050  */
0051 class KIMAP2_EXPORT GetQuotaJob : public QuotaJobBase
0052 {
0053     Q_OBJECT
0054     Q_DECLARE_PRIVATE(GetQuotaJob)
0055 
0056     friend class SessionPrivate;
0057 
0058 public:
0059     explicit GetQuotaJob(Session *session);
0060     virtual ~GetQuotaJob();
0061 
0062     /**
0063      * Set the quota root to get the resource limits for.
0064      * @param root the quota root to set
0065      * @see GetQuotaRootJob
0066      */
0067     void setRoot(const QByteArray &root);
0068     /**
0069      * The quota root that resource limit information will be fetched for.
0070      */
0071     QByteArray root() const;
0072 
0073 protected:
0074     void doStart() Q_DECL_OVERRIDE;
0075     void handleResponse(const Message &response) Q_DECL_OVERRIDE;
0076 
0077 };
0078 
0079 }
0080 
0081 #endif