KIMAP::GetQuotaRootJob Class

Gets the quota root and resource limits for a mailbox. More...

Header: #include <KIMAP/GetQuotaRootJob>
CMake: find_package(KPim6IMAP REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::IMAP)
Inherits: KIMAP::QuotaJobBase

Public Functions

GetQuotaRootJob(KIMAP::Session *session)
QMap<QByteArray, qint64> allLimits(const QString &root) const
QMap<QByteArray, qint64> allUsages(const QString &root) const
qint64 limit(const QString &root, const QByteArray &resource) const
QString mailBox() const
QStringList roots() const
void setMailBox(const QString &mailBox)
qint64 usage(const QString &root, const QByteArray &resource) const

Detailed Description

Quotas are defined with respect to "resources" and "quota roots". A resource is a numerical property that can be limited, such as the octet size of all the messages in a mailbox, or the number of messages in a mailbox. Each mailbox has one or more quota roots, which are where the resource limits are defined. A quota root may or may not be a mailbox name, and an empty string is a valid quota root. All mailboxes with the same quota root share the resource limits of the quota root.

This job can only be run when the session is in the authenticated (or selected) state.

This job requires that the server supports the QUOTA capability, defined in RFC 2087.

Member Function Documentation

[explicit] GetQuotaRootJob::GetQuotaRootJob(KIMAP::Session *session)

QMap<QByteArray, qint64> GetQuotaRootJob::allLimits(const QString &root) const

Get a map containing all resource limits for a quota root.

root the quota root (in decoded Unicode form, as returned by roots()) to get resource limits for

Returns a map from resource names to limits

QMap<QByteArray, qint64> GetQuotaRootJob::allUsages(const QString &root) const

Get a map containing all resource usage figures for a quota root.

root the quota root (in decoded Unicode form, as returned by roots()) to get resource usage figures for

Returns a map from resource names to usage figures

qint64 GetQuotaRootJob::limit(const QString &root, const QByteArray &resource) const

Get the current limit for a resource.

root the quota root (in decoded Unicode form, as returned by roots()) to get the resource limit for

resource the resource to get the limit for

Returns the resource limit in appropriate units, or -1 if the limit is unknown or there is no limit on the resource

QString GetQuotaRootJob::mailBox() const

The mailbox that the quota roots will be fetched for.

See also setMailBox().

QStringList GetQuotaRootJob::roots() const

The quota roots for the mailbox.

Mailbox names are returned in their decoded Unicode form. When the server speaks IMAP4rev2 (RFC 9051) or has UTF8=ACCEPT enabled (RFC 9755) the bytes from the wire are already UTF-8; otherwise they are mUTF-7-encoded per RFC 3501 and are decoded here so that callers never see the wire form.

void GetQuotaRootJob::setMailBox(const QString &mailBox)

Set the mailbox to get the quota roots for.

mailBox the name of an existing mailbox

See also mailBox().

qint64 GetQuotaRootJob::usage(const QString &root, const QByteArray &resource) const

Get the current usage for a resource.

Note that if there is no limit for a resource, the server will not provide information about resource usage.

root the quota root (in decoded Unicode form, as returned by roots()) to get the resource usage for

resource the resource to get the usage for

Returns the resource usage in appropriate units, or -1 if the usage is unknown or there is no limit on the resource