Akonadi::MessageStatus Class
class Akonadi::MessageStatusAkonadi KMime Message Status. Author: Andreas Gungl <a.gungl@gmx.de>. More...
| Header: | #include <Akonadi/MessageStatus> |
| CMake: | find_package(KPim6AkonadiMime REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiMime) |
Public 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 |
| void | set(Akonadi::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<QByteArray> | statusFlags() const |
| QString | statusStr() const |
| qint32 | toQInt32() const |
| void | toggle(Akonadi::MessageStatus other) |
| bool | operator!=(Akonadi::MessageStatus other) const |
| bool | operator&(Akonadi::MessageStatus other) const |
| bool | operator==(const Akonadi::MessageStatus &other) const |
Static Public Members
| const Akonadi::MessageStatus | statusDeleted() |
| const Akonadi::MessageStatus | statusEncrypted() |
| const Akonadi::MessageStatus | statusForwarded() |
| const Akonadi::MessageStatus | statusHam() |
| const Akonadi::MessageStatus | statusHasAttachment() |
| const Akonadi::MessageStatus | statusHasError() |
| const Akonadi::MessageStatus | statusHasInvitation() |
| const Akonadi::MessageStatus | statusIgnored() |
| const Akonadi::MessageStatus | statusImportant() |
| const Akonadi::MessageStatus | statusQueued() |
| const Akonadi::MessageStatus | statusRead() |
| const Akonadi::MessageStatus | statusReplied() |
| const Akonadi::MessageStatus | statusSent() |
| const Akonadi::MessageStatus | statusSigned() |
| const Akonadi::MessageStatus | statusSpam() |
| const Akonadi::MessageStatus | statusToAct() |
| const Akonadi::MessageStatus | statusUnread() |
| const Akonadi::MessageStatus | statusWatched() |
Detailed Description
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.
Member Function Documentation
MessageStatus::MessageStatus()
Constructor - sets status initially to unknown.
void MessageStatus::clear()
Clear all status flags, this resets to unknown.
void 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. status The status encoded in bits to be set in this instance.
bool MessageStatus::hasAttachment() const
Check for Attachment status. Returns true if status indicates an attachment.
See also setHasAttachment().
bool MessageStatus::hasError() const
Check for error status. Returns true if status indicates an error.
See also setHasError().
bool MessageStatus::hasInvitation() const
Check for Invitation status. Returns true if status indicates an invitation.
See also setHasInvitation().
bool MessageStatus::isDeleted() const
Check for Deleted status. Returns true if status is deleted.
bool MessageStatus::isEncrypted() const
Check for Encrypted status. Returns true if status is encrypted.
bool MessageStatus::isForwarded() const
Check for Forwarded status. Returns true if status is forwarded.
bool MessageStatus::isHam() const
Check for Ham status. Returns true if status is not spam.
bool MessageStatus::isIgnored() const
Check for Ignored status. Returns true if status is ignored.
bool MessageStatus::isImportant() const
Check for Important status. Returns true if status is important.
bool MessageStatus::isOfUnknownStatus() const
Check for Unknown status. Returns true if status is unknown.
bool MessageStatus::isQueued() const
Check for Queued status. Returns true if status is queued.
bool MessageStatus::isRead() const
Check for Read status. Note that ignored messages are read. Returns true if status is read.
bool MessageStatus::isReplied() const
Check for Replied status. Returns true if status is replied.
bool MessageStatus::isSent() const
Check for Sent status. Returns true if status is sent.
bool MessageStatus::isSigned() const
Check for Signed status. Returns true if status is signed.
bool MessageStatus::isSpam() const
Check for Spam status. Returns true if status is spam.
bool MessageStatus::isToAct() const
Check for ToAct status. Returns true if status is action item.
bool MessageStatus::isWatched() const
Check for Watched status. Returns true if status is watched.
void 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. other message status to set
void MessageStatus::setDeleted(bool deleted = true)
Set the status for deleted. deleted Set (true) or unset (false) this status flag.
See also isDeleted().
void MessageStatus::setEncrypted(bool value = true)
Set the status to encrypted. value Set (true) or unset (false) this status flag.
See also isEncrypted().
void MessageStatus::setForwarded(bool forwarded = true)
Set the status for forwarded. forwarded Set (true) or unset (false) this status flag.
See also isForwarded().
void MessageStatus::setHam(bool ham = true)
Set the status to not spam. ham Set (true) or unset (false) this status flag.
See also isHam().
void MessageStatus::setHasAttachment(bool hasAttachment = true)
Set the status for an attachment. hasAttachment Set (true) or unset (false) this status flag.
See also hasAttachment().
void MessageStatus::setHasError(bool value = true)
Set the status to error. value Set (true) or unset (false) this status flag.
See also hasError().
void MessageStatus::setHasInvitation(bool hasInvitation = true)
Set the status for an invitation. hasInvitation Set (true) or unset (false) this status flag.
See also hasInvitation().
void MessageStatus::setIgnored(bool ignored = true)
Set the status to ignored. ignored Set (true) or unset (false) this status flag.
See also isIgnored().
void MessageStatus::setImportant(bool important = true)
Set the status for important. important Set (true) or unset (false) this status flag.
See also isImportant().
void MessageStatus::setQueued(bool queued = true)
Set the status for queued. queued Set (true) or unset (false) this status flag.
See also isQueued().
void MessageStatus::setRead(bool read = true)
Set the status to read read new read status
See also isRead().
void MessageStatus::setReplied(bool replied = true)
Set the status for replied. replied Set (true) or unset (false) this status flag.
See also isReplied().
void MessageStatus::setSent(bool sent = true)
Set the status for sent. sent Set (true) or unset (false) this status flag.
See also isSent().
void MessageStatus::setSigned(bool value = true)
Set the status to signed. value Set (true) or unset (false) this status flag.
See also isSigned().
void MessageStatus::setSpam(bool spam = true)
Set the status to spam. spam Set (true) or unset (false) this status flag.
See also isSpam().
void MessageStatus::setStatusFromFlags(const QSet<QByteArray> &flags)
Set the status as a whole e.g. for reading from IMAP flags. flags set of flags for status as a whole
void MessageStatus::setStatusFromStr(const QString &aStr)
Set the status based on a string representation. aStr The status string to be analyzed. Normally it is a string obtained using getStatusStr().
Note This code is legacy for the KMail1 indexes
void MessageStatus::setToAct(bool toAct = true)
Set the status to action item. toAct Set (true) or unset (false) this status flag.
See also isToAct().
void MessageStatus::setWatched(bool watched = true)
Set the status to watched. watched Set (true) or unset (false) this status flag.
See also isWatched().
[static] const Akonadi::MessageStatus MessageStatus::statusDeleted()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusEncrypted()
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.
QSet<QByteArray> MessageStatus::statusFlags() const
Get the status as a whole e.g. for storage as IMAP flags. Returns The status encoded in flags.
[static] const Akonadi::MessageStatus MessageStatus::statusForwarded()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusHam()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusHasAttachment()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusHasError()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusHasInvitation()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusIgnored()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusImportant()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusQueued()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusRead()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusReplied()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusSent()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusSigned()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusSpam()
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.
QString MessageStatus::statusStr() const
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
[static] const Akonadi::MessageStatus MessageStatus::statusToAct()
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.
[static] const Akonadi::MessageStatus MessageStatus::statusUnread()
Return a special status that expresses Unread. This status can only be used for comparison with other states. Unread is special because search is performed using a simple bit-mask comparison, which cannot return nonzero for an *un*set flag. This special flag works around that.
[static] const Akonadi::MessageStatus MessageStatus::statusWatched()
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.
qint32 MessageStatus::toQInt32() const
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.
void 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. other message status to toggle
bool MessageStatus::operator!=(Akonadi::MessageStatus other) const
Compare the status with that from another instance. Returns true if the stati are equal, false if different. other message status to compare with current object
bool 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. other message status to compare objects' flags
[constexpr noexcept default] bool MessageStatus::operator==(const Akonadi::MessageStatus &other) const
Compare the status with that from another instance. Returns true if the stati are equal, false if different. other message status to compare with current object