Akonadi::MessageStatus

Search for usage in LXR

#include <messagestatus.h>

Properties

bool hasAttachment
 
bool hasError
 
bool hasInvitation
 
bool isDeleted
 
bool isEncrypted
 
bool isForwarded
 
bool isHam
 
bool isIgnored
 
bool isImportant
 
bool isOfUnknownStatus
 
bool isQueued
 
bool isRead
 
bool isReplied
 
bool isSent
 
bool isSigned
 
bool isSpam
 
bool isToAct
 
bool isWatched
 

Public Member Functions

 MessageStatus ()
 
void clear ()
 
void fromQInt32 (qint32 status)
 
bool hasAttachment () const
 
bool hasError () const
 
bool hasInvitation () const
 
bool isDeleted () const
 
bool isEncrypted () const
 
bool isForwarded () const
 
bool isHam () const
 
bool isIgnored () const
 
bool isImportant () const
 
bool isOfUnknownStatus () const
 
bool isQueued () const
 
bool isRead () const
 
bool isReplied () const
 
bool isSent () const
 
bool isSigned () const
 
bool isSpam () const
 
bool isToAct () const
 
bool isWatched () const
 
bool operator!= (MessageStatus other) const
 
bool operator& (MessageStatus other) const
 
bool operator== (MessageStatus other) const
 
void set (MessageStatus other)
 
void setDeleted (bool deleted=true)
 
void setEncrypted (bool value=true)
 
void setForwarded (bool forwarded=true)
 
void setHam (bool ham=true)
 
void setHasAttachment (bool hasAttachment=true)
 
void setHasError (bool value=true)
 
void setHasInvitation (bool hasInvitation=true)
 
void setIgnored (bool ignored=true)
 
void setImportant (bool important=true)
 
void setQueued (bool queued=true)
 
void setRead (bool read=true)
 
void setReplied (bool replied=true)
 
void setSent (bool sent=true)
 
void setSigned (bool value=true)
 
void setSpam (bool spam=true)
 
void setStatusFromFlags (const QSet< QByteArray > &flags)
 
void setStatusFromStr (const QString &aStr)
 
void setToAct (bool toAct=true)
 
void setWatched (bool watched=true)
 
QSet< QByteArraystatusFlags () const
 
QString statusStr () const
 
void toggle (MessageStatus other)
 
qint32 toQInt32 () const
 

Static Public Member Functions

static const MessageStatus statusDeleted ()
 
static const MessageStatus statusEncrypted ()
 
static const MessageStatus statusForwarded ()
 
static const MessageStatus statusHam ()
 
static const MessageStatus statusHasAttachment ()
 
static const MessageStatus statusHasError ()
 
static const MessageStatus statusHasInvitation ()
 
static const MessageStatus statusIgnored ()
 
static const MessageStatus statusImportant ()
 
static const MessageStatus statusQueued ()
 
static const MessageStatus statusRead ()
 
static const MessageStatus statusReplied ()
 
static const MessageStatus statusSent ()
 
static const MessageStatus statusSigned ()
 
static const MessageStatus statusSpam ()
 
static const MessageStatus statusToAct ()
 
static const MessageStatus statusUnread ()
 
static const MessageStatus statusWatched ()
 

Detailed Description

Akonadi KMime Message Status.

Author
Andreas Gungl a.gun.nosp@m.gl@g.nosp@m.mx.de

The class encapsulates the handling of the different flags which describe the status of a message. The flags themselves are not intended to be used outside this class.

In the status pairs Watched/Ignored and Spam/Ham, there both values can't be set at the same time, however they can be unset at the same time.

Note that this class does not sync with the Akonadi storage. It is used as an in-memory helper when manipulating Akonadi items.

Since
4.6.

Definition at line 37 of file messagestatus.h.

Property Documentation

◆ hasAttachment

bool Akonadi::MessageStatus::hasAttachment
readwrite

Definition at line 53 of file messagestatus.h.

◆ hasError

bool Akonadi::MessageStatus::hasError
readwrite

Definition at line 57 of file messagestatus.h.

◆ hasInvitation

bool Akonadi::MessageStatus::hasInvitation
readwrite

Definition at line 54 of file messagestatus.h.

◆ isDeleted

bool Akonadi::MessageStatus::isDeleted
readwrite

Definition at line 42 of file messagestatus.h.

◆ isEncrypted

bool Akonadi::MessageStatus::isEncrypted
readwrite

Definition at line 55 of file messagestatus.h.

◆ isForwarded

bool Akonadi::MessageStatus::isForwarded
readwrite

Definition at line 44 of file messagestatus.h.

◆ isHam

bool Akonadi::MessageStatus::isHam
readwrite

Definition at line 51 of file messagestatus.h.

◆ isIgnored

bool Akonadi::MessageStatus::isIgnored
readwrite

Definition at line 49 of file messagestatus.h.

◆ isImportant

bool Akonadi::MessageStatus::isImportant
readwrite

Definition at line 47 of file messagestatus.h.

◆ isOfUnknownStatus

bool Akonadi::MessageStatus::isOfUnknownStatus
read

Definition at line 40 of file messagestatus.h.

◆ isQueued

bool Akonadi::MessageStatus::isQueued
readwrite

Definition at line 45 of file messagestatus.h.

◆ isRead

bool Akonadi::MessageStatus::isRead
readwrite

Definition at line 41 of file messagestatus.h.

◆ isReplied

bool Akonadi::MessageStatus::isReplied
readwrite

Definition at line 43 of file messagestatus.h.

◆ isSent

bool Akonadi::MessageStatus::isSent
readwrite

Definition at line 46 of file messagestatus.h.

◆ isSigned

bool Akonadi::MessageStatus::isSigned
readwrite

Definition at line 56 of file messagestatus.h.

◆ isSpam

bool Akonadi::MessageStatus::isSpam
readwrite

Definition at line 50 of file messagestatus.h.

◆ isToAct

bool Akonadi::MessageStatus::isToAct
readwrite

Definition at line 52 of file messagestatus.h.

◆ isWatched

bool Akonadi::MessageStatus::isWatched
readwrite

Definition at line 48 of file messagestatus.h.

Constructor & Destructor Documentation

◆ MessageStatus()

Akonadi::MessageStatus::MessageStatus ( )

Constructor - sets status initially to unknown.

Definition at line 44 of file messagestatus.cpp.

Member Function Documentation

◆ clear()

void Akonadi::MessageStatus::clear ( )

Clear all status flags, this resets to unknown.

Definition at line 72 of file messagestatus.cpp.

◆ fromQInt32()

void Akonadi::MessageStatus::fromQInt32 ( qint32 status)

Set the status as a whole e.g.

for reading from an index. Don't manipulte the index via this value, this bypasses all integrity checks in the setter methods.

Parameters
statusThe status encoded in bits to be set in this instance.

Definition at line 448 of file messagestatus.cpp.

◆ hasAttachment()

bool Akonadi::MessageStatus::hasAttachment ( ) const
nodiscard

Check for Attachment status.

Returns
true if status indicates an attachment.

Definition at line 258 of file messagestatus.cpp.

◆ hasError()

bool Akonadi::MessageStatus::hasError ( ) const
nodiscard

Check for error status.

Returns
true if status indicates an error.

Definition at line 278 of file messagestatus.cpp.

◆ hasInvitation()

bool Akonadi::MessageStatus::hasInvitation ( ) const
nodiscard

Check for Invitation status.

Returns
true if status indicates an invitation.

Definition at line 263 of file messagestatus.cpp.

◆ isDeleted()

bool Akonadi::MessageStatus::isDeleted ( ) const
nodiscard

Check for Deleted status.

Returns
true if status is deleted.

Definition at line 203 of file messagestatus.cpp.

◆ isEncrypted()

bool Akonadi::MessageStatus::isEncrypted ( ) const
nodiscard

Check for Encrypted status.

Returns
true if status is encrypted.

Definition at line 273 of file messagestatus.cpp.

◆ isForwarded()

bool Akonadi::MessageStatus::isForwarded ( ) const
nodiscard

Check for Forwarded status.

Returns
true if status is forwarded.

Definition at line 213 of file messagestatus.cpp.

◆ isHam()

bool Akonadi::MessageStatus::isHam ( ) const
nodiscard

Check for Ham status.

Returns
true if status is not spam.

Definition at line 253 of file messagestatus.cpp.

◆ isIgnored()

bool Akonadi::MessageStatus::isIgnored ( ) const
nodiscard

Check for Ignored status.

Returns
true if status is ignored.

Definition at line 238 of file messagestatus.cpp.

◆ isImportant()

bool Akonadi::MessageStatus::isImportant ( ) const
nodiscard

Check for Important status.

Returns
true if status is important.

Definition at line 228 of file messagestatus.cpp.

◆ isOfUnknownStatus()

bool Akonadi::MessageStatus::isOfUnknownStatus ( ) const
nodiscard

Check for Unknown status.

Returns
true if status is unknown.

Definition at line 193 of file messagestatus.cpp.

◆ isQueued()

bool Akonadi::MessageStatus::isQueued ( ) const
nodiscard

Check for Queued status.

Returns
true if status is queued.

Definition at line 218 of file messagestatus.cpp.

◆ isRead()

bool Akonadi::MessageStatus::isRead ( ) const
nodiscard

Check for Read status.

Note that ignored messages are read.

Returns
true if status is read.

Definition at line 198 of file messagestatus.cpp.

◆ isReplied()

bool Akonadi::MessageStatus::isReplied ( ) const
nodiscard

Check for Replied status.

Returns
true if status is replied.

Definition at line 208 of file messagestatus.cpp.

◆ isSent()

bool Akonadi::MessageStatus::isSent ( ) const
nodiscard

Check for Sent status.

Returns
true if status is sent.

Definition at line 223 of file messagestatus.cpp.

◆ isSigned()

bool Akonadi::MessageStatus::isSigned ( ) const
nodiscard

Check for Signed status.

Returns
true if status is signed.

Definition at line 268 of file messagestatus.cpp.

◆ isSpam()

bool Akonadi::MessageStatus::isSpam ( ) const
nodiscard

Check for Spam status.

Returns
true if status is spam.

Definition at line 248 of file messagestatus.cpp.

◆ isToAct()

bool Akonadi::MessageStatus::isToAct ( ) const
nodiscard

Check for ToAct status.

Returns
true if status is action item.

Definition at line 243 of file messagestatus.cpp.

◆ isWatched()

bool Akonadi::MessageStatus::isWatched ( ) const
nodiscard

Check for Watched status.

Returns
true if status is watched.

Definition at line 233 of file messagestatus.cpp.

◆ operator!=()

bool Akonadi::MessageStatus::operator!= ( Akonadi::MessageStatus other) const

Compare the status with that from another instance.

Returns
true if the stati are equal, false if different.
Parameters
othermessage status to compare with current object

Definition at line 54 of file messagestatus.cpp.

◆ operator&()

bool Akonadi::MessageStatus::operator& ( Akonadi::MessageStatus other) const

Check, if some of the flags in the status match with those flags from another instance.

Returns
true if at least one flag is set in both stati.
Parameters
othermessage status to compare objects' flags

Definition at line 59 of file messagestatus.cpp.

◆ operator==()

bool Akonadi::MessageStatus::operator== ( Akonadi::MessageStatus other) const

Compare the status with that from another instance.

Returns
true if the stati are equal, false if different.
Parameters
othermessage status to compare with current object

Definition at line 49 of file messagestatus.cpp.

◆ set()

void Akonadi::MessageStatus::set ( Akonadi::MessageStatus other)

Set / add stati described by another MessageStatus object.

This can be used to merge in multiple stati at once without using the single setter methods. However, internally the setters are used anyway to ensure the integrity of the resulting status.

Parameters
othermessage status to set

Definition at line 77 of file messagestatus.cpp.

◆ setDeleted()

void Akonadi::MessageStatus::setDeleted ( bool deleted = true)

Set the status for deleted.

Parameters
deletedSet (true) or unset (false) this status flag.

Definition at line 292 of file messagestatus.cpp.

◆ setEncrypted()

void Akonadi::MessageStatus::setEncrypted ( bool value = true)

Set the status to encrypted.

Parameters
valueSet (true) or unset (false) this status flag.

Definition at line 425 of file messagestatus.cpp.

◆ setForwarded()

void Akonadi::MessageStatus::setForwarded ( bool forwarded = true)

Set the status for forwarded.

Parameters
forwardedSet (true) or unset (false) this status flag.

Definition at line 310 of file messagestatus.cpp.

◆ setHam()

void Akonadi::MessageStatus::setHam ( bool ham = true)

Set the status to not spam.

Parameters
hamSet (true) or unset (false) this status flag.

Definition at line 388 of file messagestatus.cpp.

◆ setHasAttachment()

void Akonadi::MessageStatus::setHasAttachment ( bool hasAttachment = true)

Set the status for an attachment.

Parameters
hasAttachmentSet (true) or unset (false) this status flag.

Definition at line 398 of file messagestatus.cpp.

◆ setHasError()

void Akonadi::MessageStatus::setHasError ( bool value = true)

Set the status to error.

Parameters
valueSet (true) or unset (false) this status flag.

Definition at line 434 of file messagestatus.cpp.

◆ setHasInvitation()

void Akonadi::MessageStatus::setHasInvitation ( bool hasInvitation = true)

Set the status for an invitation.

Parameters
hasInvitationSet (true) or unset (false) this status flag.

Definition at line 407 of file messagestatus.cpp.

◆ setIgnored()

void Akonadi::MessageStatus::setIgnored ( bool ignored = true)

Set the status to ignored.

Parameters
ignoredSet (true) or unset (false) this status flag.

Definition at line 358 of file messagestatus.cpp.

◆ setImportant()

void Akonadi::MessageStatus::setImportant ( bool important = true)

Set the status for important.

Parameters
importantSet (true) or unset (false) this status flag.

Definition at line 338 of file messagestatus.cpp.

◆ setQueued()

void Akonadi::MessageStatus::setQueued ( bool queued = true)

Set the status for queued.

Parameters
queuedSet (true) or unset (false) this status flag.

Definition at line 319 of file messagestatus.cpp.

◆ setRead()

void Akonadi::MessageStatus::setRead ( bool read = true)

Set the status to read.

Parameters
readnew read status

Definition at line 283 of file messagestatus.cpp.

◆ setReplied()

void Akonadi::MessageStatus::setReplied ( bool replied = true)

Set the status for replied.

Parameters
repliedSet (true) or unset (false) this status flag.

Definition at line 301 of file messagestatus.cpp.

◆ setSent()

void Akonadi::MessageStatus::setSent ( bool sent = true)

Set the status for sent.

Parameters
sentSet (true) or unset (false) this status flag.

Definition at line 328 of file messagestatus.cpp.

◆ setSigned()

void Akonadi::MessageStatus::setSigned ( bool value = true)

Set the status to signed.

Parameters
valueSet (true) or unset (false) this status flag.

Definition at line 416 of file messagestatus.cpp.

◆ setSpam()

void Akonadi::MessageStatus::setSpam ( bool spam = true)

Set the status to spam.

Parameters
spamSet (true) or unset (false) this status flag.

Definition at line 378 of file messagestatus.cpp.

◆ setStatusFromFlags()

void Akonadi::MessageStatus::setStatusFromFlags ( const QSet< QByteArray > & flags)

Set the status as a whole e.g.

for reading from IMAP flags.

Parameters
flagsset of flags for status as a whole

Definition at line 617 of file messagestatus.cpp.

◆ setStatusFromStr()

void Akonadi::MessageStatus::setStatusFromStr ( const QString & aStr)

Set the status based on a string representation.

Parameters
aStrThe status string to be analyzed. Normally it is a string obtained using getStatusStr().
Note
This code is legacy for the KMail1 indexes

Definition at line 501 of file messagestatus.cpp.

◆ setToAct()

void Akonadi::MessageStatus::setToAct ( bool toAct = true)

Set the status to action item.

Parameters
toActSet (true) or unset (false) this status flag.

Definition at line 368 of file messagestatus.cpp.

◆ setWatched()

void Akonadi::MessageStatus::setWatched ( bool watched = true)

Set the status to watched.

Parameters
watchedSet (true) or unset (false) this status flag.

Definition at line 348 of file messagestatus.cpp.

◆ statusDeleted()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusDeleted ( )
static

Return a predefined status initialized as Deleted as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Deleted.

Definition at line 679 of file messagestatus.cpp.

◆ statusEncrypted()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusEncrypted ( )
static

Return a predefined status initialized as Encrypted as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Encrypted.

Definition at line 777 of file messagestatus.cpp.

◆ statusFlags()

QSet< QByteArray > Akonadi::MessageStatus::statusFlags ( ) const
nodiscard

Get the status as a whole e.g.

for storage as IMAP flags.

Returns
The status encoded in flags.

Definition at line 552 of file messagestatus.cpp.

◆ statusForwarded()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusForwarded ( )
static

Return a predefined status initialized as Forwarded as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Forwarded.

Definition at line 693 of file messagestatus.cpp.

◆ statusHam()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusHam ( )
static

Return a predefined status initialized as Ham as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Ham.

Definition at line 749 of file messagestatus.cpp.

◆ statusHasAttachment()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasAttachment ( )
static

Return a predefined status initialized as Attachment as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Attachment.

Definition at line 756 of file messagestatus.cpp.

◆ statusHasError()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasError ( )
static

Return a predefined status initialized as Error as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Error.

Definition at line 784 of file messagestatus.cpp.

◆ statusHasInvitation()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusHasInvitation ( )
static

Return a predefined status initialized as Invitation as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Invitation.

Definition at line 763 of file messagestatus.cpp.

◆ statusIgnored()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusIgnored ( )
static

Return a predefined status initialized as Ignored as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Ignored.

Definition at line 728 of file messagestatus.cpp.

◆ statusImportant()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusImportant ( )
static

Return a predefined status initialized as Important as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Important.

Definition at line 714 of file messagestatus.cpp.

◆ statusQueued()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusQueued ( )
static

Return a predefined status initialized as Queued as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Queued.

Definition at line 700 of file messagestatus.cpp.

◆ statusRead()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusRead ( )
static

Return a predefined status initialized as Read as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Read.

Definition at line 672 of file messagestatus.cpp.

◆ statusReplied()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusReplied ( )
static

Return a predefined status initialized as Replied as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Replied.

Definition at line 686 of file messagestatus.cpp.

◆ statusSent()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusSent ( )
static

Return a predefined status initialized as Sent as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Sent.

Definition at line 707 of file messagestatus.cpp.

◆ statusSigned()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusSigned ( )
static

Return a predefined status initialized as Signed as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Signed.

Definition at line 770 of file messagestatus.cpp.

◆ statusSpam()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusSpam ( )
static

Return a predefined status initialized as Spam as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Spam.

Definition at line 742 of file messagestatus.cpp.

◆ statusStr()

QString Akonadi::MessageStatus::statusStr ( ) const
nodiscard

Convert the status to a string representation.

Returns
A string containing coded uppercase letters which describe the status.
Note
This code is legacy for the KMail1 indexes

Definition at line 453 of file messagestatus.cpp.

◆ statusToAct()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusToAct ( )
static

Return a predefined status initialized as Action Item as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as ToAct.

Definition at line 735 of file messagestatus.cpp.

◆ statusUnread()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusUnread ( )
static

Return a special status that expresses Unread.

This status can only be used for comparison with other states.

Definition at line 665 of file messagestatus.cpp.

◆ statusWatched()

const Akonadi::MessageStatus Akonadi::MessageStatus::statusWatched ( )
static

Return a predefined status initialized as Watched as is useful e.g.

when providing a state for comparison.

Returns
A reference to a status instance initialized as Watched.

Definition at line 721 of file messagestatus.cpp.

◆ toggle()

void Akonadi::MessageStatus::toggle ( Akonadi::MessageStatus other)

Toggle one or more stati described by another MessageStatus object.

Internally the setters are used to ensure the integrity of the resulting status.

Parameters
othermessage status to toggle

Definition at line 138 of file messagestatus.cpp.

◆ toQInt32()

qint32 Akonadi::MessageStatus::toQInt32 ( ) const
nodiscard

Get the status as a whole e.g.

for storage in an index. D on't manipulte the *index via this value, this bypasses all integrity checks in the setter methods.

Returns
The status encoded in bits.

Definition at line 443 of file messagestatus.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:31 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.