1/*
2 Copyright (c) 2009 Andras Mantia <amantia@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef KIMAP_GETQUOTAJOB_H
21#define KIMAP_GETQUOTAJOB_H
22
23#include "quotajobbase.h"
24
25namespace KIMAP {
26
27class Session;
28struct Message;
29class GetQuotaJobPrivate;
30
31/**
32 * Gets resource limits for a quota root.
33 *
34 * Quotas are defined with respect to "resources" and "quota roots".
35 * A resource is a numerical property that can be limited, such
36 * as the octet size of all the messages in a mailbox, or the
37 * number of messages in a mailbox. Each mailbox has one or more
38 * quota roots, which are where the resource limits are defined.
39 * A quota root may or may not be a mailbox name, and an empty
40 * string is a valid quota root. All mailboxes with the same quota
41 * root share the resource limits of the quota root.
42 *
43 * This job can only be run when the session is in the
44 * authenticated (or selected) state.
45 *
46 * This job requires that the server supports the QUOTA
47 * capability, defined in
48 * <a href="http://www.apps.ietf.org/rfc/rfc2087.html">RFC 2087</a>.
49 */
50class KIMAP_EXPORT GetQuotaJob : public QuotaJobBase
51{
52 Q_OBJECT
53 Q_DECLARE_PRIVATE( GetQuotaJob )
54
55 friend class SessionPrivate;
56
57 public:
58 explicit GetQuotaJob( Session *session );
59 virtual ~GetQuotaJob();
60
61 /**
62 * Set the quota root to get the resource limits for.
63 * @param root the quota root to set
64 * @see GetQuotaRootJob
65 */
66 void setRoot(const QByteArray &root);
67 /**
68 * The quota root that resource limit information will be fetched for.
69 */
70 QByteArray root() const;
71
72 protected:
73 virtual void doStart();
74 virtual void handleResponse(const Message &response);
75
76};
77
78}
79
80#endif
81