Akonadi::CollectionQuotaAttribute

Search for usage in LXR

Akonadi::CollectionQuotaAttribute Class Reference

#include <collectionquotaattribute.h>

Inheritance diagram for Akonadi::CollectionQuotaAttribute:

Public Member Functions

 CollectionQuotaAttribute ()
 
 CollectionQuotaAttribute (qint64 currentValue, qint64 maxValue)
 
 ~CollectionQuotaAttribute () override
 
Attributeclone () const override
 
qint64 currentValue () const
 
void deserialize (const QByteArray &data) override
 
qint64 maximumValue () const
 
QByteArray serialized () const override
 
void setCurrentValue (qint64 value)
 
void setMaximumValue (qint64 value)
 
QByteArray type () const override
 
- Public Member Functions inherited from Akonadi::Attribute
virtual ~Attribute ()
 

Additional Inherited Members

- Public Types inherited from Akonadi::Attribute
using List = QList< Attribute * >
 
- Protected Member Functions inherited from Akonadi::Attribute
 Attribute (const Attribute &)=default
 

Detailed Description

Attribute that provides quota information for a collection.

This attribute class provides quota information (e.g. current fill value and maximum fill value) for an Akonadi collection.

Example:

using namespace Akonadi;
const Collection collection = collectionFetchJob->collections().at(0);
if ( collection.hasAttribute<CollectionQuotaAttribute>() ) {
qDebug() << "current value" << attribute->currentValue();
}
Author
Kevin Ottens ervin[email protected]@kde[email protected].org
Since
4.4

Definition at line 41 of file collectionquotaattribute.h.

Constructor & Destructor Documentation

◆ CollectionQuotaAttribute() [1/2]

CollectionQuotaAttribute::CollectionQuotaAttribute ( )
explicit

Creates a new collection quota attribute.

Definition at line 20 of file collectionquotaattribute.cpp.

◆ CollectionQuotaAttribute() [2/2]

CollectionQuotaAttribute::CollectionQuotaAttribute ( qint64  currentValue,
qint64  maxValue 
)

Creates a new collection quota attribute with initial values.

Parameters
currentValueThe current quota value in bytes.
maxValueThe maximum quota value in bytes.

Definition at line 25 of file collectionquotaattribute.cpp.

◆ ~CollectionQuotaAttribute()

CollectionQuotaAttribute::~CollectionQuotaAttribute ( )
overridedefault

Destroys the collection quota attribute.

Member Function Documentation

◆ clone()

Akonadi::Attribute * CollectionQuotaAttribute::clone ( ) const
overridevirtual

Creates a copy of this attribute.

Implements Akonadi::Attribute.

Definition at line 59 of file collectionquotaattribute.cpp.

◆ currentValue()

qint64 CollectionQuotaAttribute::currentValue ( ) const

Returns the current quota value in bytes.

Definition at line 44 of file collectionquotaattribute.cpp.

◆ deserialize()

void CollectionQuotaAttribute::deserialize ( const QByteArray data)
overridevirtual

Sets the data of this attribute, using the same encoding as returned by toByteArray().

Parameters
dataThe encoded attribute data.

Implements Akonadi::Attribute.

Definition at line 69 of file collectionquotaattribute.cpp.

◆ maximumValue()

qint64 CollectionQuotaAttribute::maximumValue ( ) const

Returns the maximum quota value in bytes.

Definition at line 49 of file collectionquotaattribute.cpp.

◆ serialized()

QByteArray CollectionQuotaAttribute::serialized ( ) const
overridevirtual

Returns a QByteArray representation of the attribute which will be storaged.

This can be raw binary data, no encoding needs to be applied.

Implements Akonadi::Attribute.

Definition at line 64 of file collectionquotaattribute.cpp.

◆ setCurrentValue()

void CollectionQuotaAttribute::setCurrentValue ( qint64  value)

Sets the current quota value for the collection.

Parameters
valueThe current quota value in bytes.

Definition at line 34 of file collectionquotaattribute.cpp.

◆ setMaximumValue()

void CollectionQuotaAttribute::setMaximumValue ( qint64  value)

Sets the maximum quota value for the collection.

Parameters
valueThe maximum quota value in bytes.

Definition at line 39 of file collectionquotaattribute.cpp.

◆ type()

QByteArray CollectionQuotaAttribute::type ( ) const
overridevirtual

Returns the type of the attribute.

Implements Akonadi::Attribute.

Definition at line 54 of file collectionquotaattribute.cpp.


The documentation for this class was generated from the following files:
Represents a collection of PIM items.
Definition: collection.h:61
Attribute that provides quota information for a collection.
qint64 currentValue() const
Returns the current quota value in bytes.
Attribute * attribute(const QByteArray &name)
Returns the attribute of the given type name if available, 0 otherwise.
Definition: collection.cpp:176
bool hasAttribute(const QByteArray &name) const
Returns true if the collection has an attribute of the given type name, false otherwise.
Definition: collection.cpp:161
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Aug 8 2022 04:03:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.