KIMAP

quotajobbase.h
1/*
2 SPDX-FileCopyrightText: 2009 Andras Mantia <amantia@kde.org>
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
13namespace KIMAP
14{
15class Session;
16struct Response;
17class QuotaJobBasePrivate;
18
19/**
20 * Base class for jobs that operate on mailbox quotas
21 *
22 * Provides support for the IMAP QUOTA extension, as defined by
23 * <a href="https://tools.ietf.org/html/rfc2087" title="IMAP QUOTA extension">RFC 2087</a>.
24 *
25 * This class cannot be used directly, you must subclass it and reimplement
26 * at least the doStart() method.
27 */
28class KIMAP_EXPORT QuotaJobBase : public Job
29{
30 Q_OBJECT
31 Q_DECLARE_PRIVATE(QuotaJobBase)
32
33 friend class SessionPrivate;
34
35public:
36 explicit QuotaJobBase(Session *session);
37 ~QuotaJobBase() override;
38
39 /**
40 * Get the current usage for a resource.
41 *
42 * All quota jobs will normally cause the server to return
43 * details of resource usage for all resources that were
44 * queried or modified by the job.
45 *
46 * Note that RFC 2087 is slightly ambiguous about whether
47 * SETQUOTA will cause this information to be sent by the
48 * server.
49 *
50 * Note that if there is no limit for a resource, the
51 * server will not provide information about resource
52 * usage.
53 *
54 * @param resource the resource to get the usage for
55 * @return the resource usage in appropriate units, or -1
56 * if the usage is unknown or there is no
57 * limit on the resource
58 */
59 [[nodiscard]] qint64 usage(const QByteArray &resource);
60 /**
61 * Get the current limit for a resource.
62 *
63 * All quota jobs will normally cause the server to return
64 * details of resource limits for all resources that were
65 * queried or modified by the job.
66 *
67 * Note that RFC 2087 is slightly ambiguous about whether
68 * SETQUOTA will cause this information to be sent by the
69 * server.
70 *
71 * @param resource the resource to get the limit for
72 * @return the resource limit in appropriate units, or -1
73 * if the limit is unknown or there is no limit
74 * on the resource
75 */
76 [[nodiscard]] qint64 limit(const QByteArray &resource);
77
78protected:
79 QuotaJobBase(JobPrivate &dd);
80};
81
82}
Base class for jobs that operate on mailbox quotas.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:37 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.